Skip to content

Commit

Permalink
Add toolJar compile error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jap963852741 committed Jan 7, 2022
1 parent 52a8cf8 commit 14da594
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions annotation/compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'java'
configurations {
// adapted from https://android.googlesource.com/platform/frameworks/testing/+/976c423/espresso/espresso-lib/build.gradle
// compileOnly dependencies will be repackaged, see rules in jarjar ant task below
jarjar
jarjar
}

dependencies {
Expand All @@ -18,7 +18,11 @@ dependencies {
compileOnly "com.google.code.findbugs:jsr305:${JSR_305_VERSION}"
compile project(':annotation')
// This is to support com.sun.tools.javac.util.List, currently used in RootModuleGenerator.
compile files(Jvm.current().getToolsJar())
def toolsJar = Jvm.current().getToolsJar()
if (!toolsJar)
throw new GradleException("tools.jar not found at your JAVA_HOME dir ${Jvm.current().getJavaHome().getAbsolutePath()}.\n Please resetting your jdk")
testCompile files(toolsJar)

annotationProcessor "com.google.auto.service:auto-service:${AUTO_SERVICE_VERSION}"
}

Expand Down Expand Up @@ -51,8 +55,8 @@ task jarjar(dependsOn: [tasks.compiledJar, configurations.compileOnly]) {
jarjar(jarfile: repackagedJar) {
configurations.compileOnly.resolve().each {
zipfileset(src: it.absolutePath, excludes: [
'META-INF/maven/**',
'META-INF/services/javax.annotation.processing.Processor'
'META-INF/maven/**',
'META-INF/services/javax.annotation.processing.Processor'
].join(','))
}
zipfileset(src: tasks.compiledJar.archivePath)
Expand Down

0 comments on commit 14da594

Please sign in to comment.