chaosflix/touch/build.gradle
2020-04-08 21:16:47 +02:00

177 lines
5.7 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-android-extensions'
id 'com.github.triplet.play' version '2.6.2'
}
String appName = "Chaosflix"
String versionString = new File("versionfile").text.trim()
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "de.nicidienase.chaosflix"
minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK
manifestPlaceholders = [label: appName]
// odd for touch, even for leanback
versionCode 1
versionName versionString
if(project.hasProperty("versionCode")){
versionCode = project.property("versionCode") as int
println "Setting VersionCode from property: $versionCode"
}
if(project.hasProperty("versionName")){
versionName = project.property("versionName") as String
println "Setting versionName from property: $versionName"
}
}
signingConfigs {
//noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
release {
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
println "Release app signing is configured: will sign APK"
storeFile file(chaosflixKeystore)
storePassword chaosflixStorePassword
keyAlias chaosflixKeyName
keyPassword chaosflixKeyPassword
} else {
println "App signing data not found. Will not sign."
}
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
manifestPlaceholders = [label: appName + "-debug"]
minifyEnabled false
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
signingConfig signingConfigs.release
}
}
}
flavorDimensions "stage", "libs"
productFlavors {
prod {
dimension "stage"
}
dev {
dimension "stage"
applicationIdSuffix ".dev"
manifestPlaceholders = [label: appName + "-Dev"]
}
mock {
dimension "stage"
applicationIdSuffix ".mock"
manifestPlaceholders = [label: appName + "-Mock"]
}
free {
dimension "libs"
}
noFree{
dimension "libs"
}
}
variantFilter { variant ->
def names = variant.flavors*.name
if (name.contains("prod") && name.contains("Debug")){
setIgnore(true)
}
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
lintOptions.abortOnError false
dataBinding.enabled = true
testOptions.unitTests.includeAndroidResources = true
playConfigs {
prodNoFreeRelease {
enabled = true
}
}
}
configurations {
mockDebugCompile
prodDebugCompile
prodReleaseCompile
}
dependencies {
implementation project(':common')
implementation('com.mikepenz:aboutlibraries:6.1.1@aar') {
transitive = true
}
implementation 'com.github.medyo:android-about-page:1.2.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0-beta02'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.mediarouter:mediarouter:1.1.0'
noFreeImplementation 'com.google.android.gms:play-services-cast-framework:17.1.0'
noFreeImplementation('pl.droidsonroids:casty:1.0.8') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0'
implementation 'net.opacapp:multiline-collapsingtoolbar:27.1.1'
implementation 'net.rdrei.android.dirchooser:library:3.2@aar'
implementation 'com.github.guardian:Option:-SNAPSHOT'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.11.0'
testImplementation 'org.robolectric:robolectric:4.1'
androidTestImplementation('androidx.test:rules:1.1.1') {
exclude module: 'support-annotations'
}
androidTestImplementation('androidx.test.ext:junit:1.1.1') {
exclude module: 'support-annotations'
}
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
}
}
play {
serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json")
track = "alpha"
releaseStatus = "draft"
enabled = false
artifactDir = file("build/outputs/apk/prodNoFree/release/touch-prod-noFree-release.apk")
}