build.gradle revision ee7586713d68806b556a425cbebf007a56261ff3
1import android.databinding.LicenseCollector
2
3/*
4 * Copyright (C) 2014 The Android Open Source Project
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *      http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19apply plugin: 'java'
20apply plugin: "kotlin"
21
22
23sourceCompatibility = config.javaTargetCompatibility
24targetCompatibility = config.javaSourceCompatibility
25
26buildscript {
27    repositories {
28        mavenCentral()
29    }
30    dependencies {
31        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${config.kotlinVersion}"
32        classpath 'org.apache.commons:commons-io:1.3.2'
33    }
34}
35
36
37dependencies {
38    compile 'junit:junit:4.12'
39    compile 'org.apache.commons:commons-lang3:3.3.2'
40    compile 'org.apache.commons:commons-io:1.3.2'
41    compile 'com.google.guava:guava:18.0'
42    compile "org.jetbrains.kotlin:kotlin-stdlib:${config.kotlinVersion}"
43    compile 'commons-codec:commons-codec:1.10'
44    compile project(":baseLibrary")
45    compile project(":grammarBuilder")
46    compile project(":xmlGrammar")
47    testCompile "com.android.databinding:libraryJar:$version@jar"
48}
49
50
51uploadArchives {
52    repositories {
53        mavenDeployer {
54            pom.artifactId = 'compiler'
55        }
56    }
57}
58
59project(':library').afterEvaluate { libProject ->
60    tasks['compileTestKotlin'].dependsOn libProject.tasks['uploadJarArchives']
61}
62
63task fatJar(type: Jar) {
64    baseName = project.name + '-all'
65    doFirst {
66        def LicenseCollector allLicenses = new LicenseCollector();
67        configurations.compile.getResolvedConfiguration().getResolvedArtifacts().each {
68            allLicenses.add(it)
69        }
70        def notice = allLicenses.buildNotice()
71        def noticeFile = new File(project.buildDir,'NOTICE.txt')
72        println ("writing notice file to: ${noticeFile.getAbsolutePath()}")
73        noticeFile << notice
74    }
75    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
76    from new File(project.buildDir,'NOTICE.txt')
77    archiveName "databinding-studio-bundle.jar"
78    destinationDir = new File(config.prebuildFolder)
79    with jar
80}
81
82task prebuild() {
83    dependsOn fatJar
84}
85
86