]> source.dussan.org Git - poi.git/commitdiff
move jdk check into doFirst
authorAndreas Beeker <kiwiwings@apache.org>
Sat, 10 Apr 2021 12:01:15 +0000 (12:01 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Sat, 10 Apr 2021 12:01:15 +0000 (12:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888582 13f79535-47bb-0310-9956-ffa450edef68

build.gradle

index 345b5c34d8edb14bdad1a7714ca488692262c8fc..a450472a76c38b0fe64169e51f2af1731c105730 100644 (file)
@@ -384,16 +384,18 @@ rat {
 //compileJava.dependsOn 'downloadJarsToLibs'
 
 task site(type:Exec) {
-    if (System.env.FORREST_HOME == null) {
-        throw new InvalidUserDataException(
-            'Apache Forrest is not installed.\n' +
-            'Please install Apache Forrest (see https://forrest.apache.org/index.html) and set the\n' +
-            'FORREST_HOME environment variable!')
-    }
+    doFirst {
+        if (System.env.FORREST_HOME == null) {
+            throw new InvalidUserDataException(
+                'Apache Forrest is not installed.\n' +
+                    'Please install Apache Forrest (see https://forrest.apache.org/index.html) and set the\n' +
+                    'FORREST_HOME environment variable!')
+        }
 
-    if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
-        // maybe Java 9-11 works too?
-        throw new GradleScriptException("Apache Forrest must be executed with Java 8!")
+        if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+            // maybe Java 9-11 works too?
+            throw new GradleException("Apache Forrest must be executed with Java 8!")
+        }
     }
 
     if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {