build.gradle revision 0cb9fbb96197af013f4f879ed6cddf2681b88fd6
198a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams/*
298a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * Copyright (C) 2014 The Android Open Source Project
398a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams *
498a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * Licensed under the Apache License, Version 2.0 (the "License");
598a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * you may not use this file except in compliance with the License.
698a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * You may obtain a copy of the License at
798a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams *
898a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams *      http://www.apache.org/licenses/LICENSE-2.0
998a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams *
1098a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * Unless required by applicable law or agreed to in writing, software
1198a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * distributed under the License is distributed on an "AS IS" BASIS,
1298a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1398a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * See the License for the specific language governing permissions and
1498a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams * limitations under the License.
1598a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams */
1698a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Samsimport android.databinding.LicenseCollector
1798a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Samsapply plugin: 'java'
1898a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Samsapply plugin: "kotlin"
1998a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams
2098a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams
2198a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason SamssourceCompatibility = config.javaTargetCompatibility
227d435ae5ba100be5710b685653cc351cab159c11Stephen HinestargetCompatibility = config.javaSourceCompatibility
2398a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams
2498a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Samsbuildscript {
2598a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams    repositories {
2698a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams        mavenCentral()
2798a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams    }
2898a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams    dependencies {
2998a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${config.kotlinVersion}"
3098a281354fe06d1f970d0521c9a08d9eb0aa1a45Jason Sams        classpath 'org.apache.commons:commons-io:1.3.2'
31    }
32}
33
34dependencies {
35    compile project(":compilerCommon")
36    compile project(':baseLibrary')
37    compile 'org.apache.commons:commons-lang3:3.3.2'
38    compile 'commons-io:commons-io:2.4'
39    compile 'commons-codec:commons-codec:1.10'
40    compile 'com.google.guava:guava:17.0'
41    compile "org.jetbrains.kotlin:kotlin-stdlib:${config.kotlinVersion}"
42
43    compile 'com.tunnelvisionlabs:antlr4:4.5'
44    testCompile "com.android.databinding:libraryJar:$version@jar"
45    testCompile 'junit:junit:4.12'
46}
47
48uploadArchives {
49    repositories {
50        mavenDeployer {
51            pom.artifactId = 'compiler'
52            pom.project {
53                licenses {
54                    license {
55                        name config.licenseName
56                        url config.licenseUrl
57                        distribution config.licenseDistribution
58                    }
59                }
60            }
61        }
62    }
63}
64
65project(':library').afterEvaluate { libProject ->
66    tasks['compileTestKotlin'].dependsOn libProject.tasks['uploadJarArchives']
67}
68
69task fatJar(type: Jar) {
70    baseName = project.name + '-all'
71    doFirst {
72        def LicenseCollector allLicenses = new LicenseCollector();
73        configurations.compile.getResolvedConfiguration().getResolvedArtifacts().each {
74            allLicenses.add(it)
75        }
76        def notice = allLicenses.buildNotice()
77        def noticeFile = new File(project.buildDir,'NOTICE.txt')
78        noticeFile.delete()
79        println ("writing notice file to: ${noticeFile.getAbsolutePath()}")
80        noticeFile << notice
81    }
82    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
83    from new File(project.buildDir,'NOTICE.txt')
84    archiveName "databinding-studio-bundle.jar"
85    destinationDir = new File(config.prebuildFolder)
86    with jar
87}
88
89task prebuild() {
90    dependsOn fatJar
91}
92
93