Files
fdroidclient/libs/database/build.gradle
Torsten Grote e61886c6b6 Upgrade the libraries we can still upgrade
without going to gradle 8, Java 17 and compileSdk 34
2023-10-20 09:26:17 -03:00

122 lines
3.9 KiB
Groovy

plugins {
id 'kotlin-android'
id 'com.android.library'
id 'kotlin-kapt'
id 'org.jetbrains.dokka'
id "org.jlleitschuh.gradle.ktlint" version "10.2.1"
id 'com.vanniktech.maven.publish'
}
android {
compileSdkVersion 33
defaultConfig {
minSdkVersion 21
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments disableAnalytics: 'true'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
androidTest {
java.srcDirs += "src/dbTest/java"
}
test {
java.srcDirs += "src/dbTest/java"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += "-Xexplicit-api=strict"
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}
aaptOptions {
// needed only for instrumentation tests: assets.openFd()
noCompress "json"
}
packagingOptions {
exclude 'META-INF/AL2.0'
exclude 'META-INF/LGPL2.1'
}
}
dependencies {
implementation project(":libs:download")
implementation project(":libs:index")
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
implementation "androidx.room:room-runtime:2.5.2"
implementation "androidx.room:room-ktx:2.5.2"
kapt "androidx.room:room-compiler:2.5.2"
implementation 'io.github.microutils:kotlin-logging:2.1.21'
implementation "org.slf4j:slf4j-android:1.7.36"
// 1.4.1 because https://github.com/Kotlin/kotlinx.serialization/issues/2231
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
testImplementation project(":libs:sharedTest")
testImplementation 'junit:junit:4.13.2'
testImplementation 'io.mockk:mockk:1.13.5'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation 'androidx.arch.core:core-testing:2.2.0'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'commons-io:commons-io:2.6'
testImplementation 'ch.qos.logback:logback-classic:1.4.5'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
testImplementation 'app.cash.turbine:turbine:1.0.0'
androidTestImplementation project(":libs:sharedTest")
androidTestImplementation 'io.mockk:mockk-android:1.12.3' // 1.12.4 has strange error
androidTestImplementation 'org.jetbrains.kotlin:kotlin-test'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.arch.core:core-testing:2.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'commons-io:commons-io:2.6'
}
plugins.withId("kotlin-kapt") {
kapt.useBuildCache = 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"