Only build ratpack when using a java 8 compiler
@@ -9,23 +9,12 @@ versionScan {
]
}
+if (JavaVersion.current().java8Compatible) {
apply from: "${rootDir}/gradle/java.gradle"
// Ratpack only supports Java 1.8+
sourceCompatibility = 1.8
targetCompatibility = 1.8
-
-if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
- sourceSets {
- test {
- groovy {
- // These classes use Ratpack which requires Java 8. (Currently also incompatible with Java 9.)
- exclude '**/RatpackTest.groovy'
- }
- }
- }
-}
-
dependencies {
compileOnly group: 'io.ratpack', name: 'ratpack-core', version: '1.4.0'
@@ -41,3 +30,16 @@ dependencies {
testCompile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
}
+}
+
+if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+ sourceSets {
+ test {
+ groovy {
+ // These classes use Ratpack which requires Java 8. (Currently also incompatible with Java 9.)
+ exclude '**/RatpackTest.groovy'
+ }
+ }
+ }
+}
+
