fdroid-client/download/build.gradle

126 lines
3.6 KiB
Groovy

plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'com.android.library'
id "org.jlleitschuh.gradle.ktlint" version "10.2.1"
id 'com.vanniktech.maven.publish'
}
group = 'org.fdroid'
version = '0.1'
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")
// else if (isMingwX64) nativeTarget = mingwX64("native")
// else throw new GradleException("Host OS is not supported in Kotlin/Native.")
ext {
ktor_version = "2.0.0"
}
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"
}
}
androidTest {
dependencies {
implementation 'org.json:json:20211205'
implementation 'junit:junit:4.13.2'
implementation 'ch.qos.logback:logback-classic:1.2.10'
}
}
androidAndroidTest {
dependencies {
implementation 'androidx.test:runner:1.4.0'
implementation 'androidx.test.ext:junit:1.1.3'
}
}
nativeMain {
dependencies {
implementation "io.ktor:ktor-client-curl:$ktor_version"
}
}
nativeTest {
}
}
}
android {
compileSdkVersion 31
sourceSets {
main.manifest.srcFile('src/androidMain/AndroidManifest.xml')
getByName("androidTest").java.srcDir(file("src/androidAndroidTest/kotlin"))
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 25
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArguments disableAnalytics: 'true'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
abortOnError true
htmlReport true
xmlReport false
textReport true
lintConfig file("lint.xml")
}
}
signing {
useGpgCmd()
}
apply from: "${rootProject.rootDir}/gradle/ktlint.gradle"