From eaa65af1bbb8f0076afaf977434c68585ec8aad1 Mon Sep 17 00:00:00 2001 From: David Nestorovic Date: Wed, 19 Oct 2022 18:26:38 +0200 Subject: [PATCH 1/8] Bump version to 0.9.17-SNAPSHOT --- gradle/libs.versions.toml | 2 +- .../reproducers/issue-144/pom.xml | 4 +- .../org/graalvm/buildtools/Xpp3DomParser.java | 42 +++++++++++++++++++ .../buildtools/maven/NativeExtension.java | 5 +++ .../config/agent/AgentConfiguration.java | 32 ++++++++++++++ .../maven/config/agent/AgentMetadataCopy.java | 10 +++++ .../maven/config/agent/AgentMode.java | 4 ++ .../pom.xml | 2 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- .../java-application-with-reflection/pom.xml | 4 +- .../gradle.properties | 2 +- .../java-application-with-resources/pom.xml | 4 +- .../gradle.properties | 2 +- samples/java-application-with-tests/pom.xml | 4 +- samples/java-application/gradle.properties | 2 +- samples/java-application/pom.xml | 4 +- samples/java-library/gradle.properties | 2 +- samples/java-library/pom.xml | 4 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- samples/metadata-repo-integration/pom.xml | 4 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- samples/native-config-integration/pom.xml | 4 +- 26 files changed, 122 insertions(+), 29 deletions(-) create mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java create mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java create mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java create mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 12c1698f4..e2e1315b3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # Project versions -nativeBuildTools = "0.9.16" +nativeBuildTools = "0.9.17-SNAPSHOT" metadataRepository = "0.2.3" # External dependencies diff --git a/native-maven-plugin/reproducers/issue-144/pom.xml b/native-maven-plugin/reproducers/issue-144/pom.xml index 08d21cc78..b370e3c52 100644 --- a/native-maven-plugin/reproducers/issue-144/pom.xml +++ b/native-maven-plugin/reproducers/issue-144/pom.xml @@ -56,8 +56,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java new file mode 100644 index 000000000..b91aae871 --- /dev/null +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java @@ -0,0 +1,42 @@ +package org.graalvm.buildtools; + +import org.codehaus.plexus.util.xml.Xpp3Dom; + +import java.util.LinkedList; + +public class Xpp3DomParser { + + public static Xpp3Dom getTagByName(Xpp3Dom root, String name) { + if (root.getName().equalsIgnoreCase(name)){ + return root; + } + + Xpp3Dom[] children = root.getChildren(); + for (Xpp3Dom child : children) { + Xpp3Dom retVal = getTagByName(child, name); + if (retVal != null) { + return retVal; + } + } + + return null; + } + + public static LinkedList getAllTagsByName(Xpp3Dom root, String name) { + LinkedList listOfTags = new LinkedList<>(); + if (root.getName().equalsIgnoreCase(name)){ + listOfTags.add(root); + } + + Xpp3Dom[] children = root.getChildren(); + for (Xpp3Dom child : children) { + Xpp3Dom retVal = getTagByName(child, name); + if (retVal != null) { + listOfTags.add(retVal); + } + } + + return listOfTags; + } + +} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java index 39c5e9967..8e24d688b 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java @@ -53,6 +53,7 @@ import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.graalvm.buildtools.Utils; +import org.graalvm.buildtools.Xpp3DomParser; import org.graalvm.buildtools.utils.SharedConstants; import java.io.File; @@ -130,6 +131,10 @@ public void afterProjectsRead(MavenSession session) { String testIdsDir = testIdsDirectory(target); boolean isAgentEnabled = isAgentEnabled(session, nativePlugin); String selectedOptionsName = getSelectedOptionsName(session); + Xpp3Dom x = Xpp3DomParser.getTagByName((Xpp3Dom) nativePlugin.getConfiguration(), "agent"); + System.out.println("\n\n\n\n\n\n*****************************************************************************\n\n\n\n\n\n"); + assert x != null; + System.out.println(x.getName() + " ------- " + x.getParent().getName()); // Test configuration withPlugin(build, "maven-surefire-plugin", surefirePlugin -> { diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java new file mode 100644 index 000000000..2cea8ca46 --- /dev/null +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java @@ -0,0 +1,32 @@ +package org.graalvm.buildtools.maven.config.agent; + +import org.codehaus.plexus.util.xml.Xpp3Dom; + +import java.util.HashMap; +import java.util.LinkedList; + +public class AgentConfiguration { + + + + private boolean isEnabled; + private LinkedList modes; + private AgentMode defaultMode; + private LinkedList disabledPhases; + private HashMap commonOptions; + private AgentMetadataCopy metadataCopy; + + public AgentConfiguration() { + isEnabled = false; + modes = new LinkedList<>(); + defaultMode = null; + disabledPhases = new LinkedList<>(); + commonOptions = new HashMap<>(); + metadataCopy = null; + } + + public void readAgentConfiguration(Xpp3Dom root) { + + } + +} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java new file mode 100644 index 000000000..4c32928e9 --- /dev/null +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java @@ -0,0 +1,10 @@ +package org.graalvm.buildtools.maven.config.agent; + +import java.util.LinkedList; + +public class AgentMetadataCopy { + + private LinkedList inputPhases; + private String outputDirectory; + +} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java new file mode 100644 index 000000000..e2b1e237c --- /dev/null +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java @@ -0,0 +1,4 @@ +package org.graalvm.buildtools.maven.config.agent; + +public class AgentMode { +} diff --git a/samples/java-application-with-custom-packaging/pom.xml b/samples/java-application-with-custom-packaging/pom.xml index 27644c590..06be2de92 100644 --- a/samples/java-application-with-custom-packaging/pom.xml +++ b/samples/java-application-with-custom-packaging/pom.xml @@ -61,7 +61,7 @@ 3.3.4 org.graalvm.demo.Application netty - 0.9.16 + 0.9.17-SNAPSHOT diff --git a/samples/java-application-with-custom-tests/gradle.properties b/samples/java-application-with-custom-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-custom-tests/gradle.properties +++ b/samples/java-application-with-custom-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-extra-sourceset/gradle.properties b/samples/java-application-with-extra-sourceset/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-extra-sourceset/gradle.properties +++ b/samples/java-application-with-extra-sourceset/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/gradle.properties b/samples/java-application-with-reflection/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-reflection/gradle.properties +++ b/samples/java-application-with-reflection/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/pom.xml b/samples/java-application-with-reflection/pom.xml index 4bedf1247..1378fc8af 100644 --- a/samples/java-application-with-reflection/pom.xml +++ b/samples/java-application-with-reflection/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-resources/gradle.properties b/samples/java-application-with-resources/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-resources/gradle.properties +++ b/samples/java-application-with-resources/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-resources/pom.xml b/samples/java-application-with-resources/pom.xml index ee30ead73..0f590f271 100644 --- a/samples/java-application-with-resources/pom.xml +++ b/samples/java-application-with-resources/pom.xml @@ -51,9 +51,9 @@ 1.8 UTF-8 - 0.9.16 + 0.9.17-SNAPSHOT 5.8.1 - 0.9.16 + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-tests/gradle.properties b/samples/java-application-with-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-tests/gradle.properties +++ b/samples/java-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-tests/pom.xml b/samples/java-application-with-tests/pom.xml index 8547a971b..ea5128989 100644 --- a/samples/java-application-with-tests/pom.xml +++ b/samples/java-application-with-tests/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application/gradle.properties b/samples/java-application/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application/gradle.properties +++ b/samples/java-application/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application/pom.xml b/samples/java-application/pom.xml index 4a0ae90da..4a45531bf 100644 --- a/samples/java-application/pom.xml +++ b/samples/java-application/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-library/gradle.properties b/samples/java-library/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-library/gradle.properties +++ b/samples/java-library/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-library/pom.xml b/samples/java-library/pom.xml index cec28d1ab..007252656 100644 --- a/samples/java-library/pom.xml +++ b/samples/java-library/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT java-library diff --git a/samples/kotlin-application-with-tests/gradle.properties b/samples/kotlin-application-with-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/kotlin-application-with-tests/gradle.properties +++ b/samples/kotlin-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/metadata-repo-integration/gradle.properties b/samples/metadata-repo-integration/gradle.properties index 7c58a81e4..6bd9fbb10 100644 --- a/samples/metadata-repo-integration/gradle.properties +++ b/samples/metadata-repo-integration/gradle.properties @@ -1,4 +1,4 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT h2.version = 2.1.210 netty.version = 4.1.80.Final logback.version = 1.4.4 diff --git a/samples/metadata-repo-integration/pom.xml b/samples/metadata-repo-integration/pom.xml index ba569572e..7574c5566 100644 --- a/samples/metadata-repo-integration/pom.xml +++ b/samples/metadata-repo-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT 2.1.210 4.1.80.Final 1.4.4 diff --git a/samples/multi-project-with-tests/gradle.properties b/samples/multi-project-with-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/multi-project-with-tests/gradle.properties +++ b/samples/multi-project-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/gradle.properties b/samples/native-config-integration/gradle.properties index 240740991..7e6527205 100644 --- a/samples/native-config-integration/gradle.properties +++ b/samples/native-config-integration/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/pom.xml b/samples/native-config-integration/pom.xml index d0ee5527d..d245ff17b 100644 --- a/samples/native-config-integration/pom.xml +++ b/samples/native-config-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.example.Application From 4ebc5588ca8132962017978917b5ef76e990ed1e Mon Sep 17 00:00:00 2001 From: David Nestorovic Date: Wed, 19 Oct 2022 18:44:12 +0200 Subject: [PATCH 2/8] Add missing changelog entry --- docs/src/docs/asciidoc/index.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc index 8b4e26342..3da908bcd 100644 --- a/docs/src/docs/asciidoc/index.adoc +++ b/docs/src/docs/asciidoc/index.adoc @@ -19,6 +19,10 @@ If you are using alternative build systems, see < Date: Mon, 24 Oct 2022 12:00:13 +0200 Subject: [PATCH 3/8] Revert "Bump version to 0.9.17-SNAPSHOT" This reverts commit eaa65af1bbb8f0076afaf977434c68585ec8aad1. --- gradle/libs.versions.toml | 2 +- .../reproducers/issue-144/pom.xml | 4 +- .../org/graalvm/buildtools/Xpp3DomParser.java | 42 ------------------- .../buildtools/maven/NativeExtension.java | 5 --- .../config/agent/AgentConfiguration.java | 32 -------------- .../maven/config/agent/AgentMetadataCopy.java | 10 ----- .../maven/config/agent/AgentMode.java | 4 -- .../pom.xml | 2 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- .../java-application-with-reflection/pom.xml | 4 +- .../gradle.properties | 2 +- .../java-application-with-resources/pom.xml | 4 +- .../gradle.properties | 2 +- samples/java-application-with-tests/pom.xml | 4 +- samples/java-application/gradle.properties | 2 +- samples/java-application/pom.xml | 4 +- samples/java-library/gradle.properties | 2 +- samples/java-library/pom.xml | 4 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- samples/metadata-repo-integration/pom.xml | 4 +- .../gradle.properties | 2 +- .../gradle.properties | 2 +- samples/native-config-integration/pom.xml | 4 +- 26 files changed, 29 insertions(+), 122 deletions(-) delete mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java delete mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java delete mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java delete mode 100644 native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e2e1315b3..12c1698f4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # Project versions -nativeBuildTools = "0.9.17-SNAPSHOT" +nativeBuildTools = "0.9.16" metadataRepository = "0.2.3" # External dependencies diff --git a/native-maven-plugin/reproducers/issue-144/pom.xml b/native-maven-plugin/reproducers/issue-144/pom.xml index b370e3c52..08d21cc78 100644 --- a/native-maven-plugin/reproducers/issue-144/pom.xml +++ b/native-maven-plugin/reproducers/issue-144/pom.xml @@ -56,8 +56,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 example-app org.graalvm.demo.Application diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java deleted file mode 100644 index b91aae871..000000000 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/Xpp3DomParser.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.graalvm.buildtools; - -import org.codehaus.plexus.util.xml.Xpp3Dom; - -import java.util.LinkedList; - -public class Xpp3DomParser { - - public static Xpp3Dom getTagByName(Xpp3Dom root, String name) { - if (root.getName().equalsIgnoreCase(name)){ - return root; - } - - Xpp3Dom[] children = root.getChildren(); - for (Xpp3Dom child : children) { - Xpp3Dom retVal = getTagByName(child, name); - if (retVal != null) { - return retVal; - } - } - - return null; - } - - public static LinkedList getAllTagsByName(Xpp3Dom root, String name) { - LinkedList listOfTags = new LinkedList<>(); - if (root.getName().equalsIgnoreCase(name)){ - listOfTags.add(root); - } - - Xpp3Dom[] children = root.getChildren(); - for (Xpp3Dom child : children) { - Xpp3Dom retVal = getTagByName(child, name); - if (retVal != null) { - listOfTags.add(retVal); - } - } - - return listOfTags; - } - -} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java index 8e24d688b..39c5e9967 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java @@ -53,7 +53,6 @@ import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.graalvm.buildtools.Utils; -import org.graalvm.buildtools.Xpp3DomParser; import org.graalvm.buildtools.utils.SharedConstants; import java.io.File; @@ -131,10 +130,6 @@ public void afterProjectsRead(MavenSession session) { String testIdsDir = testIdsDirectory(target); boolean isAgentEnabled = isAgentEnabled(session, nativePlugin); String selectedOptionsName = getSelectedOptionsName(session); - Xpp3Dom x = Xpp3DomParser.getTagByName((Xpp3Dom) nativePlugin.getConfiguration(), "agent"); - System.out.println("\n\n\n\n\n\n*****************************************************************************\n\n\n\n\n\n"); - assert x != null; - System.out.println(x.getName() + " ------- " + x.getParent().getName()); // Test configuration withPlugin(build, "maven-surefire-plugin", surefirePlugin -> { diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java deleted file mode 100644 index 2cea8ca46..000000000 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.graalvm.buildtools.maven.config.agent; - -import org.codehaus.plexus.util.xml.Xpp3Dom; - -import java.util.HashMap; -import java.util.LinkedList; - -public class AgentConfiguration { - - - - private boolean isEnabled; - private LinkedList modes; - private AgentMode defaultMode; - private LinkedList disabledPhases; - private HashMap commonOptions; - private AgentMetadataCopy metadataCopy; - - public AgentConfiguration() { - isEnabled = false; - modes = new LinkedList<>(); - defaultMode = null; - disabledPhases = new LinkedList<>(); - commonOptions = new HashMap<>(); - metadataCopy = null; - } - - public void readAgentConfiguration(Xpp3Dom root) { - - } - -} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java deleted file mode 100644 index 4c32928e9..000000000 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMetadataCopy.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.graalvm.buildtools.maven.config.agent; - -import java.util.LinkedList; - -public class AgentMetadataCopy { - - private LinkedList inputPhases; - private String outputDirectory; - -} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java deleted file mode 100644 index e2b1e237c..000000000 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/config/agent/AgentMode.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.graalvm.buildtools.maven.config.agent; - -public class AgentMode { -} diff --git a/samples/java-application-with-custom-packaging/pom.xml b/samples/java-application-with-custom-packaging/pom.xml index 06be2de92..27644c590 100644 --- a/samples/java-application-with-custom-packaging/pom.xml +++ b/samples/java-application-with-custom-packaging/pom.xml @@ -61,7 +61,7 @@ 3.3.4 org.graalvm.demo.Application netty - 0.9.17-SNAPSHOT + 0.9.16 diff --git a/samples/java-application-with-custom-tests/gradle.properties b/samples/java-application-with-custom-tests/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-application-with-custom-tests/gradle.properties +++ b/samples/java-application-with-custom-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-extra-sourceset/gradle.properties b/samples/java-application-with-extra-sourceset/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-application-with-extra-sourceset/gradle.properties +++ b/samples/java-application-with-extra-sourceset/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/gradle.properties b/samples/java-application-with-reflection/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-application-with-reflection/gradle.properties +++ b/samples/java-application-with-reflection/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/pom.xml b/samples/java-application-with-reflection/pom.xml index 1378fc8af..4bedf1247 100644 --- a/samples/java-application-with-reflection/pom.xml +++ b/samples/java-application-with-reflection/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-resources/gradle.properties b/samples/java-application-with-resources/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-application-with-resources/gradle.properties +++ b/samples/java-application-with-resources/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-resources/pom.xml b/samples/java-application-with-resources/pom.xml index 0f590f271..ee30ead73 100644 --- a/samples/java-application-with-resources/pom.xml +++ b/samples/java-application-with-resources/pom.xml @@ -51,9 +51,9 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT + 0.9.16 5.8.1 - 0.9.17-SNAPSHOT + 0.9.16 example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-tests/gradle.properties b/samples/java-application-with-tests/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-application-with-tests/gradle.properties +++ b/samples/java-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-tests/pom.xml b/samples/java-application-with-tests/pom.xml index ea5128989..8547a971b 100644 --- a/samples/java-application-with-tests/pom.xml +++ b/samples/java-application-with-tests/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 example-app org.graalvm.demo.Application diff --git a/samples/java-application/gradle.properties b/samples/java-application/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-application/gradle.properties +++ b/samples/java-application/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application/pom.xml b/samples/java-application/pom.xml index 4a45531bf..4a0ae90da 100644 --- a/samples/java-application/pom.xml +++ b/samples/java-application/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 example-app org.graalvm.demo.Application diff --git a/samples/java-library/gradle.properties b/samples/java-library/gradle.properties index 7e6527205..240740991 100644 --- a/samples/java-library/gradle.properties +++ b/samples/java-library/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-library/pom.xml b/samples/java-library/pom.xml index 007252656..cec28d1ab 100644 --- a/samples/java-library/pom.xml +++ b/samples/java-library/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 java-library diff --git a/samples/kotlin-application-with-tests/gradle.properties b/samples/kotlin-application-with-tests/gradle.properties index 7e6527205..240740991 100644 --- a/samples/kotlin-application-with-tests/gradle.properties +++ b/samples/kotlin-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/metadata-repo-integration/gradle.properties b/samples/metadata-repo-integration/gradle.properties index 6bd9fbb10..7c58a81e4 100644 --- a/samples/metadata-repo-integration/gradle.properties +++ b/samples/metadata-repo-integration/gradle.properties @@ -1,4 +1,4 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 h2.version = 2.1.210 netty.version = 4.1.80.Final logback.version = 1.4.4 diff --git a/samples/metadata-repo-integration/pom.xml b/samples/metadata-repo-integration/pom.xml index 7574c5566..ba569572e 100644 --- a/samples/metadata-repo-integration/pom.xml +++ b/samples/metadata-repo-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 2.1.210 4.1.80.Final 1.4.4 diff --git a/samples/multi-project-with-tests/gradle.properties b/samples/multi-project-with-tests/gradle.properties index 7e6527205..240740991 100644 --- a/samples/multi-project-with-tests/gradle.properties +++ b/samples/multi-project-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/gradle.properties b/samples/native-config-integration/gradle.properties index 7e6527205..240740991 100644 --- a/samples/native-config-integration/gradle.properties +++ b/samples/native-config-integration/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.16 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/pom.xml b/samples/native-config-integration/pom.xml index d245ff17b..d0ee5527d 100644 --- a/samples/native-config-integration/pom.xml +++ b/samples/native-config-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.16 + 0.9.16 example-app org.graalvm.example.Application From f8dfae5b4327afa743dc77e76a968a737ff59f73 Mon Sep 17 00:00:00 2001 From: David Nestorovic Date: Mon, 24 Oct 2022 12:06:49 +0200 Subject: [PATCH 4/8] Fix version bump to 0.9.17 --- gradle/libs.versions.toml | 2 +- native-maven-plugin/reproducers/issue-144/pom.xml | 4 ++-- samples/java-application-with-custom-packaging/pom.xml | 2 +- samples/java-application-with-custom-tests/gradle.properties | 2 +- .../java-application-with-extra-sourceset/gradle.properties | 2 +- samples/java-application-with-reflection/gradle.properties | 2 +- samples/java-application-with-reflection/pom.xml | 4 ++-- samples/java-application-with-resources/gradle.properties | 2 +- samples/java-application-with-resources/pom.xml | 4 ++-- samples/java-application-with-tests/gradle.properties | 2 +- samples/java-application-with-tests/pom.xml | 4 ++-- samples/java-application/gradle.properties | 2 +- samples/java-application/pom.xml | 4 ++-- samples/java-library/gradle.properties | 2 +- samples/java-library/pom.xml | 4 ++-- samples/kotlin-application-with-tests/gradle.properties | 2 +- samples/metadata-repo-integration/gradle.properties | 2 +- samples/metadata-repo-integration/pom.xml | 4 ++-- samples/multi-project-with-tests/gradle.properties | 2 +- samples/native-config-integration/gradle.properties | 2 +- samples/native-config-integration/pom.xml | 4 ++-- 21 files changed, 29 insertions(+), 29 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 12c1698f4..e2e1315b3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # Project versions -nativeBuildTools = "0.9.16" +nativeBuildTools = "0.9.17-SNAPSHOT" metadataRepository = "0.2.3" # External dependencies diff --git a/native-maven-plugin/reproducers/issue-144/pom.xml b/native-maven-plugin/reproducers/issue-144/pom.xml index 08d21cc78..b370e3c52 100644 --- a/native-maven-plugin/reproducers/issue-144/pom.xml +++ b/native-maven-plugin/reproducers/issue-144/pom.xml @@ -56,8 +56,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-custom-packaging/pom.xml b/samples/java-application-with-custom-packaging/pom.xml index 27644c590..06be2de92 100644 --- a/samples/java-application-with-custom-packaging/pom.xml +++ b/samples/java-application-with-custom-packaging/pom.xml @@ -61,7 +61,7 @@ 3.3.4 org.graalvm.demo.Application netty - 0.9.16 + 0.9.17-SNAPSHOT diff --git a/samples/java-application-with-custom-tests/gradle.properties b/samples/java-application-with-custom-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-custom-tests/gradle.properties +++ b/samples/java-application-with-custom-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-extra-sourceset/gradle.properties b/samples/java-application-with-extra-sourceset/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-extra-sourceset/gradle.properties +++ b/samples/java-application-with-extra-sourceset/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/gradle.properties b/samples/java-application-with-reflection/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-reflection/gradle.properties +++ b/samples/java-application-with-reflection/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/pom.xml b/samples/java-application-with-reflection/pom.xml index 4bedf1247..1378fc8af 100644 --- a/samples/java-application-with-reflection/pom.xml +++ b/samples/java-application-with-reflection/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-resources/gradle.properties b/samples/java-application-with-resources/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-resources/gradle.properties +++ b/samples/java-application-with-resources/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-resources/pom.xml b/samples/java-application-with-resources/pom.xml index ee30ead73..0f590f271 100644 --- a/samples/java-application-with-resources/pom.xml +++ b/samples/java-application-with-resources/pom.xml @@ -51,9 +51,9 @@ 1.8 UTF-8 - 0.9.16 + 0.9.17-SNAPSHOT 5.8.1 - 0.9.16 + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-tests/gradle.properties b/samples/java-application-with-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application-with-tests/gradle.properties +++ b/samples/java-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-tests/pom.xml b/samples/java-application-with-tests/pom.xml index 8547a971b..ea5128989 100644 --- a/samples/java-application-with-tests/pom.xml +++ b/samples/java-application-with-tests/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-application/gradle.properties b/samples/java-application/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-application/gradle.properties +++ b/samples/java-application/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application/pom.xml b/samples/java-application/pom.xml index 4a0ae90da..4a45531bf 100644 --- a/samples/java-application/pom.xml +++ b/samples/java-application/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application diff --git a/samples/java-library/gradle.properties b/samples/java-library/gradle.properties index 240740991..7e6527205 100644 --- a/samples/java-library/gradle.properties +++ b/samples/java-library/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-library/pom.xml b/samples/java-library/pom.xml index cec28d1ab..007252656 100644 --- a/samples/java-library/pom.xml +++ b/samples/java-library/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT java-library diff --git a/samples/kotlin-application-with-tests/gradle.properties b/samples/kotlin-application-with-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/kotlin-application-with-tests/gradle.properties +++ b/samples/kotlin-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/metadata-repo-integration/gradle.properties b/samples/metadata-repo-integration/gradle.properties index 7c58a81e4..6bd9fbb10 100644 --- a/samples/metadata-repo-integration/gradle.properties +++ b/samples/metadata-repo-integration/gradle.properties @@ -1,4 +1,4 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT h2.version = 2.1.210 netty.version = 4.1.80.Final logback.version = 1.4.4 diff --git a/samples/metadata-repo-integration/pom.xml b/samples/metadata-repo-integration/pom.xml index ba569572e..7574c5566 100644 --- a/samples/metadata-repo-integration/pom.xml +++ b/samples/metadata-repo-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT 2.1.210 4.1.80.Final 1.4.4 diff --git a/samples/multi-project-with-tests/gradle.properties b/samples/multi-project-with-tests/gradle.properties index 240740991..7e6527205 100644 --- a/samples/multi-project-with-tests/gradle.properties +++ b/samples/multi-project-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/gradle.properties b/samples/native-config-integration/gradle.properties index 240740991..7e6527205 100644 --- a/samples/native-config-integration/gradle.properties +++ b/samples/native-config-integration/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.16 +native.gradle.plugin.version = 0.9.17-SNAPSHOT junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/pom.xml b/samples/native-config-integration/pom.xml index d0ee5527d..d245ff17b 100644 --- a/samples/native-config-integration/pom.xml +++ b/samples/native-config-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.16 - 0.9.16 + 0.9.17-SNAPSHOT + 0.9.17-SNAPSHOT example-app org.graalvm.example.Application From 047b4e27fcb4fa4139a863eb0e3639815300307b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 24 Oct 2022 13:30:22 +0200 Subject: [PATCH 5/8] Make GraalVM installation check lazy add-reachability-metadata goal can now be run with a regular JDK. Closes gh-327 --- .../buildtools/maven/NativeExtension.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java index 39c5e9967..56d81d58b 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java @@ -92,8 +92,6 @@ static String testIdsDirectory(String baseDir) { return baseDir + File.separator + "test-ids"; } - private static String graalvmJava; - static String buildAgentArgument(String baseDir, Context context, List agentOptions) { List options = new ArrayList<>(agentOptions); String effectiveOutputDir = agentOutputDirectoryFor(baseDir, context); @@ -117,12 +115,6 @@ static String agentOutputDirectoryFor(String baseDir, Context context) { @Override public void afterProjectsRead(MavenSession session) { - try { - graalvmJava = Utils.getNativeImage(logger).getParent().resolve("java").toString(); - } catch (MojoExecutionException e) { - throw new RuntimeException(e); - } - for (MavenProject project : session.getProjects()) { Build build = project.getBuild(); withPlugin(build, "native-maven-plugin", nativePlugin -> { @@ -167,7 +159,7 @@ public void afterProjectsRead(MavenSession session) { for (Xpp3Dom child : children) { commandlineArgs.addChild(child); } - findOrAppend(config, "executable").setValue(graalvmJava); + findOrAppend(config, "executable").setValue(getGraalvmJava()); } }) ); @@ -321,7 +313,7 @@ private static void configureAgentForSurefire(Plugin surefirePlugin, String agen Xpp3Dom argLine = new Xpp3Dom("argLine"); argLine.setValue(agentArgument); configuration.addChild(argLine); - findOrAppend(configuration, "jvm").setValue(graalvmJava); + findOrAppend(configuration, "jvm").setValue(getGraalvmJava()); }); } @@ -360,4 +352,12 @@ private static Xpp3Dom findOrAppend(Xpp3Dom parent, String childName) { return child; } + private static String getGraalvmJava() { + try { + return Utils.getNativeImage(logger).getParent().resolve("java").toString(); + } catch (MojoExecutionException e) { + throw new RuntimeException(e); + } + } + } From c4762a78f9c80b653ff4e3be8f3bb3fc6dd60d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 31 Oct 2022 08:09:52 +0100 Subject: [PATCH 6/8] Add a check for the minimal GraalVM version (#353) This commit adds a new Gradle and Maven requiredVersion configuration option that specifies the minimal GraalVM version and can be set to MAJOR, MAJOR.MINOR or MAJOR.MINOR.PATCH. Closes gh-346 --- .../buildtools/utils/NativeImageUtils.java | 47 ++++++++ .../utils/NativeImageUtilsTest.java | 105 ++++++++++++++++++ docs/src/docs/asciidoc/index.adoc | 5 + docs/src/docs/asciidoc/maven-plugin.adoc | 7 ++ .../docs/snippets/gradle/groovy/build.gradle | 1 + .../snippets/gradle/kotlin/build.gradle.kts | 1 + .../gradle/RequiredVersionTest.groovy | 48 ++++++++ .../gradle/dsl/NativeImageOptions.java | 9 ++ .../gradle/tasks/BuildNativeImageTask.java | 29 ++++- .../maven/RequireVersionFunctionalTest.groovy | 66 +++++++++++ .../maven/AbstractNativeImageMojo.java | 33 ++++++ samples/java-application/pom.xml | 2 + 12 files changed, 349 insertions(+), 4 deletions(-) create mode 100644 common/utils/src/test/java/org/graalvm/buildtools/utils/NativeImageUtilsTest.java create mode 100644 native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/RequiredVersionTest.groovy create mode 100644 native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/RequireVersionFunctionalTest.groovy diff --git a/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java b/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java index b0b3a485e..e0dae6827 100644 --- a/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java +++ b/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java @@ -49,11 +49,18 @@ import java.nio.file.StandardOpenOption; import java.util.Collections; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import static org.graalvm.buildtools.utils.SharedConstants.GRAALVM_EXE_EXTENSION; public class NativeImageUtils { + + private static final Pattern requiredVersionPattern = Pattern.compile("^([0-9]+)(?:\\.([0-9]+)?)?(?:\\.([0-9]+)?)?$"); + + private static final Pattern graalvmVersionPattern = Pattern.compile("^GraalVM ([0-9]+)\\.([0-9]+)\\.([0-9]+).*"); + public static void maybeCreateConfigureUtilSymlink(File configureUtilFile, Path nativeImageExecutablePath) { if (!configureUtilFile.exists()) { // possibly the symlink is missing @@ -102,4 +109,44 @@ public static String escapeArg(String arg) { } return arg; } + + /** + * + * @param requiredVersion Required version can be {@code MAJOR}, {@code MAJOR.MINOR} or {@code MAJOR.MINOR.PATCH} + * @param versionToCheck The version to check, as returned by {@code native-image --version} + * @throws IllegalStateException when the version is not correct + */ + public static void checkVersion(String requiredVersion, String versionToCheck) { + Matcher requiredMatcher = requiredVersionPattern.matcher(requiredVersion); + if (!requiredMatcher.matches()) { + throw new IllegalArgumentException("Invalid version " + requiredVersion + ", should be for example \"22\", \"22.3\" or \"22.3.0\"."); + } + Matcher checkedMatcher = graalvmVersionPattern.matcher(versionToCheck); + if (!checkedMatcher.matches()) { + throw new IllegalArgumentException("Version to check '" + versionToCheck + "' can't be parsed."); + } + int requiredMajor = Integer.parseInt(requiredMatcher.group(1)); + int checkedMajor = Integer.parseInt(checkedMatcher.group(1)); + if (checkedMajor < requiredMajor) { + throw new IllegalStateException("GraalVM version " + requiredMajor + " is required but " + checkedMajor + + " has been detected, please upgrade."); + } + if (requiredMatcher.group(2) != null) { + int requiredMinor = Integer.parseInt(requiredMatcher.group(2)); + int checkedMinor = Integer.parseInt(checkedMatcher.group(2)); + if (checkedMinor < requiredMinor) { + throw new IllegalStateException("GraalVM version " + requiredMajor + "." + requiredMinor + + " is required but " + checkedMajor + "." + checkedMinor + " has been detected, please upgrade."); + } + if (requiredMatcher.group(3) != null) { + int requiredPatch = Integer.parseInt(requiredMatcher.group(3)); + int checkedPatch = Integer.parseInt(checkedMatcher.group(3)); + if (checkedPatch < requiredPatch) { + throw new IllegalStateException("GraalVM version " + requiredMajor + "." + requiredMinor + "." + + requiredPatch + " is required but " + checkedMajor + "." + checkedMinor + "." + checkedPatch + + " has been detected, please upgrade."); + } + } + } + } } diff --git a/common/utils/src/test/java/org/graalvm/buildtools/utils/NativeImageUtilsTest.java b/common/utils/src/test/java/org/graalvm/buildtools/utils/NativeImageUtilsTest.java new file mode 100644 index 000000000..59c874200 --- /dev/null +++ b/common/utils/src/test/java/org/graalvm/buildtools/utils/NativeImageUtilsTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * The Universal Permissive License (UPL), Version 1.0 + * + * Subject to the condition set forth below, permission is hereby granted to any + * person obtaining a copy of this software, associated documentation and/or + * data (collectively the "Software"), free of charge and under any and all + * copyright rights in the Software, and any and all patent rights owned or + * freely licensable by each licensor hereunder covering either (i) the + * unmodified Software as contributed to or provided by such licensor, or (ii) + * the Larger Works (as defined below), to deal in both + * + * (a) the Software, and + * + * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if + * one is included with the Software each a "Larger Work" to which the Software + * is contributed by such licensors), + * + * without restriction, including without limitation the rights to copy, create + * derivative works of, display, perform, and distribute the Software and make, + * use, sell, offer for sale, import, export, have made, and have sold the + * Software and the Larger Work(s), and to sublicense the foregoing rights on + * either these or other terms. + * + * This license is subject to the following condition: + * + * The above copyright notice and either this complete permission notice or at a + * minimum a reference to the UPL must be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package org.graalvm.buildtools.utils; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class NativeImageUtilsTest { + + @Test + void invalidVersionToCheck() { + Assertions.assertThrows(IllegalArgumentException.class, () -> + NativeImageUtils.checkVersion("22.3", "invalid")); + Assertions.assertThrows(IllegalArgumentException.class, () -> + NativeImageUtils.checkVersion("22.3", "GraalVM")); + } + + @Test + void invalidRequiredVersion() { + Assertions.assertThrows(IllegalArgumentException.class, () -> + NativeImageUtils.checkVersion("invalid", "GraalVM 22.3.0")); + Assertions.assertThrows(IllegalArgumentException.class, () -> + NativeImageUtils.checkVersion("22.3.0-dev", "GraalVM 22.3.0")); + } + + @Test + void checkGraalVMCEVersion() { + NativeImageUtils.checkVersion("22", "GraalVM 22.3.0 Java 17 CE (Java Version 17.0.5+8-jvmci-22.3-b08)"); + NativeImageUtils.checkVersion("22.3", "GraalVM 22.3.0 Java 17 CE (Java Version 17.0.5+8-jvmci-22.3-b08)"); + NativeImageUtils.checkVersion("22.3.0", "GraalVM 22.3.0 Java 17 CE (Java Version 17.0.5+8-jvmci-22.3-b08)"); + } + + @Test + void checkGraalVMCEDevVersion() { + NativeImageUtils.checkVersion("22", "GraalVM 22.3.0-dev Java 17 CE (Java Version 17.0.5+8-LTS)"); + NativeImageUtils.checkVersion("22.3", "GraalVM 22.3.0-dev Java 17 CE (Java Version 17.0.5+8-LTS)"); + NativeImageUtils.checkVersion("22.3.0", "GraalVM 22.3.0-dev Java 17 CE (Java Version 17.0.5+8-LTS)"); + } + + @Test + void checkGraalVMEEVersion() { + NativeImageUtils.checkVersion("22", "GraalVM 22.3.0 Java 17 EE (Java Version 17.0.5+9-LTS-jvmci-22.3-b07)"); + NativeImageUtils.checkVersion("22.3", "GraalVM 22.3.0 Java 17 EE (Java Version 17.0.5+9-LTS-jvmci-22.3-b07)"); + NativeImageUtils.checkVersion("22.3.0", "GraalVM 22.3.0 Java 17 EE (Java Version 17.0.5+9-LTS-jvmci-22.3-b07)"); + } + + @Test + void checkGreaterVersion() { + NativeImageUtils.checkVersion("22", "GraalVM 23.2.1"); + NativeImageUtils.checkVersion("23.1", "GraalVM 23.2.1"); + NativeImageUtils.checkVersion("23.2.0", "GraalVM 23.2.1"); + } + + @Test + void checkLowerVersion() { + Assertions.assertThrows(IllegalStateException.class, () -> + NativeImageUtils.checkVersion("23", "GraalVM 22.2.1") + ); + Assertions.assertThrows(IllegalStateException.class, () -> + NativeImageUtils.checkVersion("22.3", "GraalVM 22.2.1") + ); + Assertions.assertThrows(IllegalStateException.class, () -> + NativeImageUtils.checkVersion("22.2.2", "GraalVM 22.2.1") + ); + } + +} diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc index 3da908bcd..92bda56ff 100644 --- a/docs/src/docs/asciidoc/index.adoc +++ b/docs/src/docs/asciidoc/index.adoc @@ -19,6 +19,11 @@ If you are using alternative build systems, see < ---- +``:: +If you want to define the minimum GraalVM version, can be `MAJOR`, `MAJOR.MINOR` or `MAJOR.MINOR.PATCH`: +[source,xml] +---- +22.3 +---- + NOTE: Most of the aforementioned properties can also be set from command line as a part of Maven invocation -- for example if you want to temporarily enable verbose mode you can append `-Dverbose` to your Maven invocation. NOTE: If you use GraalVM Enterprise as the `JAVA_HOME` environment, the plugin builds a native image with enterprise features enabled -- for example, an executable will automatically be built with https://medium.com/graalvm/isolates-and-compressed-references-more-flexible-and-efficient-memory-management-for-graalvm-a044cc50b67e[compressed references] and other optimizations enabled. diff --git a/docs/src/docs/snippets/gradle/groovy/build.gradle b/docs/src/docs/snippets/gradle/groovy/build.gradle index 1ef7fc997..137e0c479 100644 --- a/docs/src/docs/snippets/gradle/groovy/build.gradle +++ b/docs/src/docs/snippets/gradle/groovy/build.gradle @@ -121,6 +121,7 @@ graalvmNative { sharedLibrary = false // Determines if image is a shared library, defaults to false if `java-library` plugin isn't included quickBuild = false // Determines if image is being built in quick build mode (alternatively use GRAALVM_QUICK_BUILD environment variable, or add --native-quick-build to the CLI) richOutput = false // Determines if native-image building should be done with rich output + requiredVersion = '22.3' // The minimal GraalVM version, can be `MAJOR`, `MAJOR.MINOR` or `MAJOR.MINOR.PATCH` systemProperties = [name1: 'value1', name2: 'value2'] // Sets the system properties to use for the native image builder configurationFileDirectories.from(file('src/my-config')) // Adds a native image configuration file directory, containing files like reflection configuration diff --git a/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts b/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts index eda5129ea..db7fa6f0c 100644 --- a/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts +++ b/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts @@ -122,6 +122,7 @@ graalvmNative { sharedLibrary.set(false) // Determines if image is a shared library, defaults to false if `java-library` plugin isn't included quickBuild.set(false) // Determines if image is being built in quick build mode (alternatively use GRAALVM_QUICK_BUILD environment variable, or add --native-quick-build to the CLI) richOutput.set(false) // Determines if native-image building should be done with rich output + requiredVersion.set('22.3') // The minimal GraalVM version, can be `MAJOR`, `MAJOR.MINOR` or `MAJOR.MINOR.PATCH` systemProperties.putAll(mapOf("name1" to "value1", "name2" to "value2")) // Sets the system properties to use for the native image builder configurationFileDirectories.from(file("src/my-config")) // Adds a native image configuration file directory, containing files like reflection configuration diff --git a/native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/RequiredVersionTest.groovy b/native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/RequiredVersionTest.groovy new file mode 100644 index 000000000..0c40e9844 --- /dev/null +++ b/native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/RequiredVersionTest.groovy @@ -0,0 +1,48 @@ +package org.graalvm.buildtools.gradle; + +import org.graalvm.buildtools.gradle.fixtures.AbstractFunctionalTest; + +class RequiredVersionTest extends AbstractFunctionalTest { + + def "can build a native image with a valid required version"() { + def nativeApp = file("build/native/nativeCompile/java-application") + + given: + withSample("java-application") + + buildFile << """ + graalvmNative.binaries.all { + requiredVersion = '22.2' + } + """.stripIndent() + + when: + run 'nativeCompile' + + then: + tasks { + succeeded ':jar', ':nativeCompile' + doesNotContain ':build', ':run' + } + + and: + nativeApp.exists() + } + + def "can't build a native image with an invalid required version"() { + given: + withSample("java-application") + + buildFile << """ + graalvmNative.binaries.all { + requiredVersion = '100' + } + """.stripIndent() + + when: + fails 'nativeCompile' + + then: + errorOutputContains "GraalVM version 100 is required but 22 has been detected, please upgrade." + } +} diff --git a/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.java b/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.java index 0a24f1419..b625bb1ae 100644 --- a/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.java +++ b/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.java @@ -314,4 +314,13 @@ public interface NativeImageOptions extends Named { @Input ListProperty getExcludeConfigArgs(); + + /** + * Specify the minimal GraalVM version, can be {@code MAJOR}, {@code MAJOR.MINOR} or {@code MAJOR.MINOR.PATCH}. + * + * @return the required version property. + */ + @Input + @Optional + Property getRequiredVersion(); } diff --git a/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/tasks/BuildNativeImageTask.java b/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/tasks/BuildNativeImageTask.java index ca188c35e..bf7010897 100644 --- a/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/tasks/BuildNativeImageTask.java +++ b/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/tasks/BuildNativeImageTask.java @@ -41,11 +41,19 @@ package org.graalvm.buildtools.gradle.tasks; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.util.List; + +import javax.inject.Inject; + import org.graalvm.buildtools.gradle.NativeImagePlugin; import org.graalvm.buildtools.gradle.dsl.NativeImageOptions; import org.graalvm.buildtools.gradle.internal.GraalVMLogger; import org.graalvm.buildtools.gradle.internal.NativeImageCommandLineProvider; import org.graalvm.buildtools.gradle.internal.NativeImageExecutableLocator; +import org.graalvm.buildtools.utils.NativeImageUtils; import org.gradle.api.DefaultTask; import org.gradle.api.file.Directory; import org.gradle.api.file.DirectoryProperty; @@ -67,10 +75,7 @@ import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.options.Option; import org.gradle.process.ExecOperations; - -import javax.inject.Inject; -import java.io.File; -import java.util.List; +import org.gradle.process.ExecResult; import static org.graalvm.buildtools.gradle.internal.NativeImageExecutableLocator.graalvmHomeProvider; import static org.graalvm.buildtools.utils.SharedConstants.EXECUTABLE_EXTENSION; @@ -195,6 +200,7 @@ public void exec() { getExecOperations(), logger, diagnostics); + checkRequiredVersionIfNeeded(executablePath, options); for (String diagnostic : diagnostics.getDiagnostics()) { logger.lifecycle(diagnostic); } @@ -220,4 +226,19 @@ public void exec() { } } + private void checkRequiredVersionIfNeeded(File executablePath, NativeImageOptions options) { + if (!options.getRequiredVersion().isPresent()) { + return; + } + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ExecResult execResult = getExecOperations().exec(spec -> { + spec.setStandardOutput(outputStream); + spec.args("--version"); + spec.setExecutable(executablePath.getAbsolutePath()); + }); + execResult.assertNormalExitValue(); + String versionToCheck = new String(outputStream.toByteArray(), StandardCharsets.UTF_8).replace("\n", ""); + NativeImageUtils.checkVersion(options.getRequiredVersion().get(), versionToCheck); + } + } diff --git a/native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/RequireVersionFunctionalTest.groovy b/native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/RequireVersionFunctionalTest.groovy new file mode 100644 index 000000000..142edb4cc --- /dev/null +++ b/native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/RequireVersionFunctionalTest.groovy @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * The Universal Permissive License (UPL), Version 1.0 + * + * Subject to the condition set forth below, permission is hereby granted to any + * person obtaining a copy of this software, associated documentation and/or + * data (collectively the "Software"), free of charge and under any and all + * copyright rights in the Software, and any and all patent rights owned or + * freely licensable by each licensor hereunder covering either (i) the + * unmodified Software as contributed to or provided by such licensor, or (ii) + * the Larger Works (as defined below), to deal in both + * + * (a) the Software, and + * + * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if + * one is included with the Software each a "Larger Work" to which the Software + * is contributed by such licensors), + * + * without restriction, including without limitation the rights to copy, create + * derivative works of, display, perform, and distribute the Software and make, + * use, sell, offer for sale, import, export, have made, and have sold the + * Software and the Larger Work(s), and to sublicense the foregoing rights on + * either these or other terms. + * + * This license is subject to the following condition: + * + * The above copyright notice and either this complete permission notice or at a + * minimum a reference to the UPL must be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package org.graalvm.buildtools.maven + +class RequireVersionFunctionalTest extends AbstractGraalVMMavenFunctionalTest { + + def "can build a native image with a valid required version"() { + withSample("java-application") + + when: + mvn '-Pnative', '-DskipTests', 'native:compile' + + then: + buildSucceeded + } + + def "can't build a native image with an invalid required version"() { + withSample("java-application") + + when: + mvn '-Pnative', '-DskipTests', '-DrequiredVersion=100', 'native:compile' + + then: + buildFailed + } + +} diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java index 1497740f6..ed71a1564 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java @@ -41,9 +41,13 @@ package org.graalvm.buildtools.maven; +import java.io.BufferedReader; import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; @@ -159,6 +163,9 @@ public abstract class AbstractNativeImageMojo extends AbstractNativeMojo { @Parameter(property = NATIVE_IMAGE_DRY_RUN, defaultValue = "false") protected boolean dryRun; + @Parameter(property = "requiredVersion") + protected String requiredVersion; + @Component protected ToolchainManager toolchainManager; @@ -375,6 +382,7 @@ protected String getClasspath() throws MojoExecutionException { } protected void buildImage() throws MojoExecutionException { + checkRequiredVersionIfNeeded(); Path nativeImageExecutable = Utils.getNativeImage(logger); try { @@ -407,6 +415,31 @@ protected void buildImage() throws MojoExecutionException { } } + protected void checkRequiredVersionIfNeeded() throws MojoExecutionException { + if (requiredVersion == null) { + return; + } + Path nativeImageExecutable = Utils.getNativeImage(logger); + try { + ProcessBuilder processBuilder = new ProcessBuilder(nativeImageExecutable.toString()); + processBuilder.command().add("--version"); + Process versionCheckProcess = processBuilder.start(); + if (versionCheckProcess.waitFor() != 0) { + String commandString = String.join(" ", processBuilder.command()); + throw new MojoExecutionException("Execution of " + commandString + " returned non-zero result"); + } + InputStream inputStream = versionCheckProcess.getInputStream(); + String versionToCheck = new BufferedReader( + new InputStreamReader(inputStream, StandardCharsets.UTF_8)) + .lines() + .collect(Collectors.joining("\n")); + NativeImageUtils.checkVersion(requiredVersion, versionToCheck); + + } catch (IOException | InterruptedException e) { + throw new MojoExecutionException("Checking GraalVM version with " + nativeImageExecutable + " failed", e); + } + } + protected void maybeAddGeneratedResourcesConfig(List into) { if (resourcesConfigDirectory.exists() || agentResourceDirectory != null) { File[] dirs = resourcesConfigDirectory.listFiles(); diff --git a/samples/java-application/pom.xml b/samples/java-application/pom.xml index 4a45531bf..28e04a23c 100644 --- a/samples/java-application/pom.xml +++ b/samples/java-application/pom.xml @@ -55,6 +55,7 @@ 0.9.17-SNAPSHOT example-app org.graalvm.demo.Application + 22.2 @@ -88,6 +89,7 @@ false ${imageName} false + ${requiredVersion} From 8dcb9e06c96a0ccb782e04ef0dbac4c3fd23a52f Mon Sep 17 00:00:00 2001 From: David Nestorovic Date: Tue, 1 Nov 2022 14:35:55 +0100 Subject: [PATCH 7/8] Bump metadata repo version to 0.2.4 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e2e1315b3..680ce270a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # Project versions nativeBuildTools = "0.9.17-SNAPSHOT" -metadataRepository = "0.2.3" +metadataRepository = "0.2.4" # External dependencies spock = "2.1-groovy-3.0" From 17198a2e4f0e0965f97167031aad36a75bbf8134 Mon Sep 17 00:00:00 2001 From: David Nestorovic Date: Tue, 1 Nov 2022 15:07:47 +0100 Subject: [PATCH 8/8] Bump version to 0.9.17 --- gradle/libs.versions.toml | 2 +- native-maven-plugin/reproducers/issue-144/pom.xml | 4 ++-- samples/java-application-with-custom-packaging/pom.xml | 2 +- samples/java-application-with-custom-tests/gradle.properties | 2 +- .../java-application-with-extra-sourceset/gradle.properties | 2 +- samples/java-application-with-reflection/gradle.properties | 2 +- samples/java-application-with-reflection/pom.xml | 4 ++-- samples/java-application-with-resources/gradle.properties | 2 +- samples/java-application-with-resources/pom.xml | 4 ++-- samples/java-application-with-tests/gradle.properties | 2 +- samples/java-application-with-tests/pom.xml | 4 ++-- samples/java-application/gradle.properties | 2 +- samples/java-application/pom.xml | 4 ++-- samples/java-library/gradle.properties | 2 +- samples/java-library/pom.xml | 4 ++-- samples/kotlin-application-with-tests/gradle.properties | 2 +- samples/metadata-repo-integration/gradle.properties | 2 +- samples/metadata-repo-integration/pom.xml | 4 ++-- samples/multi-project-with-tests/gradle.properties | 2 +- samples/native-config-integration/gradle.properties | 2 +- samples/native-config-integration/pom.xml | 4 ++-- 21 files changed, 29 insertions(+), 29 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 680ce270a..58a860b3d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # Project versions -nativeBuildTools = "0.9.17-SNAPSHOT" +nativeBuildTools = "0.9.17" metadataRepository = "0.2.4" # External dependencies diff --git a/native-maven-plugin/reproducers/issue-144/pom.xml b/native-maven-plugin/reproducers/issue-144/pom.xml index b370e3c52..1541c4049 100644 --- a/native-maven-plugin/reproducers/issue-144/pom.xml +++ b/native-maven-plugin/reproducers/issue-144/pom.xml @@ -56,8 +56,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-custom-packaging/pom.xml b/samples/java-application-with-custom-packaging/pom.xml index 06be2de92..5d9bb580f 100644 --- a/samples/java-application-with-custom-packaging/pom.xml +++ b/samples/java-application-with-custom-packaging/pom.xml @@ -61,7 +61,7 @@ 3.3.4 org.graalvm.demo.Application netty - 0.9.17-SNAPSHOT + 0.9.17 diff --git a/samples/java-application-with-custom-tests/gradle.properties b/samples/java-application-with-custom-tests/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-application-with-custom-tests/gradle.properties +++ b/samples/java-application-with-custom-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-extra-sourceset/gradle.properties b/samples/java-application-with-extra-sourceset/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-application-with-extra-sourceset/gradle.properties +++ b/samples/java-application-with-extra-sourceset/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/gradle.properties b/samples/java-application-with-reflection/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-application-with-reflection/gradle.properties +++ b/samples/java-application-with-reflection/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-reflection/pom.xml b/samples/java-application-with-reflection/pom.xml index 1378fc8af..a6fe9ec6b 100644 --- a/samples/java-application-with-reflection/pom.xml +++ b/samples/java-application-with-reflection/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-resources/gradle.properties b/samples/java-application-with-resources/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-application-with-resources/gradle.properties +++ b/samples/java-application-with-resources/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-resources/pom.xml b/samples/java-application-with-resources/pom.xml index 0f590f271..ee1eb3d66 100644 --- a/samples/java-application-with-resources/pom.xml +++ b/samples/java-application-with-resources/pom.xml @@ -51,9 +51,9 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT + 0.9.17 5.8.1 - 0.9.17-SNAPSHOT + 0.9.17 example-app org.graalvm.demo.Application diff --git a/samples/java-application-with-tests/gradle.properties b/samples/java-application-with-tests/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-application-with-tests/gradle.properties +++ b/samples/java-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application-with-tests/pom.xml b/samples/java-application-with-tests/pom.xml index ea5128989..4eaf3b92c 100644 --- a/samples/java-application-with-tests/pom.xml +++ b/samples/java-application-with-tests/pom.xml @@ -52,8 +52,8 @@ 1.8 UTF-8 5.8.1 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 example-app org.graalvm.demo.Application diff --git a/samples/java-application/gradle.properties b/samples/java-application/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-application/gradle.properties +++ b/samples/java-application/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-application/pom.xml b/samples/java-application/pom.xml index 28e04a23c..ea5856ea2 100644 --- a/samples/java-application/pom.xml +++ b/samples/java-application/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 example-app org.graalvm.demo.Application 22.2 diff --git a/samples/java-library/gradle.properties b/samples/java-library/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/java-library/gradle.properties +++ b/samples/java-library/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/java-library/pom.xml b/samples/java-library/pom.xml index 007252656..24f8ae395 100644 --- a/samples/java-library/pom.xml +++ b/samples/java-library/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 java-library diff --git a/samples/kotlin-application-with-tests/gradle.properties b/samples/kotlin-application-with-tests/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/kotlin-application-with-tests/gradle.properties +++ b/samples/kotlin-application-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/metadata-repo-integration/gradle.properties b/samples/metadata-repo-integration/gradle.properties index 6bd9fbb10..e8afb5b61 100644 --- a/samples/metadata-repo-integration/gradle.properties +++ b/samples/metadata-repo-integration/gradle.properties @@ -1,4 +1,4 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 h2.version = 2.1.210 netty.version = 4.1.80.Final logback.version = 1.4.4 diff --git a/samples/metadata-repo-integration/pom.xml b/samples/metadata-repo-integration/pom.xml index 7574c5566..74b431deb 100644 --- a/samples/metadata-repo-integration/pom.xml +++ b/samples/metadata-repo-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 2.1.210 4.1.80.Final 1.4.4 diff --git a/samples/multi-project-with-tests/gradle.properties b/samples/multi-project-with-tests/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/multi-project-with-tests/gradle.properties +++ b/samples/multi-project-with-tests/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/gradle.properties b/samples/native-config-integration/gradle.properties index 7e6527205..0f0eb509b 100644 --- a/samples/native-config-integration/gradle.properties +++ b/samples/native-config-integration/gradle.properties @@ -1,3 +1,3 @@ -native.gradle.plugin.version = 0.9.17-SNAPSHOT +native.gradle.plugin.version = 0.9.17 junit.jupiter.version = 5.8.1 junit.platform.version = 1.8.1 diff --git a/samples/native-config-integration/pom.xml b/samples/native-config-integration/pom.xml index d245ff17b..2d6f8d360 100644 --- a/samples/native-config-integration/pom.xml +++ b/samples/native-config-integration/pom.xml @@ -51,8 +51,8 @@ 1.8 UTF-8 - 0.9.17-SNAPSHOT - 0.9.17-SNAPSHOT + 0.9.17 + 0.9.17 example-app org.graalvm.example.Application