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 */
16apply plugin: 'com.android.application'
17apply plugin: 'kotlin-kapt'
18apply plugin: 'kotlin-android'
19
20project.ext.noDocs = true
21
22android {
23    compileSdkVersion tools.current_sdk
24    buildToolsVersion tools.build_tools_version
25
26    defaultConfig {
27        minSdkVersion flatfoot.min_sdk
28        targetSdkVersion tools.current_sdk
29        versionCode 1
30        versionName "1.0"
31
32        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
33        javaCompileOptions {
34            annotationProcessorOptions {
35                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
36            }
37        }
38    }
39    testOptions {
40        unitTests.returnDefaultValues = true
41    }
42    compileOptions {
43        sourceCompatibility JavaVersion.VERSION_1_7
44        targetCompatibility JavaVersion.VERSION_1_7
45    }
46    sourceSets {
47        androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
48    }
49}
50
51dependencies {
52    implementation project(":room:common")
53    implementation project(":persistence:db")
54    implementation project(":persistence:db-framework")
55    implementation project(':room:runtime')
56    implementation project(':arch:runtime')
57
58    implementation libs.support.app_compat, libs.support_exclude_config
59    kapt project(":room:compiler")
60    kaptAndroidTest project(":room:compiler")
61
62    androidTestCompile(libs.test_runner) {
63        exclude module: 'support-annotations'
64        exclude module: 'hamcrest-core'
65    }
66    androidTestCompile(libs.espresso_core, {
67        exclude group: 'com.android.support', module: 'support-annotations'
68        exclude module: "hamcrest-core"
69    })
70    // IJ's gradle integration just cannot figure this out ...
71    androidTestImplementation project(':lifecycle:extensions')
72    androidTestImplementation project(':lifecycle:common')
73    androidTestImplementation project(':lifecycle:runtime')
74    androidTestImplementation project(':room:testing')
75    androidTestImplementation project(':room:rxjava2')
76    androidTestImplementation project(':arch:core-testing')
77    androidTestImplementation libs.rx_java
78    testImplementation libs.mockito_core
79}
80
81createAndroidCheckstyle(project)
82createKotlinCheckstyle(project)
83tasks['check'].dependsOn(tasks['connectedCheck'])
84
85uploadArchives.enabled = false
86