2
0
Fork 0
mirror of https://github.com/NiciDieNase/chaosflix synced 2024-12-04 01:49:14 +00:00
chaosflix/leanback/build.gradle
2019-12-27 00:04:15 +01:00

129 lines
4.2 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
String appName = "Chaosflix"
String versionString = new File("versionfile").text.trim()
android {
buildToolsVersion '27.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "de.nicidienase.chaosflix"
manifestPlaceholders = [label: appName]
minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK
// odd for touch, even for leanback
versionCode rootProject.ext.leanbackVersionCode
versionName versionString
if(project.hasProperty("versionCode")){
versionCode = project.property("versionCode") as int
println "Setting VersionCode from property: $versionCode"
}
}
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
buildToolsVersion rootProject.ext.buildToolsVersion
}
configurations {
mockDebugCompile
prodDebugCompile
prodReleaseCompile
}
dependencies {
implementation project(':common')
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.leanback:leanback:1.0.0'
implementation 'androidx.leanback:leanback-preference:1.0.0'
implementation 'com.google.android.exoplayer:extension-leanback:2.9.6'
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 'com.squareup.okhttp3:mockwebserver:3.6.0'
}