build.gradle revision 924fa7c597694ebc433fc0379d0015785351d1b7
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" 19 20 21sourceCompatibility = config.javaTargetCompatibility 22targetCompatibility = config.javaSourceCompatibility 23 24buildscript { 25 repositories { 26 mavenCentral() 27 } 28 dependencies { 29 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${config.kotlinVersion}" 30 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 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