fdroid-client/download/build.gradle

101 lines
2.9 KiB
Groovy

plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'com.android.library'
id "org.jlleitschuh.gradle.ktlint" version "10.1.0"
}
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")
else if (isMingwX64) nativeTarget = mingwX64("native")
else throw new GradleException("Host OS is not supported in Kotlin/Native.")
ext {
ktor_version = "1.6.7" //"2.0.0-beta-1"
}
sourceSets {
all {
languageSettings {
optIn('kotlin.RequiresOptIn')
explicitApi('strict')
}
}
commonMain {
dependencies {
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation 'io.github.microutils:kotlin-logging:2.1.21'
}
}
commonTest {
dependencies {
implementation kotlin('test')
implementation "io.ktor:ktor-client-mock:$ktor_version"
}
}
// JVM is disabled for now, because Android app is including it instead of Android library
jvmMain {
dependencies {
implementation "io.ktor:ktor-client-cio:$ktor_version"
}
}
jvmTest {
dependencies {
implementation 'junit:junit:4.13.2'
}
}
androidMain {
dependencies {
implementation "io.ktor:ktor-client-okhttp:$ktor_version"
implementation("com.github.bumptech.glide:glide:4.12.0") {
transitive = false // we don't need all that it pulls in, just the basics
}
implementation "com.github.bumptech.glide:annotations:4.12.0"
implementation 'ch.qos.logback:logback-classic:1.2.5'
}
}
androidTest {
dependencies {
implementation 'junit:junit:4.13.2'
}
}
nativeMain {
dependencies {
implementation "io.ktor:ktor-client-curl:$ktor_version"
}
}
nativeTest {
}
}
}
android {
compileSdkVersion 30
sourceSets.main.manifest.srcFile('src/androidMain/AndroidManifest.xml')
defaultConfig {
minSdkVersion 22
targetSdkVersion 25
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
disable "InvalidPackage" // FIXME remove when Ktor 2.0 has been released
}
}
apply from: "${rootProject.rootDir}/gradle/ktlint.gradle"