mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-05 04:32:12 -05:00
130 lines
4.0 KiB
Groovy
130 lines
4.0 KiB
Groovy
plugins {
|
|
id 'kotlin-android'
|
|
id 'com.android.library'
|
|
id 'kotlin-kapt'
|
|
id 'org.jetbrains.dokka'
|
|
id 'com.vanniktech.maven.publish'
|
|
}
|
|
|
|
android {
|
|
namespace "org.fdroid.database"
|
|
compileSdk libs.versions.compileSdk.get().toInteger()
|
|
|
|
defaultConfig {
|
|
minSdkVersion 21
|
|
targetSdk 34 // relevant for instrumentation tests (targetSdk 21 fails on Android 14)
|
|
|
|
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"
|
|
// Adds exported schema location as test app assets.
|
|
assets.srcDirs += files("$projectDir/schemas".toString())
|
|
}
|
|
test {
|
|
java.srcDirs += "src/dbTest/java"
|
|
// Adds exported schema location as test app assets.
|
|
assets.srcDirs += files("$projectDir/schemas".toString())
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
testOptions {
|
|
unitTests {
|
|
includeAndroidResources = true
|
|
}
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = '17'
|
|
freeCompilerArgs += "-Xexplicit-api=strict"
|
|
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
|
}
|
|
kapt {
|
|
correctErrorTypes true
|
|
}
|
|
aaptOptions {
|
|
// needed only for instrumentation tests: assets.openFd()
|
|
noCompress "json"
|
|
}
|
|
packagingOptions {
|
|
exclude 'META-INF/AL2.0'
|
|
exclude 'META-INF/LGPL2.1'
|
|
exclude 'META-INF/LICENSE.md'
|
|
exclude 'META-INF/LICENSE-notice.md'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(":libs:download")
|
|
implementation project(":libs:index")
|
|
|
|
implementation libs.androidx.core.ktx
|
|
implementation libs.androidx.lifecycle.livedata.ktx
|
|
|
|
implementation libs.androidx.room.runtime
|
|
implementation libs.androidx.room.ktx
|
|
kapt libs.androidx.room.compiler
|
|
|
|
implementation libs.microutils.kotlin.logging
|
|
implementation libs.kotlinx.serialization.json
|
|
|
|
testImplementation project(":libs:sharedTest")
|
|
testImplementation libs.junit
|
|
testImplementation libs.mockk
|
|
testImplementation libs.kotlin.test
|
|
testImplementation libs.androidx.test.core.ktx
|
|
testImplementation libs.androidx.test.ext.junit
|
|
testImplementation libs.androidx.core.testing
|
|
testImplementation libs.androidx.room.testing
|
|
testImplementation libs.robolectric
|
|
testImplementation libs.commons.io
|
|
testImplementation libs.logback.classic
|
|
testImplementation libs.kotlinx.coroutines.test
|
|
testImplementation libs.turbine
|
|
testImplementation libs.okhttp
|
|
|
|
androidTestImplementation project(":libs:sharedTest")
|
|
androidTestImplementation libs.mockk.android
|
|
androidTestImplementation libs.kotlin.test
|
|
androidTestImplementation libs.androidx.test.ext.junit
|
|
androidTestImplementation libs.androidx.core.testing
|
|
androidTestImplementation libs.androidx.espresso.core
|
|
androidTestImplementation libs.androidx.room.testing
|
|
androidTestImplementation libs.commons.io
|
|
}
|
|
|
|
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"
|
|
}"""]
|
|
)
|
|
}
|