[Git][java-team/eclipse-debian-helper][master] Default to the Java release required by the bundle manifest

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Tue Nov 24 11:33:30 GMT 2026



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


Commits:
6e3cc0d6 by Emmanuel Bourg at 2026-11-24T12:32:41+01:00
Default to the Java release required by the bundle manifest

- - - - -


2 changed files:

- debian/changelog
- src/ant/build-eclipse-bundle.xml


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+eclipse-debian-helper (1.13) unstable; urgency=medium
+
+  * Default to the Java release required by the bundle manifest
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Tue, 24 Nov 2026 12:32:30 +0100
+
 eclipse-debian-helper (1.12) unstable; urgency=medium
 
   * Exclude the C/C++ sources and the native build scripts from the jars


=====================================
src/ant/build-eclipse-bundle.xml
=====================================
@@ -8,7 +8,7 @@
     <attribute name="shortname" default=""      description="The short name of the bundle (for example eclipse-foo-bar)"/>
     <attribute name="depends" default=""        description="The comma separated list of local bundles used as dependencies"/>
     <attribute name="basedir" default="bundles" description="The base directory holding all the bundles"/>
-    <attribute name="release" default="8"       description="The version of Java targeted"/>
+    <attribute name="release" default=""        description="The version of Java targeted (defaults to the Bundle-RequiredExecutionEnvironment of the manifest, or 8)"/>
     <attribute name="encoding" default="UTF-8"  description="The source encoding"/>
     <attribute name="compilerargs" default=""   description="The extra compiler arguments used to build the bundle"/>
     <element name="bundle-classpath" optional="true" implicit="true" description="The classpath elements required to build the bundle"/>
@@ -24,6 +24,9 @@
           <!-- Extract and clean the bundle version from the manifest -->
           <bundle-version name="@{name}" basedir="@{basedir}" property="bundle.version.@{name}"/>
 
+          <!-- Use the Java release specified, or the one required by the manifest -->
+          <bundle-release name="@{name}" basedir="@{basedir}" release="@{release}" property="bundle.release.@{name}"/>
+
           <propertyregex property="bundle.desc.@{name}" input="${@{name}.Plugin.name}${@{name}.pluginName}${@{name}.bundleName}${@{name}.Bundle-Name}${@{name}.name}" regexp="\$\{[^\$]*\}" replace="" global="true" override="true"/>
 
           <echo>Building bundle '${bundle.desc.@{name}}' (@{name}:${bundle.version.@{name}})</echo>
@@ -62,7 +65,7 @@
           </copy>
 
           <!-- Compile the source files to target/classes -->
-          <javac srcdir="${bundle.dir.@{name}}/target/sources" destdir="${bundle.dir.@{name}}/target/classes" debug="yes" release="@{release}" includeantruntime="false" encoding="@{encoding}">
+          <javac srcdir="${bundle.dir.@{name}}/target/sources" destdir="${bundle.dir.@{name}}/target/classes" debug="yes" release="${bundle.release.@{name}}" includeantruntime="false" encoding="@{encoding}">
             <classpath>
               <fileset dir="." includesfile="${bundle.dir.@{name}}/target/dependencies"/>
               <bundle-classpath/>
@@ -158,4 +161,25 @@
     </sequential>
   </macrodef>
 
+  <!-- Macro setting the Java release of the bundle to the specified property (based on the Bundle-RequiredExecutionEnvironment property of the manifest) -->
+  <macrodef name="bundle-release">
+    <attribute name="name" description="The name of the bundle (for example org.eclipse.foo.bar)"/>
+    <attribute name="basedir" default="bundles"/>
+    <attribute name="release" description="The release explicitly requested, empty to use Bundle-RequiredExecutionEnvironment"/>
+    <attribute name="property"/>
+    <sequential>
+      <property file="@{basedir}/@{name}/META-INF/MANIFEST.MF" prefix="manifest.@{name}"/>
+      <if>
+        <not><equals arg1="@{release}" arg2=""/></not>
+        <then>
+          <property name="@{property}" value="@{release}"/>
+        </then>
+        <else>
+          <propertyregex property="@{property}" input="${manifest.@{name}.Bundle-RequiredExecutionEnvironment}" regexp="(JavaSE|J2SE)-(1\.)?(\d+).*" select="\3"/>
+          <property name="@{property}" value="8"/>
+        </else>
+      </if>
+    </sequential>
+  </macrodef>
+
 </project>



View it on GitLab: https://salsa.debian.org/java-team/eclipse-debian-helper/-/commit/6e3cc0d6c1cea1a18617a07ccab5f69476463297

-- 
View it on GitLab: https://salsa.debian.org/java-team/eclipse-debian-helper/-/commit/6e3cc0d6c1cea1a18617a07ccab5f69476463297
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


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


More information about the pkg-java-commits mailing list