fdroid-client/libs/index/build.gradle

128 lines
3.9 KiB
Groovy

plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.0'
id 'com.android.library'
id 'org.jetbrains.dokka'
id "org.jlleitschuh.gradle.ktlint" version "10.2.1"
id 'com.vanniktech.maven.publish'
}
kotlin {
android {
compilations.all {
kotlinOptions.jvmTarget = '1.8'
}
publishLibraryVariants("release")
}
// def hostOs = System.getProperty("os.name")
// def isMingwX64 = hostOs.startsWith("Windows")
// def nativeTarget
// if (hostOs == "Mac OS X") nativeTarget = macosX64('native')
// else if (hostOs == "Linux") nativeTarget = linuxX64("native") {
// binaries { sharedLib { baseName = "fdroid_index" } }
// }
// else if (isMingwX64) nativeTarget = mingwX64("native")
// else throw new GradleException("Host OS is not supported in Kotlin/Native.")
sourceSets {
all {
languageSettings {
optIn('kotlin.RequiresOptIn')
explicitApi('strict')
}
}
commonMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
implementation 'io.github.microutils:kotlin-logging:2.1.21'
implementation project(":libs:download")
implementation "io.ktor:ktor-io:2.1.3"
}
}
commonTest {
dependencies {
implementation project(":libs:sharedTest")
implementation kotlin('test')
implementation "com.goncalossilva:resources:0.2.1"
}
}
// JVM is disabled for now, because Android app is including it instead of Android library
jvmMain {
dependencies {
}
}
jvmTest {
dependencies {
implementation 'junit:junit:4.13.2'
}
}
androidMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect:1.8.0"
implementation 'androidx.core:core-ktx:1.8.0'
implementation "org.slf4j:slf4j-android:1.7.36"
}
}
androidUnitTest {
dependencies {
implementation 'junit:junit:4.13.2'
implementation 'io.mockk:mockk:1.12.4'
}
}
androidInstrumentedTest {
dependencies {
implementation project(":libs:sharedTest")
implementation kotlin('test')
implementation 'androidx.test:runner:1.4.0'
implementation 'androidx.test.ext:junit:1.1.3'
}
}
nativeMain {
dependencies {
}
}
nativeTest {
}
}
}
android {
compileSdkVersion 33
sourceSets {
main.manifest.srcFile('src/androidMain/AndroidManifest.xml')
getByName("androidTest").java.srcDir(file("src/androidAndroidTest/kotlin"))
}
defaultConfig {
minSdkVersion 21
consumerProguardFiles 'consumer-rules.pro'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments disableAnalytics: 'true'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests.returnDefaultValues = true
}
}
signing {
useGpgCmd()
}
import org.jetbrains.dokka.gradle.DokkaTask
tasks.withType(DokkaTask).configureEach {
pluginsMapConfiguration.set(
["org.jetbrains.dokka.base.DokkaBase": """{
"customAssets": ["${file("${rootProject.rootDir}/logo-icon.svg")}"],
"footerMessage": "© 2010-2022 F-Droid Limited and Contributors"
}"""]
)
}
apply from: "${rootProject.rootDir}/gradle/ktlint.gradle"