chaosflix/common/build.gradle

174 lines
No EOL
5.4 KiB
Groovy

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "de.mannodermaus.android-junit5"
String versionString = new File("versionfile").text.trim()
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK
versionCode 1
versionName versionString
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://streaming.media.ccc.de\""
buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/streams/v2.json\""
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
buildTypes {
debug {
minifyEnabled false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
flavorDimensions "stage", "libs"
productFlavors {
prod {
dimension "stage"
}
dev {
dimension "stage"
}
mock {
dimension "stage"
buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://gist.githubusercontent.com\""
buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/NiciDieNase/1ca017f180242f0ee683a1f592efc4ed/raw/0104592b57f4b29863fd0684a510462af276f30e/example_streams_v2.json\""
}
free {
dimension "libs"
ext {
prod = null
dev = null
mock = null
}
}
noFree{
dimension "libs"
ext {
if(project.hasProperty("appcenterId")){
prod = appcenterId
} else {
prod = null
println "AppcenterId not set"
}
if(project.hasProperty("appcenterDevId")){
dev = appcenterDevId
mock = appcenterDevId
} else {
dev = null
mock = null
println "AppcenterId not set"
}
}
}
}
libraryVariants.all { variant ->
def flavors = variant.productFlavors
// flavorDimensions "stage" -> 0, "libs" -> 1
def stage = flavors[0]
def libs = flavors[1]
variant.buildConfigField "String", "APPCENTER_ID", "${libs[stage.name]}"
}
variantFilter { variant ->
if (name.contains("prod") && name.contains("Debug")){
setIgnore(true)
}
}
lintOptions.abortOnError = false
dataBinding.enabled = true
testOptions.unitTests.includeAndroidResources = true
}
dependencies {
api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'
api 'androidx.appcompat:appcompat:1.1.0'
def lifecycle_version = "2.1.0"
api "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
api "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
api 'androidx.recyclerview:recyclerview:1.1.0'
def roomVersion = "2.2.3"
api "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"
api "androidx.room:room-ktx:$roomVersion"
implementation 'com.squareup.retrofit2:retrofit:2.6.3'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
api "com.google.code.gson:gson:2.8.6"
api 'com.google.android.exoplayer:exoplayer:2.9.6'
api 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0'
api 'commons-io:commons-io:2.4'
def appCenterSdkVersion = '2.2.0'
noFreeImplementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
noFreeImplementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
noFreeImplementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
debugImplementation 'com.facebook.stetho:stetho:1.5.0'
debugImplementation 'com.facebook.stetho:stetho-okhttp3:1.4.2'
debugImplementation 'com.facebook.stetho:stetho-okhttp:1.4.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
testImplementation "io.mockk:mockk:1.9"
testImplementation 'org.robolectric:robolectric:4.1'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation "org.junit.jupiter:junit-jupiter-api:5.5.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.5.2"
testImplementation "junit:junit:4.12"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.2"
}