Home | History | Annotate | Download | only in kotlintestapp
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 // TO debug processor, run:
     17 //./gradlew :r:in:k:clean :r:in:k:cC --no-daemon
     18 // -Dorg.gradle.debug=true
     19 // -Dkotlin.compiler.execution.strategy="in-process"
     20 import static androidx.build.dependencies.DependenciesKt.*
     21 
     22 plugins {
     23     id("SupportAndroidTestAppPlugin")
     24     id("kotlin-kapt")
     25     id("kotlin-android")
     26 }
     27 
     28 android {
     29     defaultConfig {
     30         javaCompileOptions {
     31             annotationProcessorOptions {
     32                 arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
     33             }
     34         }
     35     }
     36     sourceSets {
     37         androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
     38     }
     39 }
     40 
     41 dependencies {
     42     implementation(project(":room:room-common"))
     43     implementation(project(":sqlite:sqlite"))
     44     implementation(project(":sqlite:sqlite-framework"))
     45     implementation(project(":room:room-runtime"))
     46     implementation(project(":arch:core-runtime"))
     47     implementation(project(":lifecycle:lifecycle-extensions"))
     48     kaptAndroidTest project(":room:room-compiler")
     49 
     50     androidTestImplementation(TEST_RUNNER) {
     51         exclude module: 'support-annotations'
     52         exclude module: 'hamcrest-core'
     53     }
     54     androidTestImplementation(ESPRESSO_CORE, {
     55         exclude group: 'com.android.support', module: 'support-annotations'
     56         exclude module: "hamcrest-core"
     57     })
     58     // IJ's gradle integration just cannot figure this out ...
     59     androidTestImplementation project(':lifecycle:lifecycle-extensions')
     60     androidTestImplementation project(':lifecycle:lifecycle-common')
     61     androidTestImplementation project(':lifecycle:lifecycle-runtime')
     62     androidTestImplementation project(':room:room-guava')
     63     androidTestImplementation project(':room:room-testing')
     64     androidTestImplementation project(':room:room-rxjava2')
     65     androidTestImplementation project(':arch:core-testing')
     66     androidTestImplementation(GUAVA_ANDROID)
     67     androidTestImplementation(RX_JAVA)
     68     testImplementation(MOCKITO_CORE)
     69 }
     70 
     71 tasks['check'].dependsOn(tasks['connectedCheck'])
     72 
     73 uploadArchives.enabled = false
     74 
     75 supportTestApp {
     76     // to assert that room generates somewhat OK code.
     77     enableErrorProne = true
     78 }
     79