/* * 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 (