Files
karol d1daee9cbc
Build and Release APK / Build APK (push) Successful in 10m27s
Pin CI to Java 17 and report full test failures
2026-10-21 23:04:17 +02:00

245 lines
9.8 KiB
Groovy

/*
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
*
* This file is part of QKSMS.
*
* QKSMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* QKSMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
*/
apply plugin: 'com.android.application'
apply plugin: 'realm-android' // Realm needs to be before Kotlin or the build will fail
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
// One explicit signing configuration for release builds; never fall back to debug.
def releaseKeyProperties = new Properties()
def releaseKeyPropertiesFile = rootProject.file('.gradle/.gradlerc')
if (releaseKeyPropertiesFile.exists()) {
releaseKeyPropertiesFile.withInputStream { releaseKeyProperties.load(it) }
}
def releaseKeyPath = System.getenv('ANDROID_KEYSTORE_PATH')
def releaseKeyFile = releaseKeyPath ? rootProject.file(releaseKeyPath) : file('my-release-key.keystore')
def releaseStorePassword = System.getenv('ANDROID_KEYSTORE_PASSWORD') ?: System.getenv('keystore_password') ?: releaseKeyProperties['storePassword']
def releaseKeyAlias = System.getenv('ANDROID_KEY_ALIAS') ?: System.getenv('key_alias') ?: releaseKeyProperties['keyAlias'] ?: 'quik_release'
def releaseKeyPassword = System.getenv('ANDROID_KEY_PASSWORD') ?: System.getenv('key_password') ?: releaseKeyProperties['keyPassword']
android {
compileSdk 34
testOptions {
unitTests.all {
testLogging {
events 'failed', 'skipped'
exceptionFormat 'full'
showCauses true
showStackTraces true
}
}
}
defaultConfig {
applicationId 'uk.labus.quik.remotrix'
minSdkVersion 24
targetSdkVersion 33
versionCode 2239
versionName '4.3.7'
setProperty("archivesBaseName", "QUIK-v${versionName}")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug // Uses the default debug keystore.
release {
storeFile releaseKeyFile
storePassword releaseStorePassword
keyAlias releaseKeyAlias
keyPassword releaseKeyPassword
}
}
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
resValue("string", "app_name", "QUIK-Debug")
resValue("string", "application_id", defaultConfig.applicationId)
signingConfig signingConfigs.debug
}
fdroid {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
matchingFallbacks = ['release']
applicationIdSuffix ".fdroid"
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
kotlinOptions {
jvmTarget = "1.8"
}
lint {
abortOnError false
}
namespace 'dev.octoshrimpy.quik'
buildFeatures {
dataBinding true
viewBinding true
buildConfig true
}
packagingOptions {
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/DEPENDENCIES'
}
}
configurations {
debug
release
fdroid
}
dependencies {
// lifecycle
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
// androidx
implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
implementation "androidx.emoji2:emoji2-bundled:$androidx_emoji2_version"
implementation "androidx.constraintlayout:constraintlayout:$androidx_constraintlayout_version"
implementation "androidx.core:core-ktx:$androidx_core_version"
implementation "androidx.viewpager2:viewpager2:$androidx_viewpager_version"
implementation "com.google.android.material:material:$material_version"
implementation("androidx.work:work-runtime-ktx:$androidx_work_version")
// conductor
implementation "com.bluelinelabs:conductor:$conductor_version"
implementation "com.bluelinelabs:conductor-archlifecycle:$conductor_version"
// glide
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
// exoplayer
implementation "com.github.google.ExoPlayer:exoplayer-core:$exoplayer_version"
implementation("com.github.google.ExoPlayer:exoplayer-ui:$exoplayer_version", {
exclude group: "com.android.support", module: "support-media-compat"
})
// rxbinding
implementation "com.jakewharton.rxbinding2:rxbinding-kotlin:$rxbinding_version"
implementation "com.jakewharton.rxbinding2:rxbinding-support-v4-kotlin:$rxbinding_version"
// autodispose
implementation "com.uber.autodispose:autodispose-android-archcomponents:$autodispose_version"
implementation "com.uber.autodispose:autodispose-android-archcomponents-test:$autodispose_version"
implementation "com.uber.autodispose:autodispose-android:$autodispose_version"
implementation "com.uber.autodispose:autodispose:$autodispose_version"
implementation "com.uber.autodispose:autodispose-lifecycle:$autodispose_version"
// dagger
implementation "com.google.dagger:dagger:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
//Resolve jdk8+ Generation Annotations - javax annotation does not exist
implementation 'com.github.pengrad:jdk9-deps:1ffe84c468'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
// ezvcard
implementation('com.googlecode.ez-vcard:ez-vcard:0.10.4', {
exclude group: "org.jsoup", module: "jsoup"
exclude group: "org.freemarker", module: "freemarker"
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
})
// realm
implementation "com.github.realm:realm-android-adapters:$realm_adapters_version"
kapt "io.realm:realm-annotations:$realm_version"
kapt "io.realm:realm-annotations-processor:$realm_version"
// rxjava
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version"
implementation "io.reactivex.rxjava2:rxjava:$rxjava_version"
implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
implementation "com.uber.rxdogtag:rxdogtag:$rxdogtag_version"
implementation "com.uber.rxdogtag:rxdogtag-autodispose:$rxdogtag_version"
// testing
androidTestImplementation("androidx.test.espresso:espresso-core:$espresso_version", {
exclude group: "com.android.support", module: "support-annotations"
})
androidTestImplementation "org.mockito:mockito-android:$mockito_version"
testImplementation "androidx.test:runner:$androidx_testrunner_version"
testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-inline:4.11.0"
testImplementation "org.robolectric:robolectric:4.11.1"
testImplementation "androidx.work:work-testing:$androidx_work_version"
// moshi
implementation "com.squareup.moshi:moshi:$moshi_version"
debugImplementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
// coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$coroutines_version"
implementation "com.github.chrisbanes:photoview:2.1.4"
implementation "com.f2prateek.rx.preferences2:rx-preferences:$rx_preferences_version"
implementation "com.github.google:flexbox-layout:0.3.1"
implementation "com.jakewharton.timber:timber:$timber_version"
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
implementation "me.leolin:ShortcutBadger:1.1.22"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation project(":android-smsmms")
implementation project(":common")
implementation project(':data')
implementation project(':domain')
implementation project(':remotrix-sync')
}
// Validate only signed variants so local debug builds and PR checks need no secrets.
gradle.taskGraph.whenReady { taskGraph ->
def signedBuild = taskGraph.allTasks.any {
it.project == project && (it.name == 'preReleaseBuild' || it.name == 'preFdroidBuild')
}
if (signedBuild && (!releaseKeyFile.isFile() || !releaseStorePassword || !releaseKeyAlias || !releaseKeyPassword)) {
throw new GradleException('Release signing is not configured. Supply the persistent release keystore and passwords; debug signing is forbidden for release builds. See README.md.')
}
}