Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | */ |
Yigit Boyar | efaf86a | 2016-12-02 15:16:35 -0800 | [diff] [blame] | 16 | import com.android.builder.core.BuilderConstants |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 17 | apply plugin: 'com.android.library' |
Yigit Boyar | efaf86a | 2016-12-02 15:16:35 -0800 | [diff] [blame] | 18 | apply plugin: 'maven' |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 19 | |
| 20 | android { |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 21 | compileSdkVersion tools.current_sdk |
| 22 | buildToolsVersion tools.build_tools_version |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 23 | |
| 24 | defaultConfig { |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 25 | minSdkVersion flatfoot.min_sdk |
| 26 | targetSdkVersion tools.current_sdk |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 27 | versionCode 1 |
| 28 | versionName "1.0" |
| 29 | |
| 30 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 31 | |
| 32 | } |
Yigit Boyar | 9691051 | 2017-04-06 23:16:01 -0700 | [diff] [blame] | 33 | |
| 34 | buildTypes.all { |
| 35 | consumerProguardFiles 'proguard-rules.pro' |
| 36 | } |
| 37 | |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 38 | buildTypes { |
| 39 | release { |
| 40 | minifyEnabled false |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
| 44 | testOptions { |
| 45 | unitTests.returnDefaultValues = true |
| 46 | } |
| 47 | compileOptions { |
| 48 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 49 | targetCompatibility JavaVersion.VERSION_1_7 |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | dependencies { |
Yigit Boyar | 2eb5199 | 2016-12-13 15:00:07 -0800 | [diff] [blame] | 54 | compile project(":room:common") |
| 55 | compile project(":room:db") |
| 56 | compile project(":room:db-impl") |
Yigit Boyar | 64db0cc | 2017-04-17 13:18:56 -0700 | [diff] [blame] | 57 | compile project(":arch:core") |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 58 | compile libs.support.core_utils |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 59 | |
Yigit Boyar | a64756a | 2017-03-20 17:26:17 -0700 | [diff] [blame] | 60 | |
Yigit Boyar | 64db0cc | 2017-04-17 13:18:56 -0700 | [diff] [blame] | 61 | testCompile project(":arch:core-testing") |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 62 | testCompile libs.junit |
Yigit Boyar | b323d28 | 2017-06-28 13:58:45 -0700 | [diff] [blame] | 63 | testCompile libs.mockito_core |
Yigit Boyar | a64756a | 2017-03-20 17:26:17 -0700 | [diff] [blame] | 64 | testCompile libs.support.annotations |
| 65 | |
| 66 | androidTestCompile libs.junit |
| 67 | androidTestCompile(libs.test_runner) { |
| 68 | exclude module: 'support-annotations' |
| 69 | } |
| 70 | androidTestCompile(libs.espresso_core, { |
| 71 | exclude group: 'com.android.support', module: 'support-annotations' |
| 72 | }) |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 73 | } |
| 74 | |
Yigit Boyar | 83ebc49 | 2017-03-08 20:43:45 -0800 | [diff] [blame] | 75 | archivesBaseName = "runtime" |
Yigit Boyar | efaf86a | 2016-12-02 15:16:35 -0800 | [diff] [blame] | 76 | |
Yigit Boyar | 2259e4d | 2016-11-25 18:26:10 -0800 | [diff] [blame] | 77 | createAndroidCheckstyle(project) |
Yigit Boyar | efaf86a | 2016-12-02 15:16:35 -0800 | [diff] [blame] | 78 | |
| 79 | android.libraryVariants.all { variant -> |
| 80 | def name = variant.buildType.name |
| 81 | def suffix = name.capitalize() |
Sergey Vasilinets | 459caad | 2017-03-01 11:11:34 -0800 | [diff] [blame] | 82 | project.tasks.create(name: "jar${suffix}", type: Jar){ |
Yigit Boyar | efaf86a | 2016-12-02 15:16:35 -0800 | [diff] [blame] | 83 | dependsOn variant.javaCompile |
| 84 | from variant.javaCompile.destinationDir |
| 85 | destinationDir new File(project.buildDir, "libJar") |
| 86 | } |
| 87 | } |