build.gradle revision 9399cb4e3d86a88507fb06ad57661105b1eaa69a
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 noticeFile.delete() 73 println ("writing notice file to: ${noticeFile.getAbsolutePath()}") 74 noticeFile << notice 75 } 76 from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } 77 from new File(project.buildDir,'NOTICE.txt') 78 archiveName "databinding-studio-bundle.jar" 79 destinationDir = new File(config.prebuildFolder) 80 with jar 81} 82 83task prebuild() { 84 dependsOn fatJar 85} 86 87