fdroid-client/index/build.gradle

99 lines
2.7 KiB
Groovy

plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.20'
id 'com.android.library'
id "org.jlleitschuh.gradle.ktlint" version "10.2.1"
}
group = 'org.fdroid'
version = '0.1'
kotlin {
android {
compilations.all {
kotlinOptions.jvmTarget = '1.8'
}
}
// 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.3.2"
implementation 'io.github.microutils:kotlin-logging:2.1.21'
implementation project(":download")
implementation "io.ktor:ktor-io:2.0.0"
}
}
sharedTest {
dependencies {
implementation kotlin('test')
implementation "com.goncalossilva:resources:0.2.1"
}
}
commonTest {
dependsOn(sharedTest)
}
// 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.6.20"
implementation "org.slf4j:slf4j-android:1.7.36"
}
}
androidTest {
dependencies {
implementation 'junit:junit:4.13.2'
}
}
nativeMain {
dependencies {
}
}
nativeTest {
}
}
}
android {
compileSdkVersion 31
sourceSets {
main.manifest.srcFile('src/androidMain/AndroidManifest.xml')
getByName("androidTest").java.srcDir(file("src/androidAndroidTest/kotlin"))
}
defaultConfig {
minSdkVersion 21
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
apply from: "${rootProject.rootDir}/gradle/ktlint.gradle"