You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/01/02 12:28:19 UTC

[GitHub] asfgit closed pull request #1068: Improve building of platform on JDK11

asfgit closed pull request #1068: Improve building of platform on JDK11
URL: https://github.com/apache/incubator-netbeans/pull/1068
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index 85bbeb3e37..46b752c05e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,7 +37,7 @@ matrix:
         - env: SIGTEST=true COMPILETEST=false RAT=false EOL=true LICENSE=false CV=true RUN_TESTS_JDK8=false RUN_JAVA_TESTS=false
           jdk: oraclejdk8
 
-        - env: OPTS="-quiet -Dpermit.jdk9.builds=true -Dvanilla.javac.exists=true" TARGET="build-platform"
+        - env: OPTS="-quiet" TARGET="build-platform"
           jdk: oraclejdk11
 
         - env: SIGTEST=false COMPILETEST=false RAT=false EOL=false LICENSE=false CV=false RUN_TESTS_JDK9PLUS=false RUN_TESTS_JDK8=true TEST_MODULES="java/java.completion" OPTS="-Dcluster.config=java -quiet build -Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false"
diff --git a/nbbuild/build.xml b/nbbuild/build.xml
index 889f6bc21b..6bb2323ffd 100644
--- a/nbbuild/build.xml
+++ b/nbbuild/build.xml
@@ -46,7 +46,10 @@
     <fail message="You need JDK 8+ to build NetBeans; nbjdk.home=${nbjdk.home} java.home=${java.home}">
         <condition>
             <not>
-                <isset property="have-jdk-1.8"/>
+                <or>
+                    <isset property="have-jdk-1.8"/>
+                    <isset property="have-jdk-1.9"/>
+                </or>
             </not>
         </condition>
     </fail>
@@ -451,6 +454,8 @@ Hg ID:    ${hg.id}
       <mkdir dir="${netbeans.dest.dir}"/>
       <ant dir="." target="-build-platform" inheritAll="false">
           <property name="cluster.config" value="platform"/>
+          <property name="permit.jdk9.builds" value="true"/>
+          <property name="vanilla.javac.exists" value="true"/>
       </ant>
   </target>
 
@@ -460,6 +465,8 @@ Hg ID:    ${hg.id}
           <property name="cluster.config" value="platform"/>
           <property name="test.type" value="test-unit"/>
           <property name="test-unit-sys-prop.ignore.random.failures" value="true"/>
+          <property name="permit.jdk9.builds" value="true"/>
+          <property name="vanilla.javac.exists" value="true"/>
       </ant>
   </target>
   
@@ -1144,6 +1151,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d
 
   <target name="clean" depends="-init-clean,bootstrap" description="Clean everything possible.">
       <taskdef name="try-else" classname="org.netbeans.nbbuild.TryElse" classpath="${nbantext.jar}"/>
+      <property name="vanilla.javac.exists" value="true"/>
       <try-else first="-hg-clean" second="-real-clean"/>
   </target>
 
diff --git a/nbbuild/jdk.xml b/nbbuild/jdk.xml
index 946871a4e1..db47190c9c 100644
--- a/nbbuild/jdk.xml
+++ b/nbbuild/jdk.xml
@@ -96,7 +96,10 @@
                 <available file="${nbjdk.javac}" type="file"/>
                 <available file="${nbjdk.java}" type="file"/>
                 <available file="${nbjdk.javadoc}" type="file"/>
-                <available classname="java.lang.Object" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
+                <or>
+                    <available classname="java.lang.Object" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
+                    <available file="${nbjdk.home}/bin/jmod"/>
+                </or>
             </and>
         </condition>
         <available property="have-jdk-1.4" classname="java.lang.CharSequence" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
@@ -104,7 +107,7 @@
         <available property="have-jdk-1.6" classname="java.util.ServiceLoader" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
         <available property="have-jdk-1.7" classname="java.lang.ReflectiveOperationException" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
         <available property="have-jdk-1.8" classname="java.lang.FunctionalInterface" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
-        <available property="have-jdk-1.9" classname="java.util.zip.CRC32C" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
+        <available property="have-jdk-1.9" file="${nbjdk.home}/bin/jmod"/>
         <echo level="verbose">nbjdk.active=${nbjdk.active} nbjdk.home=${nbjdk.home} nbjdk.java=${nbjdk.java} nbjdk.javac=${nbjdk.javac} nbjdk.javadoc=${nbjdk.javadoc} nbjdk.bootclasspath=${nbjdk.bootclasspath} nbjdk.valid=${nbjdk.valid} have-jdk-1.4=${have-jdk-1.4} have-jdk-1.5=${have-jdk-1.5} have-jdk-1.6=${have-jdk-1.6} have-jdk-1.7=${have-jdk-1.7} have-jdk-1.8=${have-jdk-1.8} have-jdk-1.9=${have-jdk-1.9}</echo>
     </target>
 
diff --git a/nbi/engine/build.xml b/nbi/engine/build.xml
index 2fb096ed9e..69339e9acb 100644
--- a/nbi/engine/build.xml
+++ b/nbi/engine/build.xml
@@ -143,6 +143,8 @@
     <target name="probe" depends="init">
         <available property="probe.javac.source" value="1.6" classname="java.lang.Module"/>
         <available property="probe.javac.target" value="1.6" classname="java.lang.Module"/>
+        <available property="probe.javac.source" value="1.6" file="${nbjdk.home}/bin/jmod"/>
+        <available property="probe.javac.target" value="1.6" file="${nbjdk.home}/bin/jmod"/>
         <property name="probe.javac.source" value="1.3"/>
         <property name="probe.javac.target" value="1.1"/>
         <mkdir dir="${build.classes.dir}/org/netbeans/installer/utils/applications/"/>
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ComponentsTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ComponentsTest.java
index 3267b20143..65cdc51305 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ComponentsTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ComponentsTest.java
@@ -45,7 +45,8 @@ public ComponentsTest() {
         NbResloc.init();
     }
 
-    @Test public void loadSwing() throws Exception {
+    @Test(timeOut = 9000)
+    public void loadSwing() throws Exception {
         CountDownLatch cdl = new CountDownLatch(1);
         JComponent p = TestPages.getSwing(10, cdl);
         JFrame f = new JFrame();
@@ -55,7 +56,8 @@ public ComponentsTest() {
         cdl.await();
     }
 
-    @Test public void loadFX() throws Exception {
+    @Test(timeOut = 9000)
+    public void loadFX() throws Exception {
         final CountDownLatch cdl = new CountDownLatch(1);
         final CountDownLatch done = new CountDownLatch(1);
         final JFXPanel p = new JFXPanel();
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/DialogsTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/DialogsTest.java
index 1af3a51893..aeabecae51 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/DialogsTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/DialogsTest.java
@@ -45,7 +45,7 @@
     public DialogsTest() {
     }
 
-    @BeforeClass
+    @BeforeClass(timeOut = 9000)
     public static void initializeContext() throws Exception {
         final JFXPanel p = new JFXPanel();
         final URL u = DialogsTest.class.getResource("/org/netbeans/api/htmlui/empty.html");
@@ -71,7 +71,8 @@ public void run() {
         f.setVisible(true);
     }
 
-    @Test public void parseButtons() throws Throwable {
+    @Test(timeOut = 9000)
+    public void parseButtons() throws Throwable {
         final Throwable[] ex = { null };
         final JButton[] buttons = { null, null };
         final CountDownLatch done = new CountDownLatch(1);
@@ -122,7 +123,8 @@ public void run() {
         });
     }
     
-    @Test public void noDefinedButtonsMeanOKCancel() throws Throwable {
+    @Test(timeOut = 9000)
+    public void noDefinedButtonsMeanOKCancel() throws Throwable {
         final Throwable[] ex = { null };
         final CountDownLatch done = new CountDownLatch(1);
         ctx.execute(new Runnable() {
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/FreeGeoProviderTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/FreeGeoProviderTest.java
index c1b9123597..1acdde4573 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/FreeGeoProviderTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/FreeGeoProviderTest.java
@@ -41,7 +41,7 @@
     private Position position;
     private Exception error;
 
-    @BeforeClass
+    @BeforeClass(timeOut = 9000)
     public static void initializeContext() throws Exception {
         final JFXPanel p = new JFXPanel();
         final URL u = DialogsTest.class.getResource("/org/netbeans/api/htmlui/empty.html");
@@ -68,7 +68,7 @@ public void run() {
     }
 
 
-    @Test
+    @Test(timeOut = 9000)
     public void checkGeoLocation() throws InterruptedException {
         ctx.execute(new Runnable() {
             @Override
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/HtmlComponentTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/HtmlComponentTest.java
index 6ddda5be35..11e13f9f6b 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/HtmlComponentTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/HtmlComponentTest.java
@@ -46,7 +46,8 @@
     public HtmlComponentTest() {
     }
 
-    @BeforeClass public static void initializeContext() throws Exception {
+    @BeforeClass(timeOut = 9000)
+    public static void initializeContext() throws Exception {
         final HtmlComponent tc = new HtmlComponent();
         final URL u = HtmlComponent.class.getResource("/org/netbeans/api/htmlui/empty.html");
         Platform.runLater(new Runnable() {
@@ -65,7 +66,8 @@ public static Object onLoad() {
         return cc;
     }
     
-    @Test public void updateContext() throws Exception {
+    @Test(timeOut = 9000)
+    public void updateContext() throws Exception {
         CheckContext cc = assertContext();
         
         assertNull(lkp.lookup(DefCnstr.class), "No instance yet");
@@ -77,7 +79,8 @@ public static Object onLoad() {
         assertNull(lkp.lookup(DefCnstr.class), "Disappeared again");
     }
 
-    @Test public void closedWhenRemoved() throws Exception {
+    @Test(timeOut = 9000)
+    public void closedWhenRemoved() throws Exception {
         CheckContext cc = assertContext();
         
         cc.addContext(ClsblCnstr.class.getName());
@@ -91,7 +94,8 @@ public static Object onLoad() {
         assertTrue(inst.closed, "Close has been called on removal");
     }
 
-    @Test public void updateContextWithNonDefaultCnstr() throws Exception {
+    @Test(timeOut = 9000)
+    public void updateContextWithNonDefaultCnstr() throws Exception {
         CheckContext cc = assertContext();
         
         assertNull(lkp.lookup(MdlCnstr.class), "No instance yet");
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/OpenHTMLRegistrationTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/OpenHTMLRegistrationTest.java
index 9df5fc2723..aca0397e74 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/OpenHTMLRegistrationTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/OpenHTMLRegistrationTest.java
@@ -46,7 +46,8 @@ public OpenHTMLRegistrationTest() {
     public static void main() {
     }
     
-    @Test public void verifyRegistered() {
+    @Test(timeOut = 9000)
+    public void verifyRegistered() {
         final String path = "Actions/Test/html-test.instance";
         final FileObject fo = FileUtil.getConfigFile(path);
         assertNotNull(fo, "Registration found");
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromEDTTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromEDTTest.java
index d3cba7a320..4b1387efb8 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromEDTTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromEDTTest.java
@@ -34,7 +34,9 @@
     }
     
     private CountDownLatch cdl;
-    @Test public void showDialog() throws InterruptedException {
+    
+    @Test(timeOut = 9000)
+    public void showDialog() throws InterruptedException {
         cdl = new CountDownLatch(1);
         EventQueue.invokeLater(this);
         cdl.await();
diff --git a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromFXThreadTest.java b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromFXThreadTest.java
index 9caf844153..b67d5ccad9 100644
--- a/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromFXThreadTest.java
+++ b/platform/api.htmlui/test/unit/src/org/netbeans/modules/htmlui/ShowDialogFromFXThreadTest.java
@@ -36,7 +36,8 @@
 public class ShowDialogFromFXThreadTest implements Runnable {
     private volatile boolean returned;
     
-    @BeforeClass public static void initFX() {
+    @BeforeClass(timeOut = 9000)
+    public static void initFX() {
         JFXPanel p = new JFXPanel();
         JFrame f = new JFrame();
         f.getContentPane().add(p);
@@ -49,7 +50,9 @@
     
     
     private volatile CountDownLatch cdl;
-    @Test public void showDialog() throws Exception {
+
+    @Test(timeOut = 9000)
+    public void showDialog() throws Exception {
         cdl = new CountDownLatch(1);
         Platform.runLater(this);
         cdl.await();
diff --git a/platform/applemenu/build.xml b/platform/applemenu/build.xml
index bbed7244f3..a72a0ab74e 100644
--- a/platform/applemenu/build.xml
+++ b/platform/applemenu/build.xml
@@ -28,7 +28,9 @@
         <mkdir dir="${build.dir}/desktop-classes-src" />
         <unzip src="external/applemenu-external-desktop-classes-8.2.zip" dest="${build.dir}/desktop-classes-src"/>
         <mkdir dir="${build.dir}/desktop-classes-classes" />
-        <javac srcdir="${build.dir}/desktop-classes-src" destdir="${build.dir}/desktop-classes-classes" />
+        <javac srcdir="${build.dir}/desktop-classes-src" destdir="${build.dir}/desktop-classes-classes"
+            source="1.8" target="1.8">
+        </javac>
   </target>
 
 </project>
diff --git a/platform/openide.filesystems/test/unit/src/org/openide/filesystems/JarFileSystemHidden.java b/platform/openide.filesystems/test/unit/src/org/openide/filesystems/JarFileSystemHidden.java
index 67cec3b754..23f02ee13f 100644
--- a/platform/openide.filesystems/test/unit/src/org/openide/filesystems/JarFileSystemHidden.java
+++ b/platform/openide.filesystems/test/unit/src/org/openide/filesystems/JarFileSystemHidden.java
@@ -159,7 +159,9 @@ public void testBrokenSignature() throws IOException {
 
         // sign the jar
         try {
-            sun.security.tools.jarsigner.Main.main(new String[]{
+            Class<?> jarSignererMain = Class.forName("sun.security.tools.jarsigner.Main");
+            Method main = jarSignererMain.getMethod("main", String[].class);
+            main.invoke(null, (Object) new String[]{
                 "-keystore", keystoreFile.getAbsolutePath(),
                 "-storepass", "testpass",
                 jarFile.getAbsolutePath(),


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists