[Git][java-team/gradle][master] 3 commits: Raise the javac source/target level automatically to build on recent JDKs (Closes: #894290)

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Tue May 31 14:43:43 BST 2022



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / gradle


Commits:
b4dac5f6 by Emmanuel Bourg at 2022-05-31T13:33:06+02:00
Raise the javac source/target level automatically to build on recent JDKs (Closes: #894290)

- - - - -
c893120a by Emmanuel Bourg at 2022-05-31T15:40:35+02:00
Set --add-opens java.base/java.lang=ALL-UNNAMED when launching Gradle (Closes: #1011621)

- - - - -
b9fa10e7 by Emmanuel Bourg at 2022-05-31T15:43:18+02:00
Upload to unstable

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/auto-adjust-language-level.patch
- debian/patches/permit-illegal-access.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+gradle (4.4.1-14) unstable; urgency=medium
+
+  * Team upload.
+  * Raise automatically the javac source/target level to at least 7
+    to build Gradle based packages with OpenJDK 17 (Closes: #894290)
+  * Set --add-opens java.base/java.lang=ALL-UNNAMED when launching Gradle (Closes: #1011621)
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Tue, 31 May 2022 15:42:58 +0200
+
 gradle (4.4.1-13) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/auto-adjust-language-level.patch
=====================================
@@ -0,0 +1,43 @@
+Description: Adjust the source/target level automatically for building with recent JDKs
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/subprojects/language-jvm/src/main/java/org/gradle/api/internal/tasks/compile/DefaultJvmLanguageCompileSpec.java
++++ b/subprojects/language-jvm/src/main/java/org/gradle/api/internal/tasks/compile/DefaultJvmLanguageCompileSpec.java
+@@ -32,6 +32,13 @@
+     private String sourceCompatibility;
+     private String targetCompatibility;
+ 
++    private List<String> unsupportedLanguageLevels = java.util.Arrays.asList(new String[]{"1.1", "1.2", "1.3", "1.4", "1.5", "5", "1.6", "6"});
++
++    /** Detect if a Debian build is in process */
++    static boolean isDebianBuild() {
++        return System.getenv("DEB_BUILD_ARCH") != null;
++    }
++
+     @Override
+     public File getWorkingDir() {
+         return workingDir;
+@@ -100,6 +107,11 @@
+ 
+     @Override
+     public void setSourceCompatibility(String sourceCompatibility) {
++        if (isDebianBuild() && unsupportedLanguageLevels.contains(sourceCompatibility)) {
++            System.err.println( "Use of source " + sourceCompatibility + " is no longer supported, switching to 7" );
++            sourceCompatibility = "7";
++        }
++
+         this.sourceCompatibility = sourceCompatibility;
+     }
+ 
+@@ -110,6 +122,11 @@
+ 
+     @Override
+     public void setTargetCompatibility(String targetCompatibility) {
++        if (isDebianBuild() && unsupportedLanguageLevels.contains(targetCompatibility)) {
++            System.err.println( "Use of target " + targetCompatibility + " is no longer supported, switching to 7" );
++            targetCompatibility = "7";
++        }
++
+         this.targetCompatibility = targetCompatibility;
+     }
+ }


=====================================
debian/patches/permit-illegal-access.patch
=====================================
@@ -8,7 +8,7 @@ Forwarded: not-needed
  
  # Collect all arguments for the java command, following the shell quoting and substitution rules
 -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS"
-+eval set -- \$DEFAULT_JVM_OPTS --illegal-access=permit \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS"
++eval set -- \$DEFAULT_JVM_OPTS --illegal-access=permit --add-opens java.base/java.lang=ALL-UNNAMED \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS"
  
  # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
  if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then


=====================================
debian/patches/series
=====================================
@@ -38,3 +38,4 @@ backport-capabilities.patch
 source-level.patch
 permit-illegal-access.patch
 java17-compatibility.patch
+auto-adjust-language-level.patch



View it on GitLab: https://salsa.debian.org/java-team/gradle/-/compare/8d55a5cae4dbaaac46538a6f6a3a77a743de2214...b9fa10e73911d8721295a9a30e636339ae2ded13

-- 
View it on GitLab: https://salsa.debian.org/java-team/gradle/-/compare/8d55a5cae4dbaaac46538a6f6a3a77a743de2214...b9fa10e73911d8721295a9a30e636339ae2ded13
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220531/15223aff/attachment.htm>


More information about the pkg-java-commits mailing list