build.gradle revision 2c86cdbaf189e2b1774af7f64a2974de9321673f
1/*
2 * Copyright (C) 2014 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
17apply plugin: 'com.android.application'
18apply plugin: 'com.android.databinding'
19
20def generatedSources = "$buildDir/generated/source/br"
21
22android {
23    compileSdkVersion 21
24    buildToolsVersion "21.1.1"
25
26    defaultConfig {
27        applicationId "com.android.bindingdemo"
28        minSdkVersion 15
29        targetSdkVersion 21
30        versionCode 1
31        versionName "1.0"
32    }
33    compileOptions {
34        sourceCompatibility JavaVersion.VERSION_1_7
35        targetCompatibility JavaVersion.VERSION_1_7
36    }
37    buildTypes {
38        release {
39            minifyEnabled false
40            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
41        }
42    }
43    packagingOptions {
44        exclude 'META-INF/services/javax.annotation.processing.Processor'
45    }
46}
47
48android.applicationVariants.all { variant ->
49    variant.javaCompile.doFirst {
50        println "*** compile doFirst ${variant.name}"
51        new File(generatedSources).mkdirs()
52        variant.javaCompile.options.compilerArgs += [
53                '-s', generatedSources
54        ]
55    }
56}
57
58dependencies {
59    compile fileTree(dir: 'libs', include: ['*.jar'])
60    compile 'com.android.support:appcompat-v7:21.+'
61    compile 'com.android.databinding:library:0.3-SNAPSHOT@aar'
62    compile 'com.android.support:recyclerview-v7:21.0.2'
63    compile 'com.android.support:gridlayout-v7:21.+'
64    compile 'com.android.support:cardview-v7:21.+'
65    compile 'com.android.databinding:baseLibrary:0.3-SNAPSHOT'
66    //provided 'com.android.databinding:compiler:0.3-SNAPSHOT'
67    provided 'com.android.databinding:annotationprocessor:0.3-SNAPSHOT'
68    provided fileTree(dir : 'build/databinder/src', include : ['*.java'])
69}
70