[Git][java-team/gradle-debian-helper][master] 4 commits: Open the modules required to run on Java 17

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Tue May 17 09:36:50 BST 2022



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


Commits:
808fb1ed by Emmanuel Bourg at 2022-05-17T10:34:04+02:00
Open the modules required to run on Java 17

- - - - -
370a2262 by Emmanuel Bourg at 2022-05-17T10:34:15+02:00
Standards-Version updated to 4.6.1

- - - - -
fa4a8319 by Emmanuel Bourg at 2022-05-17T10:34:54+02:00
Switch to debhelper level 13

- - - - -
4cbf9f26 by Emmanuel Bourg at 2022-05-17T10:36:25+02:00
Upload to unstable

- - - - -


5 changed files:

- debian/changelog
- − debian/compat
- debian/control
- + gradle-helper-plugin/src/main/java/org/debian/gradle/CheckJPMS.java
- gradle-helper-plugin/src/main/perl/gradle.pm


Changes:

=====================================
debian/changelog
=====================================
@@ -1,9 +1,15 @@
-gradle-debian-helper (2.1.1) UNRELEASED; urgency=medium
+gradle-debian-helper (2.2) unstable; urgency=medium
 
+  [ Andrius Merkys ]
   * Adding a notice about automatic test execution starting from debhelper
     compatibility level 13.
 
- -- Andrius Merkys <merkys at debian.org>  Fri, 08 Nov 2019 08:40:02 -0500
+  [ Emmanuel Bourg ]
+  * Open the modules required to run on Java 17
+  * Standards-Version updated to 4.6.1
+  * Switch to debhelper level 13
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Tue, 17 May 2022 10:36:07 +0200
 
 gradle-debian-helper (2.1) unstable; urgency=medium
 


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-11


=====================================
debian/control
=====================================
@@ -6,11 +6,11 @@ Uploaders:
  Emmanuel Bourg <ebourg at apache.org>,
  Kai-Chung Yan <seamlikok at gmail.com>
 Build-Depends:
- debhelper (>= 11),
+ debhelper-compat (= 13),
  default-jdk-headless | default-jdk,
  gradle (>= 4.4),
  maven-debian-helper
-Standards-Version: 4.2.1
+Standards-Version: 4.6.1
 Vcs-Git: https://salsa.debian.org/java-team/gradle-debian-helper.git
 Vcs-Browser: https://salsa.debian.org/java-team/gradle-debian-helper
 


=====================================
gradle-helper-plugin/src/main/java/org/debian/gradle/CheckJPMS.java
=====================================
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2022 Emmanuel Bourg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.debian.gradle;
+
+/**
+ * Check if the current JRE supports JPMS modules.
+ */
+public class CheckJPMS {
+
+    public static void main(String[] args) {
+        try {
+            Class.forName("java.lang.Module");
+            System.exit(0);
+        } catch (ClassNotFoundException e) {
+            System.exit(1);
+        }
+    }
+}


=====================================
gradle-helper-plugin/src/main/perl/gradle.pm
=====================================
@@ -91,12 +91,21 @@ sub _execute_gradle_task {
 	$this->doit_in_builddir("mkdir", "-p", ".gradle/init.d");
 	$this->doit_in_builddir("cp", "/usr/share/gradle-debian-helper/init.gradle", ".gradle/init.d/");
 
+	my $ADD_OPENS = "";
+	if (_check_jpms()) {
+		$ADD_OPENS .= " --add-opens java.base/java.lang=ALL-UNNAMED";
+	}
+
 	# Add the hook to the classpath
 	my $hookClasspath = "/usr/share/java/gradle-helper-hook.jar:/usr/share/java/maven-repo-helper.jar";
 	$ENV{JAVA_OPTS} .= " -Xbootclasspath/a:$hookClasspath";
-	$ENV{JAVA_OPTS} .= " -Dorg.gradle.jvmargs=-Xbootclasspath/a:$hookClasspath";
+	$ENV{JAVA_OPTS} .= " -Dorg.gradle.jvmargs='-Xbootclasspath/a:$hookClasspath $ADD_OPENS'";
 
 	$this->doit_in_builddir(@{$this->{gradle_cmd}}, @_);
 }
 
+sub _check_jpms {
+	return system("java -cp /usr/share/java/gradle-helper-plugin.jar org.debian.gradle.CheckJPMS") == 0;
+}
+
 1



View it on GitLab: https://salsa.debian.org/java-team/gradle-debian-helper/-/compare/218852135c7dbefa790aeeecf032477a492066bf...4cbf9f26a678db7e7cf8e1ff16176e86a9806372

-- 
View it on GitLab: https://salsa.debian.org/java-team/gradle-debian-helper/-/compare/218852135c7dbefa790aeeecf032477a492066bf...4cbf9f26a678db7e7cf8e1ff16176e86a9806372
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/20220517/6aa9c5e5/attachment.htm>


More information about the pkg-java-commits mailing list