To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 059f38ed authored by Rui  Chen's avatar Rui Chen
Browse files

Make Dacapo works when default Java is Java 8

parent 37fab418
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
<target name="unpack" depends="unzip"/> <target name="unpack" depends="unzip"/>
<target name="bm-build"> <target name="bm-build">
<ant antfile="build.xml" dir="${batik-top}" target="all-jar" inheritall="false"> <exec executable="${ant.home}/bin/ant" dir="${batik-top}" failonerror="yes">
<property name="debug" value="on"/> <arg line="all-jar"/>
</ant> <arg line="-Ddebug=on"/>
<env key="JAVA_HOME" value="${jdk16home}"/>
</exec>
</target> </target>
<target name="jar" depends="deps"> <target name="jar" depends="deps">
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<include name="**/${workspace-full}.zip"/> <include name="**/${workspace-full}.zip"/>
</fileset> </fileset>
</unzip> </unzip>
<!-- Create two complimentary zips for default and large workspaces --> <!--Create two complimentary zips for default and large workspaces-->
<zip destfile="${bm-build-dir}/${workspace-default}.zip" basedir="${bm-build-dir}/eclipse-testing/workspace"> <zip destfile="${bm-build-dir}/${workspace-default}.zip" basedir="${bm-build-dir}/eclipse-testing/workspace">
<patternset includesfile="${bm-files}/bundles-default.lst"/> <patternset includesfile="${bm-files}/bundles-default.lst"/>
</zip> </zip>
...@@ -83,12 +83,16 @@ ...@@ -83,12 +83,16 @@
<!-- build the eclipse plugin, which is necessary to fire up eclipse from within our harness --> <!-- build the eclipse plugin, which is necessary to fire up eclipse from within our harness -->
<target name="plugin" depends="unpack"> <target name="plugin" depends="unpack">
<ant antfile="build.xml" dir="${bm-files}/plugin" inheritall="false"> <exec executable="${ant.home}/bin/ant" dir="${bm-files}/plugin" failonerror="yes">
<property name="plugin.destination" location="${bm-build-dir}/eclipse/plugins/"/> <arg line="clean"/>
<target name="clean"/> <arg line="-Dplugin.destination=${bm-build-dir}/eclipse/plugins/"/>
<target name="build.update.jar"/> <env key="JAVA_HOME" value="${jdk16home}"/>
</ant> </exec>
<!-- add our bundle to the configurator metadata --> <exec executable="${ant.home}/bin/ant" dir="${bm-files}/plugin" failonerror="yes">
<arg line="build.update.jar"/>
<arg line="-Dplugin.destination=${bm-build-dir}/eclipse/plugins/"/>
<env key="JAVA_HOME" value="${jdk16home}"/>
</exec>
<patch patchfile="${bm-files}/eclipse.patch" dir="${bm-build-dir}" strip="1"/> <patch patchfile="${bm-files}/eclipse.patch" dir="${bm-build-dir}" strip="1"/>
</target> </target>
...@@ -104,6 +108,7 @@ ...@@ -104,6 +108,7 @@
<fileset dir="${bm-build-dir}" includesfile="${bm-files}/bundles-stub-required.lst"/> <fileset dir="${bm-build-dir}" includesfile="${bm-files}/bundles-stub-required.lst"/>
</touch> </touch>
--> -->
<unzip dest="${bm-build-dir}/" src="${bm-data}/dummyjre.zip"/>
<!-- Install the test data --> <!-- Install the test data -->
<zip destfile="${bm-dat}/${bm-name}.zip" basedir="${bm-build-dir}" excludes="eclipse/plugins/**"> <zip destfile="${bm-dat}/${bm-name}.zip" basedir="${bm-build-dir}" excludes="eclipse/plugins/**">
...@@ -113,4 +118,5 @@ ...@@ -113,4 +118,5 @@
<fileset dir="${bm-build-dir}" includesfile="${bm-files}/bundles-stub-required.lst"/> <fileset dir="${bm-build-dir}" includesfile="${bm-files}/bundles-stub-required.lst"/>
</zip> </zip>
</target> </target>
</project> </project>
...@@ -95,6 +95,8 @@ public class Eclipse extends Benchmark { ...@@ -95,6 +95,8 @@ public class Eclipse extends Benchmark {
System.setProperty("osgi.install.area", "file:" + fileInScratch("eclipse/")); System.setProperty("osgi.install.area", "file:" + fileInScratch("eclipse/"));
System.setProperty("osgi.noShutdown", "true"); System.setProperty("osgi.noShutdown", "true");
System.setProperty("osgi.framework", "file:" + fileInScratch(OSGI_BOOTSTRAP_JAR)); System.setProperty("osgi.framework", "file:" + fileInScratch(OSGI_BOOTSTRAP_JAR));
String current_working_dir = System.getProperty("user.dir");
System.setProperty("dacapo.local.jre", current_working_dir + "/" + fileInScratch("jre/lib/rt.jar"));
setJavaHomeIfRequired(); setJavaHomeIfRequired();
String[] args = new String[4]; String[] args = new String[4];
......
...@@ -347,23 +347,29 @@ public abstract class FullSourceWorkspaceTests { ...@@ -347,23 +347,29 @@ public abstract class FullSourceWorkspaceTests {
} }
} }
// Create lib entries for the JDKs // Create lib entries for the JDKs
String jreLibPath = JavaCore.getClasspathVariable("JRE_LIB").toOSString(); String jreLibPath = JavaCore.getClasspathVariable("JRE_LIB").toOSString();
String tempPath = System.getProperty("dacapo.local.jre");
String[] jdkLibs = Util.getJavaClassLibs(); String[] jdkLibs = Util.getJavaClassLibs();
int jdkLibsLength = jdkLibs.length; int jdkLibsLength = jdkLibs.length;
IClasspathEntry[] jdkEntries = new IClasspathEntry[jdkLibsLength]; IClasspathEntry[] jdkEntries = new IClasspathEntry[jdkLibsLength + 1];
int jdkEntriesCount = 0; int jdkEntriesCount = 0;
for (int i = 0; i < jdkLibsLength; i++) { for (int i = 0; i < jdkLibsLength; i++) {
if (!jdkLibs[i].equals(jreLibPath)) { // do not include JRE_LIB in if (!jdkLibs[i].equals(jreLibPath)) { // do not include JRE_LIB in
// additional JDK entries // additional JDK entries
jdkEntries[jdkEntriesCount++] = JavaCore.newLibraryEntry(new Path(jdkLibs[i]), null, null); jdkEntries[jdkEntriesCount++] = JavaCore.newLibraryEntry(new Path(jdkLibs[i]), null, null);
} }
} }
jdkEntries[jdkEntriesCount++] = JavaCore.newLibraryEntry(new Path(tempPath), null, null);
// Set classpaths (workaround bug 73253 Project references not set on // Set classpaths (workaround bug 73253 Project references not set on
// project open) // project open)
ALL_PROJECTS = JavaCore.create(workspaceRoot).getJavaProjects(); ALL_PROJECTS = JavaCore.create(workspaceRoot).getJavaProjects();
int projectsLength = ALL_PROJECTS.length; int projectsLength = ALL_PROJECTS.length;
for (int i = 0; i < projectsLength; i++) { for (int i = 0; i < projectsLength; i++) {
String projectName = ALL_PROJECTS[i].getElementName(); String projectName = ALL_PROJECTS[i].getElementName();
if (BIG_PROJECT_NAME.equals(projectName)) if (BIG_PROJECT_NAME.equals(projectName))
...@@ -384,6 +390,7 @@ public abstract class FullSourceWorkspaceTests { ...@@ -384,6 +390,7 @@ public abstract class FullSourceWorkspaceTests {
} catch (CoreException jme) { } catch (CoreException jme) {
// skip name collision as it means that JRE lib were already set on the // skip name collision as it means that JRE lib were already set on the
// classpath // classpath
System.out.println("errors in here");
if (jme.getStatus().getCode() != IJavaModelStatusConstants.NAME_COLLISION) { if (jme.getStatus().getCode() != IJavaModelStatusConstants.NAME_COLLISION) {
throw jme; throw jme;
} }
......
...@@ -14,7 +14,10 @@ import java.io.Writer; ...@@ -14,7 +14,10 @@ import java.io.Writer;
import java.sql.Connection; import java.sql.Connection;
import java.sql.Driver; import java.sql.Driver;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Logger;
import javax.sql.DataSource; import javax.sql.DataSource;
...@@ -82,6 +85,10 @@ public class TPCCDataSource implements DataSource { ...@@ -82,6 +85,10 @@ public class TPCCDataSource implements DataSource {
return null; return null;
} }
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new UnsupportedOperationException();
}
private class NullWriter extends Writer { private class NullWriter extends Writer {
public void close() throws IOException { public void close() throws IOException {
......
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
<copy todir="${bm-build-dir}/src/java"> <copy todir="${bm-build-dir}/src/java">
<fileset file="${bm-build-dir}/build.*"/> <fileset file="${bm-build-dir}/build.*"/>
</copy> </copy>
<ant antfile="build.xml" dir="${bm-build-dir}" inheritall="false"/> <exec executable="${ant.home}/bin/ant" dir="${bm-build-dir}" failonerror="yes">
<env key="JAVA_HOME" value="${jdk16home}"/>
</exec>
</target> </target>
<target name="jar"> <target name="jar">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</target> </target>
<target name="copy-data"> <target name="copy-data">
<delete dir="${bm-data}/lusearchFix"/> <mkdir dir="${bm-data}/lusearchFix"/>
<copy todir="${bm-data}/lusearchFix"> <copy todir="${bm-data}/lusearchFix">
<fileset dir="bms/lusearch/data/lusearch"> <fileset dir="bms/lusearch/data/lusearch">
<include name="**"/> <include name="**"/>
...@@ -45,8 +45,9 @@ ...@@ -45,8 +45,9 @@
</copy> </copy>
</target> </target>
<target name="data" if="bm-data-exists" depends="copy-data"> <target name="data" depends="copy-data">
<zip basedir="${bm-data}" includes="**" destfile="${bm-dat}/${bm-name}.zip"/> <zip basedir="${bm-data}" includes="**" destfile="${bm-dat}/${bm-name}.zip"/>
<delete dir="${bm-data}"/>
</target> </target>
</project> </project>
...@@ -26,11 +26,16 @@ ...@@ -26,11 +26,16 @@
<target name="unpack" depends="untar,patch"/> <target name="unpack" depends="untar,patch"/>
<target name="bm-build" depends="build-properties,commons-httpclient,dacapo-digest"> <target name="bm-build" depends="build-properties,commons-httpclient,dacapo-digest">
<ant antfile="build.xml" inheritall="false" dir="${bm-build-top}"> <exec executable="${ant.home}/bin/ant" dir="${bm-build-top}" failonerror="yes">
<property name="base.path" value="${bm-downloads}"/> <env key="JAVA_HOME" value="${jdk16home}"/>
<target name="download"/> <arg line="download"/>
<target name="deploy"/> <arg line="-Dbase.path=${bm-downloads}"/>
</ant> </exec>
<exec executable="${ant.home}/bin/ant" dir="${bm-build-top}" failonerror="yes">
<env key="JAVA_HOME" value="${jdk16home}"/>
<arg line="deploy"/>
<arg line="-Dbase.path=${bm-downloads}"/>
</exec>
<ant antfile="dist.xml" inheritall="false" dir="${bm-build-top}"> <ant antfile="dist.xml" inheritall="false" dir="${bm-build-top}">
<property name="base.path" value="${bm-downloads}"/> <property name="base.path" value="${bm-downloads}"/>
<target name="dist-static"/> <target name="dist-static"/>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<property name="lib-build-top" value="${lib-build-dir}/${lib-name}-${lib-version}"/> <property name="lib-build-top" value="${lib-build-dir}/${lib-name}-${lib-version}"/>
<target name="unpack" depends="untar"/> <target name="unpack" depends="untar, patch"/>
<target name="build"> <target name="build">
<ant antfile="build.xml" dir="${lib-build-top}" inheritAll="false"> <ant antfile="build.xml" dir="${lib-build-top}" inheritAll="false">
......
...@@ -267,21 +267,21 @@ ...@@ -267,21 +267,21 @@
<!-- build required plugins --> <!-- build required plugins -->
<exec executable="${mvn}" dir="${lib-build-dir}/plugins/j2ee" failonerror="yes" failifexecutionfails="yes"> <exec executable="${mvn}" dir="${lib-build-dir}/plugins/j2ee" failonerror="yes" failifexecutionfails="yes">
<env key="JAVA_HOME" path="${j16lib}"/> <env key="JAVA_HOME" path="${jdk16home}"/>
</exec> </exec>
<exec executable="${mvn}" dir="${lib-build-dir}/plugins/client" failonerror="yes" failifexecutionfails="yes"> <exec executable="${mvn}" dir="${lib-build-dir}/plugins/client" failonerror="yes" failifexecutionfails="yes">
<env key="JAVA_HOME" path="${j16lib}"/> <env key="JAVA_HOME" path="${jdk16home}"/>
</exec> </exec>
<exec executable="${mvn}" dir="${lib-build-dir}/plugins/cxf" failonerror="yes" failifexecutionfails="yes"> <exec executable="${mvn}" dir="${lib-build-dir}/plugins/cxf" failonerror="yes" failifexecutionfails="yes">
<env key="JAVA_HOME" path="${j16lib}"/> <env key="JAVA_HOME" path="${jdk16home}"/>
</exec> </exec>
<exec executable="${mvn}" dir="${lib-build-dir}/plugins/axis" failonerror="yes" failifexecutionfails="yes"> <exec executable="${mvn}" dir="${lib-build-dir}/plugins/axis" failonerror="yes" failifexecutionfails="yes">
<env key="JAVA_HOME" path="${j16lib}"/> <env key="JAVA_HOME" path="${jdk16home}"/>
</exec> </exec>
<!-- build daytrader --> <!-- build daytrader -->
<exec executable="${mvn}" dir="${dt-build}"> <exec executable="${mvn}" dir="${dt-build}">
<env key="JAVA_HOME" path="${j16lib}"/> <env key="JAVA_HOME" path="${jdk16home}"/>
<env key="PATH" path="${env.PATH}:${toolsdir}/apache-maven-${mvn.version}/bin:${JAVA_HOME}/bin"/> <env key="PATH" path="${env.PATH}:${toolsdir}/apache-maven-${mvn.version}/bin:${JAVA_HOME}/bin"/>
<env key="GERONIMO_HOME" value="${ger-home}"/> <env key="GERONIMO_HOME" value="${ger-home}"/>
<!-- <env key="PATH" path="${env.PATH}:${mvn-home}"/> --> <!-- <env key="PATH" path="${env.PATH}:${mvn-home}"/> -->
...@@ -361,6 +361,7 @@ ...@@ -361,6 +361,7 @@
<target name="start-geronimo"> <target name="start-geronimo">
<echo message="${ger-home}/bin/${gsh-exe}"/> <echo message="${ger-home}/bin/${gsh-exe}"/>
<exec executable="${ger-home}/bin/${gsh-exe}" dir="${ger-home}" spawn="true"> <exec executable="${ger-home}/bin/${gsh-exe}" dir="${ger-home}" spawn="true">
<env key="JAVA_HOME" value="${jdk16home}"/>
<env key="GERONIMO_HOME" path="${ger-home}"/> <env key="GERONIMO_HOME" path="${ger-home}"/>
<arg value="-c"/> <arg value="-c"/>
<arg value="geronimo/start-server"/> <arg value="geronimo/start-server"/>
...@@ -374,6 +375,7 @@ ...@@ -374,6 +375,7 @@
</target> </target>
<target name="stop-geronimo"> <target name="stop-geronimo">
<exec executable="${ger-home}/bin/${gsh-exe}" dir="${ger-home}" spawn="false"> <exec executable="${ger-home}/bin/${gsh-exe}" dir="${ger-home}" spawn="false">
<env key="JAVA_HOME" value="${jdk16home}"/>
<env key="GERONIMO_HOME" path="${ger-home}"/> <env key="GERONIMO_HOME" path="${ger-home}"/>
<arg value="-c"/> <arg value="-c"/>
<arg value="geronimo/stop-server -u system -w manager"/> <arg value="geronimo/stop-server -u system -w manager"/>
...@@ -381,6 +383,7 @@ ...@@ -381,6 +383,7 @@
</target> </target>
<target name="deploy"> <target name="deploy">
<exec executable="${ger-home}/bin/${gsh-exe}"> <exec executable="${ger-home}/bin/${gsh-exe}">
<env key="JAVA_HOME" value="${jdk16home}"/>
<env key="GERONIMO_HOME" path="${ger-home}"/> <env key="GERONIMO_HOME" path="${ger-home}"/>
<arg value="-c"/> <arg value="-c"/>
<arg value="deploy/install-plugin -u system -w manager ${deploy-subject}"/> <arg value="deploy/install-plugin -u system -w manager ${deploy-subject}"/>
...@@ -388,6 +391,7 @@ ...@@ -388,6 +391,7 @@
</target> </target>
<target name="undeploy"> <target name="undeploy">
<exec executable="${ger-home}/bin/${gsh-exe}"> <exec executable="${ger-home}/bin/${gsh-exe}">
<env key="JAVA_HOME" value="${jdk16home}"/>
<env key="GERONIMO_HOME" path="${ger-home}"/> <env key="GERONIMO_HOME" path="${ger-home}"/>
<arg value="-c"/> <arg value="-c"/>
<arg value="deploy/undeploy -u system -w manager ${deploy-subject}"/> <arg value="deploy/undeploy -u system -w manager ${deploy-subject}"/>
......
...@@ -29,11 +29,16 @@ ...@@ -29,11 +29,16 @@
<include name="*.jar"/> <include name="*.jar"/>
</fileset> </fileset>
</copy> </copy>
<ant antfile="build.xml" inheritall="false" dir="${lib-build-top}"> <exec executable="${ant.home}/bin/ant" dir="${lib-build-top}" failonerror="yes">
<property name="j16lib" value="${j16lib}"/> <arg line="all"/>
<target name="all"/> <arg line="-Dj16lib=${j16lib}"/>
<target name="buildjars"/> <env key="JAVA_HOME" value="${jdk16home}"/>
</ant> </exec>
<exec executable="${ant.home}/bin/ant" dir="${lib-build-top}" failonerror="yes">
<arg line="buildjars"/>
<arg line="-Dj16lib=${j16lib}"/>
<env key="JAVA_HOME" value="${jdk16home}"/>
</exec>
</target> </target>
<target name="jar"> <target name="jar">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment