build.gradle revision 63d478953393b1a2ea3b68d298b1d5fc64542e7b
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 */
16import android.databinding.LicenseCollector
17apply plugin: 'java'
18apply plugin: "kotlin"
19apply plugin: 'com.android.databinding.bintray'
20
21
22sourceCompatibility = config.javaTargetCompatibility
23targetCompatibility = config.javaSourceCompatibility
24
25buildscript {
26    repositories {
27        mavenCentral()
28    }
29    dependencies {
30        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${config.kotlinVersion}"
31        classpath 'org.apache.commons:commons-io:1.3.2'
32    }
33}
34
35dependencies {
36    compile project(":compilerCommon")
37    compile project(':baseLibrary')
38    compile 'org.apache.commons:commons-lang3:3.3.2'
39    compile 'commons-io:commons-io:2.4'
40    compile 'commons-codec:commons-codec:1.10'
41    compile "org.jetbrains.kotlin:kotlin-stdlib:${config.kotlinVersion}"
42
43    compile 'com.tunnelvisionlabs:antlr4:4.5'
44    testCompile files('../baseLibrary/src/main/java')
45    testCompile files('../library/src/main/java')
46    testCompile 'junit:junit:4.12'
47}
48
49uploadArchives {
50    repositories {
51        mavenDeployer {
52            pom.artifactId = 'compiler'
53            pom.project {
54                licenses {
55                    license {
56                        name config.licenseName
57                        url config.licenseUrl
58                        distribution config.licenseDistribution
59                    }
60                }
61            }
62        }
63    }
64}
65
66project(':library').afterEvaluate { libProject ->
67    tasks['compileTestKotlin'].dependsOn libProject.tasks['uploadJarArchives']
68}
69
70task fatJar(type: Jar) {
71    baseName = project.name + '-all'
72    doFirst {
73        def LicenseCollector allLicenses = new LicenseCollector();
74        configurations.compile.getResolvedConfiguration().getResolvedArtifacts().each {
75            allLicenses.add(it)
76        }
77        def notice = allLicenses.buildNotice()
78        def noticeFile = new File(project.buildDir,'NOTICE.txt')
79        noticeFile.delete()
80        println ("writing notice file to: ${noticeFile.getAbsolutePath()}")
81        noticeFile << notice
82    }
83    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
84    from new File(project.buildDir,'NOTICE.txt')
85    archiveName "databinding-studio-bundle.jar"
86    destinationDir = new File(config.prebuildFolder)
87    with jar
88}
89
90task prebuild() {
91    dependsOn fatJar
92}
93
94