mirror of
https://github.com/bitfireAT/davx5-ose
synced 2024-09-06 18:01:11 +00:00
220 lines
8.7 KiB
Groovy
220 lines
8.7 KiB
Groovy
/***************************************************************************************************
|
|
* Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
|
|
**************************************************************************************************/
|
|
|
|
plugins {
|
|
id 'com.android.application'
|
|
id 'com.google.devtools.ksp'
|
|
id 'com.mikepenz.aboutlibraries.plugin'
|
|
id 'dagger.hilt.android.plugin'
|
|
id 'kotlin-android'
|
|
id 'kotlin-kapt' // remove as soon as Hilt supports KSP [https://issuetracker.google.com/179057202]
|
|
}
|
|
|
|
aboutLibraries {
|
|
// This means that we have to generate the dependencies explicitly:
|
|
// ./gradlew --no-configuration-cache --no-build-cache -PaboutLibraries.exportPath=src/main/res/raw/ app:exportLibraryDefinitions
|
|
registerAndroidTasks = false
|
|
}
|
|
|
|
// Android configuration
|
|
android {
|
|
compileSdk 34
|
|
|
|
defaultConfig {
|
|
applicationId "at.bitfire.davdroid"
|
|
|
|
versionCode 403120101
|
|
versionName '4.3.12.1'
|
|
|
|
buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"
|
|
|
|
setProperty "archivesBaseName", "davx5-ose-" + getVersionName()
|
|
|
|
minSdkVersion 24 // Android 7.0
|
|
targetSdkVersion 33 // Android 13
|
|
|
|
buildConfigField "String", "userAgent", "\"DAVx5\""
|
|
|
|
testInstrumentationRunner "at.bitfire.davdroid.CustomTestRunner"
|
|
}
|
|
|
|
compileOptions {
|
|
// enable because ical4android requires desugaring
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
compose = true
|
|
viewBinding = true
|
|
dataBinding = true
|
|
}
|
|
composeOptions {
|
|
// Keep this in sync with Kotlin version:
|
|
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
|
|
kotlinCompilerExtensionVersion = "1.5.7"
|
|
}
|
|
|
|
// Java namespace for our classes (not to be confused with Android package ID)
|
|
namespace 'at.bitfire.davdroid'
|
|
|
|
flavorDimensions = [ "distribution" ]
|
|
productFlavors {
|
|
ose {
|
|
dimension "distribution"
|
|
versionNameSuffix "-ose"
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
androidTest {
|
|
assets.srcDirs += files("$projectDir/schemas".toString())
|
|
}
|
|
}
|
|
|
|
signingConfigs {
|
|
bitfire {
|
|
storeFile file(System.getenv("ANDROID_KEYSTORE") ?: "/dev/null")
|
|
storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD")
|
|
keyAlias System.getenv("ANDROID_KEY_ALIAS")
|
|
keyPassword System.getenv("ANDROID_KEY_PASSWORD")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
}
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules-release.pro'
|
|
|
|
shrinkResources true
|
|
|
|
signingConfig signingConfigs.bitfire
|
|
}
|
|
}
|
|
|
|
lint {
|
|
disable 'GoogleAppIndexingWarning', 'ImpliedQuantity', 'MissingQuantity', 'MissingTranslation', 'ExtraTranslation', 'RtlEnabled', 'RtlHardcoded', 'Typos', 'NullSafeMutableLiveData'
|
|
}
|
|
|
|
packagingOptions {
|
|
resources {
|
|
excludes += ['META-INF/*.md']
|
|
}
|
|
}
|
|
|
|
androidResources {
|
|
generateLocaleConfig true
|
|
}
|
|
}
|
|
|
|
ksp {
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
}
|
|
|
|
configurations {
|
|
configureEach {
|
|
// exclude modules which are in conflict with system libraries
|
|
exclude module: "commons-logging"
|
|
exclude group: "org.json", module: "json"
|
|
|
|
// Groovy requires SDK 26+, and it's not required, so exclude it
|
|
exclude group: 'org.codehaus.groovy'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
|
|
|
implementation "com.google.dagger:hilt-android:${versions.hilt}"
|
|
kapt "com.google.dagger:hilt-android-compiler:${versions.hilt}" // replace by KSP when ready [https://issuetracker.google.com/179057202]
|
|
|
|
// support libs
|
|
implementation 'androidx.activity:activity-compose:1.8.2'
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
implementation 'androidx.browser:browser:1.7.0'
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
implementation 'androidx.concurrent:concurrent-futures-ktx:1.1.0'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
implementation 'androidx.core:core-ktx:1.12.0'
|
|
implementation 'androidx.fragment:fragment-ktx:1.6.2'
|
|
implementation 'androidx.hilt:hilt-work:1.1.0'
|
|
kapt 'androidx.hilt:hilt-compiler:1.1.0'
|
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2'
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
|
|
implementation 'androidx.paging:paging-runtime-ktx:3.2.1'
|
|
implementation 'androidx.preference:preference-ktx:1.2.1'
|
|
implementation 'androidx.security:security-crypto:1.1.0-alpha06'
|
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
implementation "androidx.work:work-runtime-ktx:${versions.workManager}"
|
|
implementation 'com.google.android.flexbox:flexbox:3.0.0'
|
|
implementation 'com.google.android.material:material:1.11.0'
|
|
|
|
// Jetpack Compose
|
|
implementation platform("androidx.compose:compose-bom:${versions.composeBom}")
|
|
implementation 'androidx.compose.material:material'
|
|
implementation 'androidx.compose.material:material-icons-extended'
|
|
implementation 'androidx.compose.runtime:runtime-livedata'
|
|
debugImplementation 'androidx.compose.ui:ui-tooling'
|
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
|
implementation "com.google.accompanist:accompanist-permissions:${versions.accompanist}"
|
|
implementation "com.google.accompanist:accompanist-themeadapter-material:${versions.accompanist}"
|
|
|
|
// Jetpack Room
|
|
implementation "androidx.room:room-runtime:${versions.room}"
|
|
implementation "androidx.room:room-ktx:${versions.room}"
|
|
implementation "androidx.room:room-paging:${versions.room}"
|
|
ksp "androidx.room:room-compiler:${versions.room}"
|
|
androidTestImplementation "androidx.room:room-testing:${versions.room}"
|
|
|
|
// own libraries
|
|
implementation "com.github.bitfireAT:cert4android:${versions.cert4android}"
|
|
implementation "com.github.bitfireAT:ical4android:${versions.ical4android}"
|
|
implementation "com.github.bitfireAT:vcard4android:${versions.vcard4android}"
|
|
|
|
// third-party libs
|
|
implementation 'com.jaredrummler:colorpicker:1.1.0'
|
|
implementation "com.github.AppIntro:AppIntro:${versions.appIntro}"
|
|
implementation("com.github.bitfireAT:dav4jvm:${versions.dav4jvm}") {
|
|
exclude group: 'junit'
|
|
}
|
|
implementation "com.mikepenz:aboutlibraries-compose:${versions.aboutLibraries}"
|
|
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp}"
|
|
implementation "com.squareup.okhttp3:okhttp-brotli:${versions.okhttp}"
|
|
implementation "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}"
|
|
//noinspection GradleDependency - don't update until API level 26 (Android 8) is the minimum API [https://github.com/bitfireAT/davx5/issues/130]
|
|
implementation 'commons-io:commons-io:2.8.0'
|
|
//noinspection GradleDependency - dnsjava 3.x requires Android 8 [https://github.com/bitfireAT/davx5/issues/453]
|
|
implementation 'dnsjava:dnsjava:2.1.9'
|
|
implementation 'io.github.nsk90:kstatemachine-jvm:0.24.0'
|
|
implementation 'net.openid:appauth:0.11.1'
|
|
implementation "org.apache.commons:commons-collections4:${versions.commonsCollections}"
|
|
implementation "org.apache.commons:commons-lang3:${versions.commonsLang}"
|
|
implementation "org.apache.commons:commons-text:${versions.commonsText}"
|
|
|
|
// for tests
|
|
androidTestImplementation "com.google.dagger:hilt-android-testing:${versions.hilt}"
|
|
kaptAndroidTest "com.google.dagger:hilt-android-compiler:${versions.hilt}"
|
|
|
|
androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
|
|
androidTestImplementation 'androidx.test:core-ktx:1.5.0'
|
|
androidTestImplementation 'androidx.test:runner:1.5.2'
|
|
androidTestImplementation 'androidx.test:rules:1.5.0'
|
|
androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.5'
|
|
androidTestImplementation "androidx.work:work-testing:${versions.workManager}"
|
|
androidTestImplementation "com.squareup.okhttp3:mockwebserver:${versions.okhttp}"
|
|
androidTestImplementation 'io.mockk:mockk-android:1.13.8'
|
|
androidTestImplementation 'junit:junit:4.13.2'
|
|
|
|
testImplementation "com.squareup.okhttp3:mockwebserver:${versions.okhttp}"
|
|
testImplementation 'junit:junit:4.13.2'
|
|
}
|