diff --git a/annotation/compiler/build.gradle b/annotation/compiler/build.gradle index 453d9877a8..ef57c27289 100644 --- a/annotation/compiler/build.gradle +++ b/annotation/compiler/build.gradle @@ -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 { @@ -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}" }