Files
quik/presentation/build.gradle
T

225 lines
8.9 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'
android {
compileSdk 34
defaultConfig {
applicationId 'dev.octoshrimpy.quik'
minSdkVersion 23
targetSdkVersion 33
versionCode 2236
versionName '4.3.4'
setProperty("archivesBaseName", "QUIK-v${versionName}")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug // Uses the default debug keystore.
release {
def keystoreProps = new Properties()
def keystorePropsFile = rootProject.file('./.gradle/.gradlerc')
storeFile file('./my-release-key.keystore')
keyAlias 'quik_release'
if (keystorePropsFile.exists()) {
keystoreProps.load(new FileInputStream(keystorePropsFile))
} else {
// do nothing
}
storePassword keystoreProps['storePassword']
keyPassword keystoreProps['keyPassword']
}
}
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 {
buildConfig true
viewBinding true
}
if (System.getenv("CI") == "true") {
signingConfigs.release.storePassword = System.getenv("keystore_password")
signingConfigs.release.keyAlias = System.getenv("key_alias")
signingConfigs.release.keyPassword = System.getenv("key_password")
}
}
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-core:$mockito_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')
}
// Check to make sure that the keystore file is present when building a release
gradle.taskGraph.whenReady { taskGraph ->
if ((taskGraph.hasTask(':assembleRelease') ||
taskGraph.allTasks.any { it.name == 'assembleRelease' }) &&
!file('./.gradle/.gradlerc').exists() &&
System.getenv("CI") != "true") {
throw new GradleException("Keystore properties file not found")
}
}