chaosflix/common/build.gradle

174 lines
5.4 KiB
Groovy
Raw Normal View History

2017-09-18 19:56:00 +00:00
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
2017-10-26 22:21:39 +00:00
apply plugin: 'kotlin-kapt'
apply plugin: "de.mannodermaus.android-junit5"
2017-09-18 19:56:00 +00:00
2019-11-09 19:06:41 +00:00
String versionString = new File("versionfile").text.trim()
2017-09-18 19:56:00 +00:00
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
2017-09-18 19:56:00 +00:00
defaultConfig {
2018-01-08 23:15:20 +00:00
minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK
2017-09-18 19:56:00 +00:00
versionCode 1
2019-11-09 19:06:41 +00:00
versionName versionString
2017-09-18 19:56:00 +00:00
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
2019-11-19 21:45:53 +00:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2017-09-18 19:56:00 +00:00
buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://streaming.media.ccc.de\""
buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/streams/v2.json\""
2018-12-21 20:52:29 +00:00
}
2018-12-21 16:15:53 +00:00
2017-09-18 19:56:00 +00:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2019-05-01 11:04:17 +00:00
lintOptions {
abortOnError false
}
2017-09-18 19:56:00 +00:00
buildTypes {
2018-12-18 23:16:51 +00:00
debug {
2018-12-22 19:50:44 +00:00
minifyEnabled false
2018-12-18 23:16:51 +00:00
}
2018-12-21 16:15:53 +00:00
2017-09-18 19:56:00 +00:00
release {
2018-12-22 19:50:44 +00:00
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
2017-09-18 19:56:00 +00:00
}
2018-12-21 16:15:53 +00:00
}
flavorDimensions "stage", "libs"
2018-12-21 16:15:53 +00:00
productFlavors {
prod {
dimension "stage"
}
dev {
dimension "stage"
2018-12-21 16:15:53 +00:00
}
2018-12-18 23:16:51 +00:00
2018-12-21 16:15:53 +00:00
mock {
dimension "stage"
2018-12-22 19:50:44 +00:00
buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://gist.githubusercontent.com\""
2018-12-27 16:51:59 +00:00
buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/NiciDieNase/1ca017f180242f0ee683a1f592efc4ed/raw/0104592b57f4b29863fd0684a510462af276f30e/example_streams_v2.json\""
2018-12-18 23:16:51 +00:00
}
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"
}
}
}
2017-09-18 19:56:00 +00:00
}
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]}"
}
2018-12-23 18:23:05 +00:00
variantFilter { variant ->
2019-05-04 21:16:22 +00:00
if (name.contains("prod") && name.contains("Debug")){
2018-12-23 18:23:05 +00:00
setIgnore(true)
}
}
2019-12-26 23:04:15 +00:00
lintOptions.abortOnError = false
dataBinding.enabled = true
testOptions.unitTests.includeAndroidResources = true
2017-09-18 19:56:00 +00:00
}
dependencies {
2019-11-11 21:51:57 +00:00
api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2019-12-26 23:04:15 +00:00
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'
2019-11-11 21:51:57 +00:00
2019-11-19 21:45:53 +00:00
api 'androidx.appcompat:appcompat:1.1.0'
2017-09-18 20:27:10 +00:00
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"
2019-11-19 21:45:53 +00:00
2019-12-26 23:04:15 +00:00
api 'androidx.recyclerview:recyclerview:1.1.0'
def roomVersion = "2.2.3"
2019-11-19 21:45:53 +00:00
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'
2019-11-11 21:51:57 +00:00
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
2017-10-31 19:49:53 +00:00
api "com.google.code.gson:gson:2.8.6"
2019-04-25 17:51:24 +00:00
api 'com.google.android.exoplayer:exoplayer:2.9.6'
2019-11-11 21:51:57 +00:00
api 'com.github.bumptech.glide:glide:4.9.0'
2019-06-06 22:29:56 +00:00
2018-12-10 00:27:02 +00:00
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0'
2018-12-10 00:27:02 +00:00
api 'commons-io:commons-io:2.4'
2019-11-11 21:51:57 +00:00
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}"
2019-11-11 21:51:57 +00:00
debugImplementation 'com.facebook.stetho:stetho:1.5.0'
2018-12-10 00:27:02 +00:00
debugImplementation 'com.facebook.stetho:stetho-okhttp3:1.4.2'
debugImplementation 'com.facebook.stetho:stetho-okhttp:1.4.2'
2019-12-26 11:46:04 +00:00
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
testImplementation "io.mockk:mockk:1.9"
testImplementation 'org.robolectric:robolectric:4.1'
2019-11-19 21:45:53 +00:00
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
2017-09-18 19:56:00 +00:00
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"
2018-12-10 22:03:23 +00:00
}