summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurimas Liutikas <aurimas@google.com>2020-02-13 16:15:23 +0000
committerAurimas Liutikas <aurimas@google.com>2020-02-13 16:15:23 +0000
commitae5b3bdc675667bf855c43f1f9e09a7e08784595 (patch)
tree7d97d74026f809bc4ff31ec35b4450ff35dc27d6
parente08a0e9ea5e2d57760e7195f8caa4e8a54ca09e5 (diff)
downloaddoclava-ae5b3bdc675667bf855c43f1f9e09a7e08784595.tar.gz
Revert "Remove Java 8 requirement."
This reverts commit e08a0e9ea5e2d57760e7195f8caa4e8a54ca09e5. Reason for revert: broke androidx-master-dev build. Exempt-From-Owner-Approval: A revert of a change breaking the build Change-Id: I427d00087b9a33b36c6be0d3e119f44190bfed0b
-rw-r--r--build.gradle9
1 files changed, 8 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle
index e56ffa2..3096e0e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,6 +22,13 @@ apply plugin: 'maven'
group = 'com.android'
version = '1.0.6'
+def currentJvmVersion = org.gradle.api.JavaVersion.current()
+if (currentJvmVersion.getMajorVersion() != "8") {
+ throw new Exception("Unsupported java version '" + currentJvmVersion.toString() + "'. Please install java 8.\n" +
+"\n" +
+"If you have already installed java 8, you can instruct Gradle to use it by setting the environment variable JAVA_HOME equal to its file path.")
+}
+
/*
* With the build server you are given two env variables:
* 1. The OUT_DIR is a temporary directory you can use to put things during the build.
@@ -78,7 +85,7 @@ dependencies {
testCompile 'junit:junit:4.12'
// tools.jar required for com.sun.javadoc
- compile files(System.getProperty('java.home') + "/libs/tools.jar")
+ compile files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs())
}
sourceSets {