chaosflix/common/build.gradle

177 lines
5.5 KiB
Groovy
Raw Normal View History

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