antimine-android/app/build.gradle
2020-08-13 23:38:51 -03:00

173 lines
6.1 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 30
defaultConfig {
// versionCode and versionName must be hardcoded to support F-droid
versionCode 800041
versionName '8.0.4'
minSdkVersion 16
targetSdkVersion 30
multiDexEnabled true
vectorDrawables.useSupportLibrary true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArguments clearPackageData: 'true'
resConfigs 'af-rZA', 'ar-rSA', 'ca-rES', 'cs-rCZ', 'da-rDK', 'de-rDE', 'el-rGR', 'en-rUS',
'es-rES', 'fi-rFI', 'fr-rFR', 'hi-rIN', 'hu-rHU', 'it-rIT', 'iw-rIL', 'ja-rJP',
'ko-rKR', 'nl-rNL', 'no-rNO', 'pl-rPL', 'pt-rBR', 'pt-rPT', 'ro-rRO', 'ru-rRU',
'sv-rSE', 'th-rTH', 'tr-rTR', 'uk-rUA', 'vi-rVN', 'zh-rCN'
}
signingConfigs {
release {
if (System.getenv('IS_RELEASE_BUILD')) {
storeFile file(System.getenv('KEYSTORE'))
keyAlias System.getenv('KEY_ALIAS')
storePassword System.getenv('KEY_STORE_PASSWORD')
keyPassword System.getenv('KEY_PASSWORD')
}
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi',
'-Xuse-experimental=kotlinx.coroutines.FlowPreview']
}
testOptions {
unitTests {
includeAndroidResources true
animationsDisabled true
}
}
flavorDimensions 'version'
productFlavors {
google {
dimension 'version'
applicationId 'dev.lucasnlm.antimine'
}
foss {
dimension 'version'
// There's a typo on F-Droid release :(
applicationId 'dev.lucanlm.antimine'
}
}
}
kapt {
correctErrorTypes true
}
hilt {
enableTransformForLocalTests true
}
dependencies {
// Dependencies must be hardcoded to support F-droid
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':common')
googleImplementation project(':proprietary')
fossImplementation project(':foss')
// AndroidX
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.activity:activity-ktx:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
// Lifecycle
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'
implementation 'androidx.room:room-ktx:2.2.5'
// Constraint
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// Google
implementation 'com.google.android.material:material:1.2.0'
// Dagger
implementation 'com.google.dagger:hilt-android:2.28.1-alpha'
kapt 'com.google.dagger:hilt-android-compiler:2.28.1-alpha'
testImplementation 'com.google.dagger:hilt-android-testing:2.28.1-alpha'
kaptTest 'com.google.dagger:hilt-android-compiler:2.28.1-alpha'
androidTestImplementation 'com.google.dagger:hilt-android-testing:2.28.1-alpha'
kaptAndroidTest 'com.google.dagger:hilt-android-compiler:2.28.1-alpha'
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha02'
kapt 'androidx.hilt:hilt-compiler:1.0.0-alpha02'
// Kotlin
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.8'
// Tests
testImplementation 'junit:junit:4.13'
testImplementation 'android.arch.core:core-testing:1.1.1'
testImplementation 'androidx.core:core:1.1.0'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test:core-ktx:1.2.0'
testImplementation 'androidx.test:rules:1.2.0'
testImplementation 'androidx.test:runner:1.2.0'
testImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
testImplementation 'androidx.fragment:fragment-testing:1.2.5'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'io.mockk:mockk:1.10.0'
// Core library
androidTestImplementation 'androidx.test:core:1.2.0'
// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.core:core:1.1.0'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test:core-ktx:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestUtil 'androidx.test:orchestrator:1.2.0'
}
tasks.withType(Test) {
testLogging {
exceptionFormat 'full'
}
afterTest { desc, result ->
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}