Forráskód Böngészése

common.gradle: set class files compatible with Java 8 using "release" option (#1907)

* common.gradle: set class files compatible with Java 8. This will keep java 8 compatibility when it is compiled with newer java versions.

* Merge with existing block.

* Reformat code.
Ali-RS 2 éve
szülő
commit
b0e6ce7ae8
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      common.gradle

+ 3 - 1
common.gradle

@@ -20,6 +20,9 @@ tasks.withType(JavaCompile) { // compile-time options:
     //options.compilerArgs << '-Xlint:deprecation' // to show deprecation warnings
     options.compilerArgs << '-Xlint:unchecked'
     options.encoding = 'UTF-8'
+    if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_10)) {
+        options.release = 8
+    }
 }
 
 ext {
@@ -40,7 +43,6 @@ dependencies {
     testImplementation 'org.codehaus.groovy:groovy-test:3.0.14'
 }
 
-
 // Uncomment if you want to see the status of every test that is run and
 // the test output.
 /*