277 lines
10 KiB
Groovy
277 lines
10 KiB
Groovy
/*
|
|
* Copyright (c) Techbee e.U.
|
|
* All rights reserved. This program and the accompanying materials
|
|
* are made available under the terms of the GNU Public License v3.0
|
|
* which accompanies this distribution, and is available at
|
|
* http://www.gnu.org/licenses/gpl.html
|
|
*/
|
|
|
|
plugins {
|
|
id "com.android.application"
|
|
id "com.mikepenz.aboutlibraries.plugin"
|
|
id "kotlin-android"
|
|
id "kotlin-parcelize"
|
|
id "kotlinx-serialization"
|
|
id "com.google.devtools.ksp"
|
|
//id "com.huawei.agconnect"
|
|
}
|
|
|
|
|
|
def localPropertiesFile = rootProject.file('local.properties')
|
|
def localProperties = new Properties()
|
|
if(localPropertiesFile.exists()) {
|
|
localProperties.load(new FileInputStream(localPropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace "at.techbee.jtx"
|
|
compileSdk 34
|
|
defaultConfig {
|
|
applicationId "at.techbee.jtx"
|
|
buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"
|
|
minSdkVersion 21
|
|
targetSdkVersion 34
|
|
versionCode 207020030
|
|
versionName "2.07.02-beta30" // keep -release as a suffix also for release, build flavor adds the suffix e.g. .gplay (e.g. 1.00.00-rc0.gplay)
|
|
buildConfigField "String", "versionCodename", "\"Love always wins ❤️💪\""
|
|
multiDexEnabled true
|
|
vectorDrawables.useSupportLibrary = true
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
testOptions {
|
|
unitTests.includeAndroidResources = true
|
|
unitTests.returnDefaultValues = true
|
|
}
|
|
|
|
ksp {
|
|
arg("room.generateKotlin", "true")
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
}
|
|
|
|
//don't forget to update locales_config.xml when changing the languages!
|
|
def locales = ["en", "de", "cs", "el", "es", "fr", "it", "nl", "ru", "zh", "ca", "ja", "zh-rTW", "hu", "vi"]
|
|
buildConfigField "String[]", "TRANSLATION_ARRAY", "new String[]{\""+locales.join("\",\"")+"\"}"
|
|
resourceConfigurations += locales
|
|
|
|
buildConfigField "String", "CROWDIN_API_KEY", "\"" + (System.getenv("CROWDIN_API_KEY") ?: localProperties["crowdin.apikey"] ) + "\""
|
|
buildConfigField "String", "GITHUB_CONTRIBUTORS_API_KEY", "\"" + (System.getenv("GH_CONTRIBUTORS_API_KEY") ?: localProperties["githubcontributors.apikey"] ) + "\""
|
|
resValue "string", "google_geo_api_key", System.getenv("GOOGLE_GEO_API_KEY") ?: localProperties["google.geo.apikey"] ?: ""
|
|
}
|
|
|
|
signingConfigs {
|
|
jtx {
|
|
storeFile file(System.getenv("ANDROID_KEYSTORE") ?: localProperties["keystore.file"] ?: file("/dev/null"))
|
|
storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD") ?: localProperties["keystore.password"]
|
|
keyAlias System.getenv("ANDROID_KEY_ALIAS") ?: localProperties["keystore.key.alias"]
|
|
keyPassword System.getenv("ANDROID_KEY_PASSWORD") ?: localProperties["keystore.key.password"]
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled = true
|
|
shrinkResources = false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
signingConfig signingConfigs.jtx
|
|
}
|
|
|
|
benchmark {
|
|
signingConfig signingConfigs.debug
|
|
matchingFallbacks = ['release']
|
|
debuggable false
|
|
}
|
|
|
|
// uncomment to test minifyEnabled without signing the package
|
|
debug {
|
|
//minifyEnabled = true
|
|
//shrinkResources = true
|
|
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
// Enables data binding.
|
|
buildFeatures {
|
|
buildConfig = true
|
|
compose true
|
|
}
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion "1.5.8"
|
|
}
|
|
|
|
packagingOptions {
|
|
resources {
|
|
excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/*.md']
|
|
pickFirsts += ['META-INF/AL2.0', 'META-INF/LGPL2.1']
|
|
}
|
|
}
|
|
|
|
flavorDimensions = ['version']
|
|
productFlavors {
|
|
gplay {
|
|
dimension 'version'
|
|
versionNameSuffix '.gplay'
|
|
}
|
|
amazon {
|
|
dimension 'version'
|
|
versionNameSuffix '.amazon'
|
|
}
|
|
ose {
|
|
dimension 'version'
|
|
versionNameSuffix '.ose'
|
|
}
|
|
generic {
|
|
dimension 'version'
|
|
versionNameSuffix '.generic'
|
|
}
|
|
huawei {
|
|
dimension 'version'
|
|
versionNameSuffix '.huawei'
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
// Flag to enable support for the new language APIs, this is especially necessary to use java.time for versions < O
|
|
// https://developer.android.com/studio/write/java8-support#library-desugaring
|
|
coreLibraryDesugaringEnabled = true
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
lint {
|
|
disable 'MissingTranslation', 'ExtraTranslation'
|
|
}
|
|
}
|
|
|
|
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 "com.github.bitfireAT:ical4android:6f2601f"
|
|
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
// Android KTX
|
|
implementation "androidx.core:core-ktx:$version_core"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
|
|
|
|
// Android Annotations
|
|
implementation "androidx.annotation:annotation:1.7.1"
|
|
|
|
// Room dependencies
|
|
implementation "androidx.room:room-runtime:$version_room"
|
|
implementation "androidx.room:room-ktx:$version_room" // Kotlin Extensions and Coroutines support for Room
|
|
ksp "androidx.room:room-compiler:$version_room"
|
|
|
|
// Coroutines
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version_coroutine"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version_coroutine"
|
|
|
|
implementation "androidx.preference:preference-ktx:1.2.1"
|
|
|
|
// Volley for simple network requests
|
|
implementation "com.android.volley:volley:1.2.1"
|
|
|
|
// Google billing
|
|
gplayImplementation "com.android.billingclient:billing-ktx:$version_billing"
|
|
// Google request for review
|
|
gplayImplementation "com.google.android.play:review:$version_review"
|
|
gplayImplementation "com.google.android.play:review-ktx:$version_review"
|
|
|
|
// Amazon billing & maps support
|
|
amazonImplementation 'com.amazon.device:amazon-appstore-sdk:3.0.4'
|
|
amazonImplementation "com.google.maps.android:maps-compose:4.3.3"
|
|
amazonImplementation "com.google.android.gms:play-services-maps:18.2.0"
|
|
amazonImplementation "com.google.android.gms:play-services-location:21.2.0"
|
|
|
|
// Huawei billing
|
|
//huaweiImplementation "com.huawei.hms:iap:$version_huawei_iap"
|
|
|
|
// Google Maps
|
|
gplayImplementation "com.google.maps.android:maps-compose:4.3.3"
|
|
gplayImplementation "com.google.android.gms:play-services-maps:18.2.0"
|
|
gplayImplementation "com.google.android.gms:play-services-location:21.2.0"
|
|
|
|
//OSM
|
|
oseImplementation "org.osmdroid:osmdroid-android:$version_osmdroid"
|
|
genericImplementation "org.osmdroid:osmdroid-android:$version_osmdroid"
|
|
huaweiImplementation "org.osmdroid:osmdroid-android:$version_osmdroid"
|
|
|
|
// Workmanager support
|
|
implementation "androidx.work:work-runtime-ktx:$version_work"
|
|
androidTestImplementation "androidx.work:work-testing:$version_work"
|
|
|
|
//support for java.time for older Android versions (<O)
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
|
|
|
|
androidTestImplementation "androidx.test:core-ktx:1.5.0"
|
|
androidTestImplementation "androidx.test.ext:junit-ktx:1.1.5"
|
|
//androidTestImplementation "androidx.test.espresso:espresso-core:3.5.0-alpha07"
|
|
androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
|
|
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version_coroutine"
|
|
androidTestImplementation "androidx.test:runner:1.5.2"
|
|
androidTestImplementation "androidx.test:rules:1.5.0"
|
|
|
|
// Testing
|
|
testImplementation "junit:junit:4.13.2"
|
|
testImplementation "androidx.room:room-testing:$version_room"
|
|
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
|
testImplementation "androidx.test:core-ktx:1.5.0"
|
|
// Required -- JUnit 4 framework
|
|
testImplementation "androidx.test.ext:junit-ktx:1.1.5"
|
|
//testImplementation "org.mockito:mockito-core:5.3.1"
|
|
|
|
//About Libraries
|
|
implementation "com.mikepenz:aboutlibraries-core:${version_about_libraries}"
|
|
implementation "com.mikepenz:aboutlibraries-compose:${version_about_libraries}"
|
|
|
|
// Compose Color Picker
|
|
implementation "com.godaddy.android.colorpicker:compose-color-picker-android:0.7.0"
|
|
|
|
// appcompat for language selection
|
|
implementation "androidx.appcompat:appcompat:$version_appcompat"
|
|
|
|
// jetpack compose
|
|
implementation "androidx.compose.ui:ui:$version_compose"
|
|
implementation "androidx.compose.material3:material3:1.2.1"
|
|
implementation "androidx.compose.material:material-icons-extended:1.6.3"
|
|
implementation "androidx.compose.material:material:1.6.3"
|
|
implementation "androidx.compose.ui:ui-tooling-preview:$version_compose"
|
|
implementation "androidx.compose.ui:ui-text-google-fonts:$version_compose"
|
|
//implementation "androidx.activity:activity-compose:1.6.0"
|
|
implementation "androidx.compose.runtime:runtime-livedata:$version_compose"
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0"
|
|
implementation "androidx.navigation:navigation-compose:2.7.7"
|
|
implementation "com.arnyminerz.markdowntext:markdowntext:1.3.2"
|
|
|
|
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$version_compose"
|
|
debugImplementation "androidx.compose.ui:ui-tooling:$version_compose"
|
|
debugImplementation "androidx.compose.ui:ui-test-manifest:$version_compose"
|
|
|
|
// permissions from accompanist
|
|
implementation "com.google.accompanist:accompanist-permissions:$version_accompanist"
|
|
|
|
implementation "androidx.glance:glance-appwidget:1.0.0"
|
|
|
|
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
|
|
|
implementation "androidx.profileinstaller:profileinstaller:1.3.1"
|
|
|
|
//image loading from the web
|
|
implementation "io.coil-kt:coil-compose:2.6.0"
|
|
|
|
implementation "com.kizitonwose.calendar:compose:2.5.0"
|
|
|
|
implementation "com.googlecode.libphonenumber:libphonenumber:8.13.33"
|
|
|
|
implementation "sh.calvin.reorderable:reorderable:1.3.2"
|
|
}
|