Skip to content
Commits on Source (7)
eclipse-debian-helper (1.0.1) UNRELEASED; urgency=medium
eclipse-debian-helper (1.1) unstable; urgency=medium
* Fixed the classpath when depending on other bundles
* Include the resources from all source directories and not only src/
* Set the source encoding to UTF-8 when compiling
* Added eclipse-osgi.jar to the default classpath
* Make the targeted Java release configurable
-- Emmanuel Bourg <ebourg@apache.org> Wed, 11 Jul 2018 19:55:47 +0200
-- Emmanuel Bourg <ebourg@apache.org> Wed, 15 Aug 2018 23:57:04 +0200
eclipse-debian-helper (1.0) unstable; urgency=medium
......
......@@ -7,6 +7,7 @@
<attribute name="name" description="The name of the bundle (for example org.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"/>
<element name="bundle-classpath" optional="true" implicit="true" description="The classpath elements required to build the bundle"/>
<sequential>
<if>
......@@ -18,23 +19,31 @@
<property file="${bundle.dir.@{name}}/plugin.properties" prefix="@{name}"/>
<!-- Extract and clean the bundle version from the manifest -->
<property file="${bundle.dir.@{name}}/META-INF/MANIFEST.MF" prefix="manifest.@{name}"/>
<propertyregex property="bundle.version.@{name}" input="${manifest.@{name}.Bundle-Version}" regexp="(.*)\.qualifier" select="\1"/>
<bundle-version name="@{name}" basedir="@{basedir}" property="bundle.version.@{name}"/>
<propertyregex property="bundle.desc.@{name}" input="${@{name}.pluginName}${@{name}.bundleName}" regexp="\$\{.*\}" replace="" global="true" override="true"/>
<echo>Building bundle '${bundle.desc.@{name}}' (@{name}:${bundle.version.@{name}})</echo>
<!-- Build the sources -->
<!-- Prepare the dependencies classpath -->
<mkdir dir="${bundle.dir.@{name}}/target/classes"/>
<touch file="${bundle.dir.@{name}}/target/dependencies"/>
<concat destfile="${bundle.dir.@{name}}/target/dependencies" append="true">non/existent/path/${line.separator}</concat>
<for list="@{depends}" param="dependency">
<sequential>
<if>
<equals arg1="@{basedir}" arg2="." />
<then>
<concat destfile="${bundle.dir.@{name}}/target/dependencies" append="true">@{dependency}/target/@{dependency}.jar${line.separator}</concat>
</then>
<else>
<concat destfile="${bundle.dir.@{name}}/target/dependencies" append="true">@{basedir}/@{dependency}/target/@{dependency}.jar${line.separator}</concat>
</else>
</if>
</sequential>
</for>
<!-- Copy the source files to target/sources. Source directories are defined in build.properties -->
<var name="sourcedirs.@{name}" value=""/>
<for list="${@{name}.source..}" param="srcdir">
<sequential>
......@@ -48,8 +57,10 @@
<multirootfileset basedirs="${sourcedirs.@{name}}" includes="**/*.java"/>
</copy>
<javac srcdir="${bundle.dir.@{name}}/target/sources" destdir="${bundle.dir.@{name}}/target/classes" debug="yes" release="8" includeantruntime="false">
<!-- 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="UTF-8">
<classpath>
<pathelement path="/usr/share/java/eclipse-osgi.jar"/>
<pathelement path="/usr/share/java/org.eclipse.osgi.jar"/>
<pathelement path="/usr/share/java/osgi.compendium.jar"/>
<fileset dir="." includesfile="${bundle.dir.@{name}}/target/dependencies"/>
......@@ -57,7 +68,7 @@
</classpath>
</javac>
<!-- Copy the resources -->
<!-- Copy the resources to target/classes -->
<copy todir="${bundle.dir.@{name}}/target/classes" quiet="true">
<multirootfileset basedirs="${sourcedirs.@{name}}" excludes="**/*.java,**/package.html"/>
<fileset dir="${bundle.dir.@{name}}" includes="${@{name}.bin.includes}"/>
......@@ -104,4 +115,15 @@
</sequential>
</macrodef>
<!-- Macro setting the version of the bundle to the specified property -->
<macrodef name="bundle-version">
<attribute name="name" description="The name of the bundle (for example org.eclipse.foo.bar)"/>
<attribute name="basedir" default="bundles"/>
<attribute name="property"/>
<sequential>
<property file="@{basedir}/@{name}/META-INF/MANIFEST.MF" prefix="manifest.@{name}"/>
<propertyregex property="@{property}" input="${manifest.@{name}.Bundle-Version}" regexp="(.*)\.qualifier" select="\1"/>
</sequential>
</macrodef>
</project>