Releng : DTP should require Java 8
For Neon, the platform is requiring Java 8. It makes sense to do the
same in DTP as that will simplify the build, which currently requires
multiple versions of JDK. DTP bundles currently specify Java 5, Java 6
or simply don't specify Bundle-RequiredExecutionEnvironment.
This change specifies Java 8 as the required environment for all DTP
bundles and includes enforcement of this in the build. Several classes
also had to be updated as some java.sql interfaces have acquired new
methods in Java 7 and/or 8, which affected implementation of these
interfaces included in DTP. Presumably, these implementation haven't
been working in past releases of DTP if the user happens to run Eclipse
with Java 7 or 8.
Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=479870
diff --git a/plugins/org.eclipse.datatools.enablement.finfo/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.enablement.finfo/META-INF/MANIFEST.MF
index 46baf93..ecb010d 100644
--- a/plugins/org.eclipse.datatools.enablement.finfo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.datatools.enablement.finfo/META-INF/MANIFEST.MF
@@ -6,3 +6,4 @@
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.datatools.enablement.finfo; singleton:=true
Bundle-Version: 1.5.1.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/org.eclipse.datatools.sdk/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.sdk/META-INF/MANIFEST.MF
index e13a35c..c76c71c 100644
--- a/plugins/org.eclipse.datatools.sdk/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.datatools.sdk/META-INF/MANIFEST.MF
@@ -3,6 +3,7 @@
Bundle-Name: DTP SDK Plug-in
Bundle-SymbolicName: org.eclipse.datatools.sdk;singleton:=true
Bundle-Version: 1.7.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
diff --git a/releng.new/build.xml b/releng.new/build.xml
index 0fbacb8..33cf114 100644
--- a/releng.new/build.xml
+++ b/releng.new/build.xml
@@ -112,6 +112,12 @@
</copy>
<!-- Stage 2 -->
+
+ <echo message="Performing source code verification..."/>
+
+ <verify-bundle-required-env source="${build.dir}/staging"/>
+
+ <!-- Stage 3 -->
<delete dir="${build.dir}/packaged_jars" quiet="true"/>
<mkdir dir="${build.dir}/packaged_jars/plugins"/>
@@ -122,7 +128,7 @@
<p2.publish.FeaturesAndBundles location="${build.dir}/packaged_jars"/>
- <!-- Stage 3 -->
+ <!-- Stage 4 -->
<with-target-platform configuration="${configuration.recommended}">
<pde-build build.id="${DSTAMP}" feature="org.eclipse.datatools" eclipse="${.target.platform}" root.dir="${build.dir}/staging"/>
@@ -142,7 +148,7 @@
<zip-dirs source.dir="${build.dir}/repository/features" suffix="jar"/>
- <!-- Stage 4 -->
+ <!-- Stage 5 -->
<for param="jar">
<path>
@@ -155,20 +161,8 @@
</sequential>
</for>
- <!-- Stage 5 -->
-
- <echo message="Packaging the repository..."/>
-
- <property-from-set property=".dtp.feature">
- <fileset dir="${build.dir}/repository/features" includes="org.eclipse.datatools.connectivity.feature_*.jar"/>
- </property-from-set>
-
- <var name="dtp.version" unset="true"/>
- <propertyregex property="dtp.version" input="${.dtp.feature}" regexp=".*_([0-9]*.[0-9]*.[0-9]*.[0-9]*).jar" select="\1"/>
+ <!-- Stage 6 -->
- <var name="dtp.version.no.qualifier" unset="true"/>
- <propertyregex property="dtp.version.no.qualifier" input="${dtp.version}" regexp="([0-9]*.[0-9]*.[0-9]*).[0-9]*" select="\1"/>
-
<copy file="${build.dir}/staging/plugins/org.eclipse.datatools.releng.builder/extras/site.xml" tofile="${build.dir}/repository/site.xml"/>
<replace file="${build.dir}/repository/site.xml">
@@ -206,6 +200,51 @@
</macrodef>
+ <macrodef name="verify-bundle-required-env">
+ <attribute name="source"/>
+ <sequential>
+ <var name=".verify.bundle.required.env.failed" unset="true"/>
+ <for param="file">
+ <path>
+ <fileset dir="@{source}">
+ <include name="**/MANIFEST.MF"/>
+ </fileset>
+ </path>
+ <sequential>
+ <var name=".file.content" unset="true"/>
+ <loadfile property=".file.content" srcfile="@{file}"/>
+ <if>
+ <and>
+ <contains string="${.file.content}" substring="Bundle-SymbolicName" casesensitive="false"/>
+ <not><contains string="${.file.content}" substring="Bundle-RequiredExecutionEnvironment: JavaSE-1.8" casesensitive="false"/></not>
+ </and>
+ <then>
+ <var name=".file.relative" unset="true"/>
+ <pathconvert property=".file.relative">
+ <path location="@{file}"/>
+ <map from="@{source}\" to=""/>
+ <map from="@{source}/" to=""/>
+ <map from="@{source}" to=""/>
+ </pathconvert>
+ <echo message="Missing Bundle-RequiredExecutionEnvironment: ${.file.relative}"/>
+ <var name=".verify.bundle.required.env.failed" value="true"/>
+ </then>
+ </if>
+ </sequential>
+ </for>
+ <if>
+ <istrue value="${.verify.bundle.required.env.failed}"/>
+ <then>
+ <fail message="Found one or more bundles with missing Bundle-RequiredExecutionEnvironment."/>
+ </then>
+ </if>
+ <var name=".file.content" unset="true"/>
+ <var name=".file.relative" unset="true"/>
+ <var name=".verify.bundle.required.env.failed" unset="true"/>
+ </sequential>
+ </macrodef>
+
+
<!--
*************************************************************************************************
* Alternative Configurations Build *
diff --git a/releng.new/releng/ant-library/library.xml b/releng.new/releng/ant-library/library.xml
index 46fc9a3..8f7e255 100644
--- a/releng.new/releng/ant-library/library.xml
+++ b/releng.new/releng/ant-library/library.xml
@@ -113,9 +113,6 @@
<target name="init-jdk" depends="init-library">
- <init-jdk version="5"/>
- <init-jdk version="6"/>
- <init-jdk version="7"/>
<init-jdk version="8"/>
</target>
@@ -404,9 +401,6 @@
<arg value="-DindividualSourceBundles=true"/>
<arg value="-DallowBinaryCycles=true" />
<arg value="-DcompilerArg=${pde.build.compiler.arg}"/>
- <arg value="-DJ2SE-1.5=${java.5.system.classpath}"/>
- <arg value="-DJavaSE-1.6=${java.6.system.classpath}"/>
- <arg value="-DJavaSE-1.7=${java.7.system.classpath}"/>
<arg value="-DJavaSE-1.8=${java.8.system.classpath}"/>
<arg value="-DjavacFailOnError=true"/>
<arg value="-DjavacVerbose=${javacVerbose}"/>