From 4e71f9b6974f1010b557cce164fc90be29a3a7ba Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Thu, 29 Dec 2022 17:42:43 +0100 Subject: [PATCH 01/18] Upgrading to NetBeans 16. --- .travis.yml | 4 ++-- cmdline/README.md | 4 ++-- cmdline/build.xml | 2 +- cmdline/maven/pom.xml | 2 +- .../netbeans/modules/jackpot30/maven/RunJackpot30Test.java | 2 +- cmdline/maven/tests/fail-on-warnings/golden | 2 +- cmdline/maven/tests/sl-failure/golden | 2 +- cmdline/tool/scripts/pom.xml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2555715..d2e3dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ addons: jdk: - openjdk8 before_script: - - wget 'https://downloads.apache.org/netbeans/netbeans/13/netbeans-13-bin.zip' -O /tmp/netbeans-13-bin.zip - - (cd $HOME; unzip /tmp/netbeans-13-bin.zip) + - wget 'https://dlcdn.apache.org/netbeans/netbeans/16/netbeans-16-bin.zip' -O /tmp/netbeans-16-bin.zip + - (cd $HOME; unzip /tmp/netbeans-16-bin.zip) - unset _JAVA_OPTIONS script: - export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 diff --git a/cmdline/README.md b/cmdline/README.md index 99a76a5..a23aae5 100644 --- a/cmdline/README.md +++ b/cmdline/README.md @@ -27,7 +27,7 @@ This tool allows to run NetBeans Java code checker without the NetBeans IDE. Thi #### To Build -* Apache NetBeans 13.0 +* Apache NetBeans 16.0 * JDK 8, JDK 11 and JDK 17 * bash * Apache ant 1.9.9 or above @@ -42,7 +42,7 @@ This tool allows to run NetBeans Java code checker without the NetBeans IDE. Thi Build using: ``` -$ ant -DNETBEANS_PLATFORM= -DJDK11= -DJDK17= build-and-test +$ ant -DNETBEANS_PLATFORM= -DJDK11= -DJDK17= build-and-test ``` The built product is in tool/build/jackpot. diff --git a/cmdline/build.xml b/cmdline/build.xml index c11008a..a3a6512 100644 --- a/cmdline/build.xml +++ b/cmdline/build.xml @@ -52,7 +52,7 @@ - + diff --git a/cmdline/maven/pom.xml b/cmdline/maven/pom.xml index 1b7c813..40a7874 100644 --- a/cmdline/maven/pom.xml +++ b/cmdline/maven/pom.xml @@ -21,7 +21,7 @@ org.apache.netbeans.modules.jackpot30 jackpot30-maven-plugin - 13.0 + 16.0 maven-plugin Jackpot 3.0 Command Line Tool Maven Bridge diff --git a/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java b/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java index a1a7536..deef9e5 100644 --- a/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java +++ b/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java @@ -67,7 +67,7 @@ protected void runTest() throws Throwable { Process p = Runtime.getRuntime().exec(new String[] { maven, - "-Djackpot.plugin.version=13.0", + "-Djackpot.plugin.version=16.0", "-q", "--batch-mode", "jackpot30:analyze" diff --git a/cmdline/maven/tests/fail-on-warnings/golden b/cmdline/maven/tests/fail-on-warnings/golden index bea3cf1..9fad781 100644 --- a/cmdline/maven/tests/fail-on-warnings/golden +++ b/cmdline/maven/tests/fail-on-warnings/golden @@ -1,7 +1,7 @@ ${basedir}/src/main/java/test/App.java:24: warning: [Convert_to_Lambda_or_Member_Reference] This anonymous inner class creation can be turned into a lambda expression. Runnable r = new Runnable() { public void run() { } }; ^ -[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:13.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] +[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:16.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. diff --git a/cmdline/maven/tests/sl-failure/golden b/cmdline/maven/tests/sl-failure/golden index 44933b4..8848ce5 100644 --- a/cmdline/maven/tests/sl-failure/golden +++ b/cmdline/maven/tests/sl-failure/golden @@ -1,5 +1,5 @@ unrecognized source level specification: unparseable -[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:13.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] +[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:16.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. diff --git a/cmdline/tool/scripts/pom.xml b/cmdline/tool/scripts/pom.xml index 150b29e..6a72c45 100644 --- a/cmdline/tool/scripts/pom.xml +++ b/cmdline/tool/scripts/pom.xml @@ -21,7 +21,7 @@ org.apache.netbeans.modules.jackpot30 jackpot30-maven-plugin - 13.0 + 16.0 maven-plugin Jackpot 3.0 Command Line Tool From 3a16ac26b48de7c1d7c522bc889bbb578e6a7de3 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sat, 11 Mar 2023 08:42:56 +0100 Subject: [PATCH 02/18] Upgrading to version 17. --- cmdline/README.md | 4 ++-- cmdline/build.xml | 2 +- cmdline/maven/pom.xml | 2 +- .../netbeans/modules/jackpot30/maven/RunJackpot30Test.java | 2 +- cmdline/maven/tests/fail-on-warnings/golden | 2 +- cmdline/maven/tests/sl-failure/golden | 2 +- cmdline/tool/scripts/pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmdline/README.md b/cmdline/README.md index a23aae5..c12139a 100644 --- a/cmdline/README.md +++ b/cmdline/README.md @@ -27,7 +27,7 @@ This tool allows to run NetBeans Java code checker without the NetBeans IDE. Thi #### To Build -* Apache NetBeans 16.0 +* Apache NetBeans 17 * JDK 8, JDK 11 and JDK 17 * bash * Apache ant 1.9.9 or above @@ -42,7 +42,7 @@ This tool allows to run NetBeans Java code checker without the NetBeans IDE. Thi Build using: ``` -$ ant -DNETBEANS_PLATFORM= -DJDK11= -DJDK17= build-and-test +$ ant -DNETBEANS_PLATFORM= -DJDK11= -DJDK17= build-and-test ``` The built product is in tool/build/jackpot. diff --git a/cmdline/build.xml b/cmdline/build.xml index a3a6512..d6d548c 100644 --- a/cmdline/build.xml +++ b/cmdline/build.xml @@ -52,7 +52,7 @@ - + diff --git a/cmdline/maven/pom.xml b/cmdline/maven/pom.xml index 40a7874..1e8ef33 100644 --- a/cmdline/maven/pom.xml +++ b/cmdline/maven/pom.xml @@ -21,7 +21,7 @@ org.apache.netbeans.modules.jackpot30 jackpot30-maven-plugin - 16.0 + 17.0 maven-plugin Jackpot 3.0 Command Line Tool Maven Bridge diff --git a/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java b/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java index deef9e5..79b7c99 100644 --- a/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java +++ b/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java @@ -67,7 +67,7 @@ protected void runTest() throws Throwable { Process p = Runtime.getRuntime().exec(new String[] { maven, - "-Djackpot.plugin.version=16.0", + "-Djackpot.plugin.version=17.0", "-q", "--batch-mode", "jackpot30:analyze" diff --git a/cmdline/maven/tests/fail-on-warnings/golden b/cmdline/maven/tests/fail-on-warnings/golden index 9fad781..b29c488 100644 --- a/cmdline/maven/tests/fail-on-warnings/golden +++ b/cmdline/maven/tests/fail-on-warnings/golden @@ -1,7 +1,7 @@ ${basedir}/src/main/java/test/App.java:24: warning: [Convert_to_Lambda_or_Member_Reference] This anonymous inner class creation can be turned into a lambda expression. Runnable r = new Runnable() { public void run() { } }; ^ -[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:16.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] +[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:17.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. diff --git a/cmdline/maven/tests/sl-failure/golden b/cmdline/maven/tests/sl-failure/golden index 8848ce5..6766b13 100644 --- a/cmdline/maven/tests/sl-failure/golden +++ b/cmdline/maven/tests/sl-failure/golden @@ -1,5 +1,5 @@ unrecognized source level specification: unparseable -[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:16.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] +[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:17.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. diff --git a/cmdline/tool/scripts/pom.xml b/cmdline/tool/scripts/pom.xml index 6a72c45..8b6cf35 100644 --- a/cmdline/tool/scripts/pom.xml +++ b/cmdline/tool/scripts/pom.xml @@ -21,7 +21,7 @@ org.apache.netbeans.modules.jackpot30 jackpot30-maven-plugin - 16.0 + 17.0 maven-plugin Jackpot 3.0 Command Line Tool From 60c88dd5b93bc634861fbcbdc65338f294306e68 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sat, 11 Mar 2023 08:58:24 +0100 Subject: [PATCH 03/18] Upgrading to NB 17. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2e3dea..cb1e6b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ addons: jdk: - openjdk8 before_script: - - wget 'https://dlcdn.apache.org/netbeans/netbeans/16/netbeans-16-bin.zip' -O /tmp/netbeans-16-bin.zip - - (cd $HOME; unzip /tmp/netbeans-16-bin.zip) + - wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip + - (cd $HOME; unzip /tmp/netbeans-17-bin.zip) - unset _JAVA_OPTIONS script: - export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 From dd1c7bd31747a99f007b34e65bacad733821ef00 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sat, 11 Mar 2023 08:59:20 +0100 Subject: [PATCH 04/18] Fix paths for NB 17, disable hints that don't work well for Jackpot. --- cmdline/tool/build.xml | 2 +- .../modules/jackpot30/cmdline/Main.java | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/cmdline/tool/build.xml b/cmdline/tool/build.xml index e756ee1..f71eab0 100644 --- a/cmdline/tool/build.xml +++ b/cmdline/tool/build.xml @@ -114,7 +114,7 @@ + else="-Xbootclasspath/p:${nbplatform.active.dir}/java/modules/ext/nb-javac-jdk-19-api.jar:${nbplatform.active.dir}/java/modules/ext/nb-javac-jdk-19.jar"> diff --git a/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java b/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java index b72e704..aa11f38 100644 --- a/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java +++ b/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java @@ -442,7 +442,19 @@ private static GroupResult handleGroup(RootConfiguration rootConfiguration, Prog WarningsAndErrors wae = new WarningsAndErrors(); ProgressHandleWrapper progress = w.startNextPartWithEmbedding(1); - Preferences settings = globalConfig.configurationPreferences != null ? globalConfig.configurationPreferences : new MemoryPreferences(); + Preferences settings = new MemoryPreferences(); + + if (globalConfig.configurationPreferences != null) { + try { + copyPreferences(globalConfig.configurationPreferences, settings); + } catch (BackingStoreException ex) { + throw new IOException(ex); + } + } + + settings.node("org.netbeans.modules.java.hints.bugs.Unused").putBoolean("enabled", false); + settings.node("org.netbeans.modules.java.hints.suggestions.Tiny.inlineRedundantVar").putBoolean("enabled", false); + HintsSettings hintSettings = HintsSettings.createPreferencesBasedHintsSettings(settings, globalConfig.useDefaultEnabledSetting, null); if (globalConfig.hint != null) { @@ -1276,4 +1288,13 @@ private static int[] lineStarts(FileObject file) { return new int[1]; } } + + private static void copyPreferences(Preferences from, Preferences to) throws BackingStoreException { + for (String key : from.keys()) { + to.put(key, from.get(key, null)); + } + for (String child : from.childrenNames()) { + copyPreferences(from.node(child), to.node(child)); + } + } } From 6bf9db364999b1503acc0c4614c8387c84229ef1 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sat, 11 Mar 2023 19:07:18 +0100 Subject: [PATCH 05/18] Must copy ct.sym and include platform registration. --- .../cmdline/lib/CreateStandaloneJar.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java index ce9bfa4..a97c471 100644 --- a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java +++ b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java @@ -18,6 +18,8 @@ */ package org.netbeans.modules.jackpot30.cmdline.lib; +import com.sun.tools.javac.platform.JDKPlatformProvider; +import com.sun.tools.javac.platform.PlatformProvider; import java.io.BufferedWriter; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -97,6 +99,8 @@ import org.netbeans.spi.java.hints.Hint; import org.netbeans.spi.java.queries.CompilerOptionsQueryImplementation; import org.netbeans.spi.project.ProjectManagerImplementation; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; import org.openide.filesystems.MIMEResolver; import org.openide.filesystems.Repository; import org.openide.util.NbCollections; @@ -286,6 +290,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc registrations.add(new MetaInfRegistration(RulesManager.class.getName(), RulesManagerImpl.class.getName())); registrations.add(new MetaInfRegistration(EntityCatalog.class.getName(), EntityCatalogImpl.class.getName())); registrations.add(new MetaInfRegistration(CompileWorkerProvider.class.getName(), DefaultCompileWorkerProvider.class.getName())); + registrations.add(new MetaInfRegistration(PlatformProvider.class.getName(), escapeJavaxLang(info, JDKPlatformProvider.class.getName()))); registrations.addAll(info.metaInf); @@ -305,6 +310,17 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc addMETA_INFRegistration(out, info, e.getValue()); } + URL ctSym = this.getClass().getClassLoader().getResource("META-INF/ct.sym"); + FileObject ctSymFO = NBJRTURLMapper.findFileObject(ctSym); + FileObject root = ctSymFO.getParent().getParent(); + Enumeration children = ctSymFO.getChildren(true); + while (children.hasMoreElements()) { + FileObject file = children.nextElement(); + if (file.isData()) { + out.put(FileUtil.getRelativePath(root, file), file.asBytes()); + } + } + try (JarOutputStream outStream = new JarOutputStream(new FileOutputStream(targetCompilerFile))) { Set seenDirs = new HashSet<>(); for (Entry e : out.entrySet()) { @@ -532,7 +548,8 @@ private static String escapeJavaxLang(Info info, String fileName) throws Unsuppo NBJRTURLMapper.class.getName(), VanillaJavacContextEnhancer.class.getName(), EntityCatalogImpl.class.getName(), - DefaultCompileWorkerProvider.class.getName() + DefaultCompileWorkerProvider.class.getName(), + JDKPlatformProvider.class.getName() )); private static final Set COPY_REGISTRATION = new HashSet(Arrays.asList( From ec385c4896113447fda0581e3cc9f78e92a815b0 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sat, 11 Mar 2023 21:49:05 +0100 Subject: [PATCH 06/18] Avoiding compile dependency on internal classes. --- .../modules/jackpot30/cmdline/lib/CreateStandaloneJar.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java index a97c471..c2a06e4 100644 --- a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java +++ b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java @@ -18,8 +18,6 @@ */ package org.netbeans.modules.jackpot30.cmdline.lib; -import com.sun.tools.javac.platform.JDKPlatformProvider; -import com.sun.tools.javac.platform.PlatformProvider; import java.io.BufferedWriter; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -290,7 +288,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc registrations.add(new MetaInfRegistration(RulesManager.class.getName(), RulesManagerImpl.class.getName())); registrations.add(new MetaInfRegistration(EntityCatalog.class.getName(), EntityCatalogImpl.class.getName())); registrations.add(new MetaInfRegistration(CompileWorkerProvider.class.getName(), DefaultCompileWorkerProvider.class.getName())); - registrations.add(new MetaInfRegistration(PlatformProvider.class.getName(), escapeJavaxLang(info, JDKPlatformProvider.class.getName()))); + registrations.add(new MetaInfRegistration("com.sun.tools.javac.platform.PlatformProvider", escapeJavaxLang(info, "com.sun.tools.javac.platform.JDKPlatformProvider"))); registrations.addAll(info.metaInf); @@ -549,7 +547,7 @@ private static String escapeJavaxLang(Info info, String fileName) throws Unsuppo VanillaJavacContextEnhancer.class.getName(), EntityCatalogImpl.class.getName(), DefaultCompileWorkerProvider.class.getName(), - JDKPlatformProvider.class.getName() + "com.sun.tools.javac.platform.JDKPlatformProvider" )); private static final Set COPY_REGISTRATION = new HashSet(Arrays.asList( From 9c8f416501bf252e904e6658165e5894d252a071 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:19:39 +0100 Subject: [PATCH 07/18] Processor must run on JDK 19. --- cmdline/README.md | 6 +++--- cmdline/build.xml | 11 +++++++++++ cmdline/processor/build.xml | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/cmdline/README.md b/cmdline/README.md index c12139a..9aed737 100644 --- a/cmdline/README.md +++ b/cmdline/README.md @@ -28,21 +28,21 @@ This tool allows to run NetBeans Java code checker without the NetBeans IDE. Thi #### To Build * Apache NetBeans 17 -* JDK 8, JDK 11 and JDK 17 +* JDK 8, JDK 11, JDK 17 and JDK 19 * bash * Apache ant 1.9.9 or above * Apache Maven 3.3.9 or above #### To Run -* JDK 8-17 +* JDK 8-19 ### Building Build using: ``` -$ ant -DNETBEANS_PLATFORM= -DJDK11= -DJDK17= build-and-test +$ ant -DNETBEANS_PLATFORM= -DJDK11= -DJDK17= -DJDK19= build-and-test ``` The built product is in tool/build/jackpot. diff --git a/cmdline/build.xml b/cmdline/build.xml index d6d548c..a079894 100644 --- a/cmdline/build.xml +++ b/cmdline/build.xml @@ -78,6 +78,13 @@ + + + + + + + @@ -95,6 +102,10 @@ + + + + Installing tool to the local maven repository: diff --git a/cmdline/processor/build.xml b/cmdline/processor/build.xml index 6224c52..06197a3 100644 --- a/cmdline/processor/build.xml +++ b/cmdline/processor/build.xml @@ -33,8 +33,8 @@ value="NOTHING"> - - + + From 033c4409f53e031ffa8b418ba733c71a45e05b9f Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:30:56 +0100 Subject: [PATCH 08/18] Trying to add GH actions/workflow --- .github/workflows/main.yml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2a05493 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: NetBeans Jackpot 3.0 + +on: + push: + pull_request: + # unlocked event is used as super secret restart button + types: [opened, synchronize, unlocked] + +# cancel other PR workflow run in the same head-base group if it exists (e.g. during PR syncs) +# if this is not a PR run (no github.head_ref and github.base_ref defined), use an UID as group +concurrency: + group: ${{ github.head_ref || github.run_id }}-${{ github.base_ref }} + cancel-in-progress: true + +jobs: + + # primary build job, most other jobs use the artifact produced here + # artifact is only produced once in the matrix + base-build: + name: Build Jackpot 3.0 + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + + - name: Set up Ubuntu dependencies + run: + apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk + + - name: Set up NetBeans + run: + wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip + (cd $HOME; unzip /tmp/netbeans-17-bin.zip) + + - name: Run RAT: + run: + (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) + + - name: Do build Jackpot: + run: + export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + export PATH=$JAVA_HOME/bin:$PATH + export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 + export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 + (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) From 4ed29afadcc8a5a87e820f7d64a8563acf381e08 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:32:58 +0100 Subject: [PATCH 09/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a05493..54cfa08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ jobs: wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip (cd $HOME; unzip /tmp/netbeans-17-bin.zip) - - name: Run RAT: + - name: Run RAT run: (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) From 1a1a2040ea3fa5be485516271914a3c97db07a9d Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:33:26 +0100 Subject: [PATCH 10/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54cfa08..f2777f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,7 @@ jobs: run: (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) - - name: Do build Jackpot: + - name: Do build Jackpot run: export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH From 038c0f91201e9af4bdb7425138bb2d47e853c9ff Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:34:26 +0100 Subject: [PATCH 11/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2777f6..7a63827 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: - name: Set up Ubuntu dependencies run: - apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk + sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk - name: Set up NetBeans run: From d8ae9e338debd14c991333255ca10e5dcffa785d Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:36:51 +0100 Subject: [PATCH 12/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a63827..c93bc61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,22 +40,18 @@ jobs: steps: - name: Set up Ubuntu dependencies - run: - sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk + run: sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk - name: Set up NetBeans - run: - wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip - (cd $HOME; unzip /tmp/netbeans-17-bin.zip) + run: wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip + run: (cd $HOME; unzip /tmp/netbeans-17-bin.zip) - name: Run RAT - run: - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) + run: (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) - name: Do build Jackpot - run: - export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 - export PATH=$JAVA_HOME/bin:$PATH - export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 - export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) + run: export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + run: export PATH=$JAVA_HOME/bin:$PATH + run: export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 + run: export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 + run: (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) From 69dc59ef2c365adf1cab7aed11e2219d7436a745 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:39:11 +0100 Subject: [PATCH 13/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c93bc61..a360a6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,18 +40,22 @@ jobs: steps: - name: Set up Ubuntu dependencies - run: sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk + run: | + sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk - name: Set up NetBeans - run: wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip - run: (cd $HOME; unzip /tmp/netbeans-17-bin.zip) + run: | + wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip + (cd $HOME; unzip /tmp/netbeans-17-bin.zip) - name: Run RAT - run: (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) + run: | + (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) - name: Do build Jackpot - run: export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 - run: export PATH=$JAVA_HOME/bin:$PATH - run: export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 - run: export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 - run: (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) + run: | + export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + export PATH=$JAVA_HOME/bin:$PATH + export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 + export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 + (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) From d09a46589d0e1f104f4d2aebc0dac7dbcd160ee9 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:41:46 +0100 Subject: [PATCH 14/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a360a6a..f6d4f00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,11 +45,13 @@ jobs: - name: Set up NetBeans run: | - wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip + wget -q 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip (cd $HOME; unzip /tmp/netbeans-17-bin.zip) - name: Run RAT run: | + echo $PWD + ls -lad (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) - name: Do build Jackpot From 3f9979cd39d68f2c2eb2377d82a66199fbdd54ce Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 09:57:40 +0100 Subject: [PATCH 15/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6d4f00..1310ca2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,7 @@ jobs: - name: Run RAT run: | echo $PWD - ls -lad + ls -la $PWD (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) - name: Do build Jackpot From 2d10e2da28cf741d65b647afdfaef5314d6b5a42 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 10:39:13 +0100 Subject: [PATCH 16/18] Fix attempt for the workflow. --- .github/workflows/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1310ca2..088381a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - + + - name: Checkout ${{ github.ref }} ( ${{ github.sha }} ) + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: false + - name: Set up Ubuntu dependencies run: | sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk From f23d4350a72eb0e11d13662511e8a9b2f5e0f09b Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 13:58:21 +0100 Subject: [PATCH 17/18] Removing Travis configuration --- .travis.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cb1e6b3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -language: java -dist: bionic -addons: - apt: - packages: - - ant - - ant-optional - - openjdk-8-jdk - - openjdk-11-jdk - - openjdk-17-jdk -jdk: - - openjdk8 -before_script: - - wget 'https://dlcdn.apache.org/netbeans/netbeans/17/netbeans-17-bin.zip' -O /tmp/netbeans-17-bin.zip - - (cd $HOME; unzip /tmp/netbeans-17-bin.zip) - - unset _JAVA_OPTIONS -script: - - export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 - - export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 - - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat) - - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) From 4a80fdbf3e12c52ba2caf5a9b3b8e5cb1f854577 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Sun, 12 Mar 2023 13:59:42 +0100 Subject: [PATCH 18/18] Also test/run on JDK 19. --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 088381a..e006297 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: - name: Set up Ubuntu dependencies run: | - sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk + sudo apt install ant ant-optional openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk openjdk-19-jdk - name: Set up NetBeans run: | @@ -66,4 +66,5 @@ jobs: export PATH=$JAVA_HOME/bin:$PATH export JDK11=/usr/lib/jvm/java-11-openjdk-amd64 export JDK17=/usr/lib/jvm/java-17-openjdk-amd64 - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test) + export JDK19=/usr/lib/jvm/java-19-openjdk-amd64 + (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 -DJDK19=$JDK19 build-and-test)