Advertisement
Guest User

app/build.gradle.kts

a guest
Feb 18th, 2019
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 5.57 KB | None | 0 0
  1. import de.mannodermaus.gradle.plugins.junit5.junitPlatform
  2. import org.jetbrains.kotlin.config.KotlinCompilerVersion
  3. import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
  4. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  5.  
  6. plugins {
  7.     id("com.android.application")
  8.     id("de.mannodermaus.android-junit5")
  9.     id("com.google.gms.google-services")
  10.     kotlin("android.extensions")
  11.     kotlin("android")
  12.     kotlin("kapt")
  13. }
  14.  
  15. val buildRelease = "release"
  16. val buildDebug = "debug"
  17. android {
  18.     compileSdkVersion(28)
  19.     defaultConfig {
  20.         applicationId = "com.company.app"
  21.         minSdkVersion(23)
  22.         targetSdkVersion(28)
  23.         versionCode = 158
  24.         versionName = "5.1.4"
  25.         multiDexEnabled = true
  26.  
  27.         testInstrumentationRunner = "androidx.test.runner.AndroidJunitRunner"
  28.     }
  29.  
  30.     buildTypes {
  31.  
  32.         getByName(buildRelease) {
  33.             isMinifyEnabled = true
  34.             proguardFiles(
  35.                     getDefaultProguardFile("proguard-android.txt"),
  36.                     "proguard-rules.pro")
  37.             signingConfig = signingConfigs.getByName(buildRelease)
  38.         }
  39.  
  40.         getByName(buildDebug) {
  41.             isMinifyEnabled = false
  42.             isTestCoverageEnabled = true
  43.             applicationIdSuffix = ".debug"
  44.             isDebuggable = true
  45.         }
  46.  
  47.         val dimensionDefault = "default"
  48.         val flavorMock = "mock"
  49.         val flavorProduction = "prod"
  50.         flavorDimensions(dimensionDefault)
  51.         productFlavors {
  52.             create(flavorMock) {
  53.                 setDimension(dimensionDefault)
  54.             }
  55.  
  56.             create(flavorProduction) {
  57.                 setDimension(dimensionDefault)
  58.             }
  59.         }
  60.  
  61.         variantFilter {
  62.             if (buildType.name == buildRelease && flavors[0].name == flavorMock) {
  63.                 setIgnore(true)
  64.             }
  65.         }
  66.  
  67.         sourceSets {
  68.             getByName("main").java.srcDirs("src/main/kotlin")
  69.             getByName("test").java.srcDirs("src/test/kotlin")
  70.             getByName("mock").java.srcDirs("src/mock/kotlin")
  71.             getByName("prod").java.srcDirs("src/prod/kotlin")
  72.         }
  73.  
  74.         kapt {
  75. //            generateStubs = true
  76. //            correctErrorTypes = true
  77.         }
  78.  
  79.         repositories {
  80.             google()
  81.             mavenCentral()
  82.             maven {
  83.                 url = uri("mint-plugin-repo-5.2.1")
  84.             }
  85.         }
  86.     }
  87.  
  88.     testOptions {
  89.         junitPlatform {
  90.             filters {
  91.                 includeEngines("spek2")
  92.             }
  93.         }
  94.     }
  95.  
  96. //    Configure Java 8
  97.     compileOptions {
  98.         sourceCompatibility = JavaVersion.VERSION_1_8
  99.         targetCompatibility = JavaVersion.VERSION_1_8
  100.     }
  101. }
  102.  
  103. dependencies {
  104.     implementation(fileTree("libs") { include("*.jar", "*.aar") })
  105.     implementation(project(":expandablerecyclerview"))
  106.  
  107.     implementation("androidx.appcompat:appcompat:1.0.2")
  108.     implementation("com.google.android.material:material:1.0.0")
  109.     implementation("androidx.constraintlayout:constraintlayout:2.0.0-alpha3")
  110.     implementation("com.google.firebase:firebase-core:16.0.6")
  111.     implementation("com.google.firebase:firebase-messaging:17.3.4")
  112.     implementation("android.arch.work:work-runtime:1.0.0-beta02") {
  113.         exclude("com.google.guava", "listenablefuture")
  114.     }
  115.  
  116.     implementation("androidx.room:room-compiler:2.0.0")
  117.     annotationProcessor("androidx.room:room-compiler:2.0.0")
  118.     implementation("androidx.room:room-rxjava2:2.0.0")
  119.  
  120.     implementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
  121.     implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1")
  122.  
  123.     implementation("io.reactivex.rxjava2:rxjava:2.2.4")
  124.     implementation("io.reactivex.rxjava2:rxandroid:2.1.0")
  125.     implementation("com.jakewharton.rxrelay2:rxrelay:2.1.0")
  126.  
  127.     implementation("com.squareup.okhttp3:logging-interceptor:3.11.0")
  128.     implementation("com.squareup.retrofit2:retrofit:2.5.0")
  129.     implementation("com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2")
  130.     implementation("com.squareup.retrofit2:converter-moshi:2.5.0")
  131.  
  132.     implementation("com.google.dagger:dagger:2.17")
  133.     kapt("com.google.dagger:dagger-compiler:2.17")
  134.  
  135.     implementation("com.bluelinelabs:conductor:2.1.5")
  136.     implementation("com.jakewharton.timber:timber:4.6.0")
  137.     implementation("com.splunk:mint-android-sdk:5.2.1")
  138.     implementation("com.journeyapps:zxing-android-embedded:3.5.0@aar")
  139.     implementation("com.google.zxing:core:3.3.0")
  140.  
  141. //    junit 4 backwards compat
  142.     testImplementation("junit:junit:4.12")
  143.     testImplementation("org.junit.vintage:junit-vintage-engine:5.3.1")
  144. //    junit 5 for spek
  145.     testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
  146.     testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
  147.  
  148.     testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.0-rc.1")
  149.     testImplementation("org.spekframework.spek2:spek-runner-junit5:2.0.0-rc.1")
  150.     testImplementation(kotlin("reflect", KotlinCompilerVersion.VERSION))
  151.  
  152.     testImplementation("org.mockito:mockito-core:2.23.0")
  153.     testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
  154.  
  155.     testImplementation("org.robolectric:robolectric:3.8")
  156.  
  157.  
  158.     "mockImplementation"("com.squareup.retrofit2:retrofit-mock:2.2.0") {
  159.         exclude("com.squareup.okio", "okio")
  160.         exclude("com.squareup.okhttp3", "okhttp")
  161.     }
  162. }
  163.  
  164. // configuring Java 8 for kotlin
  165. tasks.withType(KotlinCompile::class).configureEach {
  166.     kotlinOptions {
  167.         jvmTarget = "1.8"
  168.     }
  169. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement