blob: b783256662b91d9f257288c4ea4ae549cb56695b [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply from: "$rootDir/buildSrc/base/baseJava.gradle"
sourceSets {
main {
java {
srcDirs 'java/com/google/devtools'
exclude 'build/android/desugar/runtime/**'
exclude 'common/options/InvocationPolicyEnforcer.java'
exclude 'common/options/InvocationPolicyParser.java'
exclude 'common/options/testing/**/*.java'
}
}
}
// these have to match the dependencies found in Android.mk
dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.1'
compileOnly 'com.google.auto.value:auto-value:1.3'
compileOnly 'com.google.errorprone:error_prone_annotations:2.0.18'
compile 'com.google.guava:guava:21.0'
compile 'org.ow2.asm:asm:6.0'
compile 'org.ow2.asm:asm-tree:6.0'
compile 'org.ow2.asm:asm-commons:6.0'
}
// setup annotation processor output directory
File generatedSources = new File(project.buildDir, 'generated/generated')
tasks.compileJava {
doFirst {
generatedSources.mkdirs()
}
options.compilerArgs += ['-s', generatedSources]
outputs.dir(generatedSources)
}
task('fatJarCreator', type: Jar) {
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
from {
sourceSets.main.output
}
archiveName 'desugar_deploy.jar'
manifest {
attributes 'Main-Class': 'com.google.devtools.build.android.desugar.Desugar'
}
}
configurations {
fatJar
}
artifacts {
fatJar fatJarCreator
}