Yigit Boyar | 937a77c | 2016-12-08 23:29:56 -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 | */ |
Aurimas Liutikas | e4741f3 | 2017-07-14 17:32:12 -0700 | [diff] [blame] | 16 | |
Yigit Boyar | 937a77c | 2016-12-08 23:29:56 -0800 | [diff] [blame] | 17 | apply plugin: 'com.android.library' |
| 18 | apply plugin: 'maven' |
| 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 | 937a77c | 2016-12-08 23:29:56 -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 | 937a77c | 2016-12-08 23:29:56 -0800 | [diff] [blame] | 27 | versionCode 1 |
| 28 | versionName "1.0" |
| 29 | |
| 30 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 31 | |
| 32 | } |
| 33 | buildTypes { |
| 34 | release { |
| 35 | minifyEnabled false |
| 36 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | testOptions { |
| 41 | unitTests.returnDefaultValues = true |
| 42 | } |
| 43 | compileOptions { |
| 44 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 45 | targetCompatibility JavaVersion.VERSION_1_7 |
| 46 | } |
| 47 | } |
| 48 | |
Yigit Boyar | 937a77c | 2016-12-08 23:29:56 -0800 | [diff] [blame] | 49 | dependencies { |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 50 | compile libs.support.annotations |
Yigit Boyar | 2eb5199 | 2016-12-13 15:00:07 -0800 | [diff] [blame] | 51 | compile project(":room:db") |
Yigit Boyar | 937a77c | 2016-12-08 23:29:56 -0800 | [diff] [blame] | 52 | } |
| 53 | createAndroidCheckstyle(project) |
| 54 | |
| 55 | android.libraryVariants.all { variant -> |
| 56 | def name = variant.buildType.name |
| 57 | def suffix = name.capitalize() |
| 58 | def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ |
| 59 | dependsOn variant.javaCompile |
| 60 | from variant.javaCompile.destinationDir |
| 61 | destinationDir new File(project.buildDir, "libJar") |
| 62 | } |
| 63 | } |