Skip to content

Commit

Permalink
Enable running commit-validation on JDK 8, 11 and 18 and ensure Verif…
Browse files Browse the repository at this point in the history
…ySimpleTemplatesTest is actually ran
  • Loading branch information
matthiasblaesing committed Apr 2, 2022
1 parent 5812c4c commit 7bc17f5
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 66 deletions.
1 change: 0 additions & 1 deletion ergonomics/ide.ergonomics/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ test.config.stableBTD.excludes=\
**/FodDataObjectFactoryTest.class,\
**/FodDataObjectXMLFactoryTest.class,\
**/OpenEditorEnablesEditMenuFactoryTest.class

10 changes: 10 additions & 0 deletions ide/ide.kit/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ test.config.versioning.includes=\

test.timeout=900000
requires.nb.javac=true

test.run.args=-ea -Xmx700m -XX:+IgnoreUnrecognizedVMOptions \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED \
--add-opens=java.desktop/javax.swing=ALL-UNNAMED \
--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED \
--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED \
--add-opens=java.desktop/sun.awt=ALL-UNNAMED \
--add-modules=jdk.jdwp.agent,jdk.attach,jdk.jdi,jdk.jshell,java.compiler,jdk.compiler,jdk.management,jdk.unsupported,jdk.internal.le,jdk.internal.ed,jdk.internal.opt,jdk.internal.jvmstat \
--add-exports=jdk.jdi/com.sun.jdi=ALL-UNNAMED \
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public VerifySimpleTemplatesTest(String name) {
}

public static Test suite() {
String v = System.getProperty("java.version");
if (v == null || !v.startsWith("1.8")) {
return NbModuleSuite.emptyConfiguration().suite();
}

return NbModuleSuite.emptyConfiguration().
clusters("(extide|java).*").
enableModules(".*", ".*").
Expand Down
2 changes: 0 additions & 2 deletions ide/libs.graalsdk/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ release.external/launcher-common-20.3.0.jar=modules/ext/launcher-common-20.3.0.j

javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml

test.run.args=-ea -Xmx700m
6 changes: 6 additions & 0 deletions java/java.hints/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,9 @@ test.config.batch2-vanilla-javac.includes=\

test.config.batch2-vanilla-javac.excludes=\
${vanilla-javac.excludes}

test.run.args=-ea -Xmx700m -XX:+IgnoreUnrecognizedVMOptions \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED \
--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED \
--add-opens=java.desktop/sun.awt=ALL-UNNAMED \
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ extide/gradle/external/gradle-7.4-bin.zip platform/o.apache.commons.codec/extern
extide/gradle/external/gradle-7.4-bin.zip platform/libs.asm/external/asm-9.2.jar
extide/gradle/external/gradle-7.4-bin.zip platform/libs.asm/external/asm-commons-9.2.jar
extide/gradle/external/gradle-7.4-bin.zip platform/libs.asm/external/asm-tree-9.2.jar
extide/gradle/external/gradle-7.4-bin.zip platform/libs.batik.read/external/xml-apis-1.4.01.jar

# These are the endorsed version of the javaee apis and create libraries, so they are better kept separate
enterprise/javaee.api/external/javax.annotation-api-1.2.jar enterprise/javaee7.api/external/javax.annotation-api-1.2.jar
Expand Down
36 changes: 0 additions & 36 deletions nbbuild/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,42 +469,6 @@ metabuild.hash=${metabuild.hash}</echo>
</unzip>
</target>

<target name="-load-module-flags">
<loadfile property="jms-base.flags" srcFile="jms-config/base.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-desktop.flags" srcFile="jms-config/desktop.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-compiler.flags" srcFile="jms-config/compiler.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-tools.flags" srcFile="jms-config/tools.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<property name="metabuild.jms-flags" value="${jms-base.flags}${jms-desktop.flags}${jms-compiler.flags}${jms-tools.flags}"/>
</target>

<target name="finish-build-nb" depends="init,-check-nb-cluster,-download-nb-windows-launchers,-load-module-flags" if="has.nb.cluster">
<loadproperties srcFile="${clusters.list.file}" />

Expand Down
64 changes: 63 additions & 1 deletion nbbuild/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<path id="cluster.path.id" path="${cluster.path.evaluated}"/>
<property name="cluster.path.final" refid="cluster.path.id"/>
</target>

<target name="-do-set-buildnumber" depends="init-tasks" unless="buildnumber">
<tstamp>
<format property="buildstamp" pattern="yyyyMMdd"/>
Expand All @@ -181,9 +181,71 @@
<property name="buildnumber" value="${buildstamp}-${hg.id}"/>
<echo message="Build number : ${buildnumber}" />
</target>

<target name="set-buildnumber" depends="-do-set-buildnumber">
<!-- Overridable. Note: need not necessarily be a number at all): -->
<property name="buildnum" value="dev-${buildnumber}"/>
</target>

<target name="-load-module-flags">
<dirname property="default.basedir" file="${ant.file.default}"/>
<loadfile property="jms-base.flags" srcFile="${default.basedir}/jms-config/base.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-desktop.flags" srcFile="${default.basedir}/jms-config/desktop.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-compiler.flags" srcFile="${default.basedir}/jms-config/compiler.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-tools.flags" srcFile="${default.basedir}/jms-config/tools.flags">
<filterchain>
<tokenfilter>
<replaceregex pattern="--" replace=" -J--" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-base.flags.jvm" srcFile="${default.basedir}/jms-config/base.flags">
<filterchain>
<suffixlines suffix=" "/>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-desktop.flags.jvm" srcFile="${default.basedir}/jms-config/desktop.flags">
<filterchain>
<suffixlines suffix=" "/>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-compiler.flags.jvm" srcFile="${default.basedir}/jms-config/compiler.flags">
<filterchain>
<suffixlines suffix=" "/>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile property="jms-tools.flags.jvm" srcFile="${default.basedir}/jms-config/tools.flags">
<filterchain>
<suffixlines suffix=" "/>
<striplinebreaks/>
</filterchain>
</loadfile>
<property name="metabuild.jms-flags" value="${jms-base.flags}${jms-desktop.flags}${jms-compiler.flags}${jms-tools.flags}"/>
<property name="metabuild.jms-flags.jvm" value="${jms-base.flags.jvm}${jms-desktop.flags.jvm}${jms-compiler.flags.jvm}${jms-tools.flags.jvm}"/>
</target>
</project>
33 changes: 33 additions & 0 deletions nbbuild/jdk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@
</or>
</and>
</condition>

<exec executable="${nbjdk.home}/bin/java" outputproperty="nbjdk.versioninfo">
<arg value="-version" />
</exec>

<condition property="nbjdk.enable_security_manager" value="-Djava.security.manager=allow" else="">
<not>
<or>
<matches pattern=".*version &quot;1\.8\.?.*" string="${nbjdk.versioninfo}" />
<matches pattern=".*version &quot;9(&quot;|\.).*" string="${nbjdk.versioninfo}" />
<matches pattern=".*version &quot;10(&quot;|\.).*" string="${nbjdk.versioninfo}" />
<matches pattern=".*version &quot;11(&quot;|\.).*" string="${nbjdk.versioninfo}" />
</or>
</not>
</condition>

<available property="have-jdk-1.4" classname="java.lang.CharSequence" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.5" classname="java.lang.StringBuilder" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.6" classname="java.util.ServiceLoader" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
Expand Down Expand Up @@ -206,7 +222,24 @@
</condition>

<!-- Fallback? -->

<property name="nbjdk.home" location="${java.home}"/>

<exec executable="${nbjdk.home}/bin/java" outputproperty="nbjdk.versioninfo">
<arg value="-version" />
</exec>

<condition property="nbjdk.enable_security_manager" value="-Djava.security.manager=allow" else="">
<not>
<or>
<matches pattern=".*version &quot;1\.8\.?.*" string="${nbjdk.versioninfo}" />
<matches pattern=".*version &quot;9(&quot;|\.).*" string="${nbjdk.versioninfo}" />
<matches pattern=".*version &quot;10(&quot;|\.).*" string="${nbjdk.versioninfo}" />
<matches pattern=".*version &quot;11(&quot;|\.).*" string="${nbjdk.versioninfo}" />
</or>
</not>
</condition>

<available property="have-jdk-1.4" classname="java.lang.CharSequence"/>
<available property="have-jdk-1.5" classname="java.lang.StringBuilder"/>
<available property="have-jdk-1.6" classname="java.util.ServiceLoader"/>
Expand Down
25 changes: 13 additions & 12 deletions nbbuild/templates/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<!--needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
<formatter type="brief" usefile="false"/>
Expand Down Expand Up @@ -780,6 +781,7 @@
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
</testng>
Expand Down Expand Up @@ -853,6 +855,7 @@
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${run.args.ide}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
</junit>
Expand Down Expand Up @@ -882,6 +885,7 @@
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
</testng>
Expand Down Expand Up @@ -911,6 +915,7 @@
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
</testng>
Expand Down Expand Up @@ -954,6 +959,7 @@
<java fork="true" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" jvm="${test.nbjdk.java}">
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=${jpda.address}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<classpath>
<path refid="test.@{test.type}.run.cp"/>
<fileset dir="${ant.home}" includes="patches/*.jar"/>
Expand Down Expand Up @@ -989,6 +995,7 @@
<java classname="org.testng.TestNG" fork="true" jvm="${test.nbjdk.java}">
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=${jpda.address}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<classpath refid="test.@{test.type}.run.cp"/>
Expand All @@ -1001,18 +1008,6 @@
<arg line="-testname ${test.class}"/>
<arg line="${testng.args.line}"/>
</java>
<!--
<taskdef name="testng" classname="org.testng.TestNGAntTask" classpathref="test.@{test.type}.run.cp"/>
<testng mode="mixed" methods="${testng.methods}" failureProperty="tests.failed" outputdir="${build.test.@{test.type}.results.dir}" workingDir="${build.test.@{test.type}.results.dir}">
<classfileset dir="${build.test.@{test.type}.classes.dir}" excludes="${test.excludes}" includes="**/*Test.class"/>
<propertyset refid="test.@{test.type}.properties"/>
<classpath refid="test.@{test.type}.run.cp"/>
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=${jpda.address}"/>
</testng>
-->
</sequential>
</macrodef>
<testng-impl test.type="${test.type}"/>
Expand All @@ -1038,6 +1033,7 @@
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=${jpda.address}"/>
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
Expand Down Expand Up @@ -1099,6 +1095,7 @@
<classpath refid="test.@{test.type}.run.cp"/>
<syspropertyset refid="test.@{test.type}.properties"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${run.jvmargs.ide}"/>
Expand Down Expand Up @@ -1130,6 +1127,7 @@
<jvmarg value="${test.bootclasspath.prepend.args}"/>
<jvmarg line="${test.insane.prepend.args}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<!-- needed to have tests NOT to steal focus when running, works in latest apple jdk update only.-->
<sysproperty key="apple.awt.UIElement" value="@{disable.apple.ui}"/>
</testng>
Expand All @@ -1151,6 +1149,7 @@
<classpath refid="test.@{test.type}.run.cp"/>
<syspropertyset refid="test.@{test.type}.properties"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<jvmarg line="${run.args.ide}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<customize/>
Expand All @@ -1172,6 +1171,7 @@
<java fork="true" classname="${main.class}">
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=${jpda.address}"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<classpath refid="test.@{test.type}.run.cp"/>
<syspropertyset refid="test.@{test.type}.properties"/>
<customize/>
Expand Down Expand Up @@ -1254,6 +1254,7 @@
<jvmarg line="${test.insane.prepend.args}"/>
<syspropertyset refid="test.@{test.type}.properties"/>
<jvmarg line="${test.run.args}"/>
<jvmarg line="${nbjdk.enable_security_manager}" />
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
</junit>
Expand Down
9 changes: 2 additions & 7 deletions nbbuild/templates/projectized.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<!-- When requires.nb.javac property is true, prepend javac-api and javac-impl on bootclasspath to allow override the default annotation
processing API located in rt.jar. -->
</target>
<target name="build-init" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task,-init-bootclasspath-prepend">
<target name="build-init" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task,-init-bootclasspath-prepend,-load-module-flags">
<property name="public.package.jar.dir" location="${nb.build.dir}/public-package-jars"/>
<mkdir dir="${public.package.jar.dir}"/>
<parseprojectxml
Expand Down Expand Up @@ -289,12 +289,7 @@
</target>
<target name="test-lib-init" depends="-init-bootclasspath-prepend,init,-build-libs.junit4">
<path id="test.unit.lib.cp"/>
<!-- The IDE is so big that anything enabling all clusters will exceed the JVM's defaults! -->
<!-- Any changes please propagate into nbbuild/testdist/release/one-module.xml test.run.args property -->
<condition property="test.run.args" value="-ea -Xmx480m">
<istrue value="${have-jdk-1.8}"/>
</condition>
<property name="test.run.args" value="-ea -Xmx480m"/>
<property name="test.run.args" value="-ea -Xmx700m ${metabuild.jms-flags.jvm} -XX:+IgnoreUnrecognizedVMOptions"/>
<property name="extra.test.libs.dir" location="${test.dist.dir}/extralibs"/>
<macrodef name="test-init-nborg">
<attribute name="test.type"/>
Expand Down
1 change: 1 addition & 0 deletions platform/libs.batik.read/external/binaries-list
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ F39A410E0CB936D0538C4A7411E1AE45C0D0A10A org.apache.xmlgraphics:batik-script:1.1
916C216454503413ED4FC76DBFAC55B30BBCAE2B org.apache.xmlgraphics:batik-svg-dom:1.14
7CA55C864E5DDD690BA07F44E3BA8E68E9048A02 org.apache.xmlgraphics:batik-util:1.14
B78B3E2F87579F02DCC342A147017CCE8FC0FFC6 org.apache.xmlgraphics:batik-xml:1.14
3789D9FADA2D3D458C4BA2DE349D48780F381EE3 xml-apis:xml-apis:1.4.01
41A8B86B358E87F3F13CF46069721719105AFF66 xml-apis:xml-apis-ext:1.3.04
8779B8D8F426F24FDB4A512F8BC4248CB3775BD2 org.apache.xmlgraphics:xmlgraphics-commons:2.6

Loading

0 comments on commit 7bc17f5

Please sign in to comment.