From 36f9fb743fad2434e68e8776c7a7efe1226e1abb Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Tue, 4 Apr 2023 12:23:43 -0400 Subject: [PATCH] afk rebase' --- .../java/io/quarkus/gradle/QuarkusPlugin.java | 2 +- .../io/quarkus/gradle/tasks/QuarkusRun.java | 25 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java index bb0494aef2c54..32b655aba7a49 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java @@ -48,8 +48,8 @@ import io.quarkus.gradle.tasks.QuarkusListPlatforms; import io.quarkus.gradle.tasks.QuarkusRemoteDev; import io.quarkus.gradle.tasks.QuarkusRemoveExtension; -import io.quarkus.gradle.tasks.QuarkusShowEffectiveConfig; import io.quarkus.gradle.tasks.QuarkusRun; +import io.quarkus.gradle.tasks.QuarkusShowEffectiveConfig; import io.quarkus.gradle.tasks.QuarkusTest; import io.quarkus.gradle.tasks.QuarkusTestConfig; import io.quarkus.gradle.tasks.QuarkusUpdate; diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRun.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRun.java index 62380497827e2..8f7ec9e4c9a17 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRun.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRun.java @@ -37,8 +37,9 @@ import io.quarkus.deployment.cmd.RunCommandHandler; import io.quarkus.gradle.extension.QuarkusPluginExtension; import io.quarkus.maven.dependency.GACTV; +import io.quarkus.maven.dependency.ResolvedDependency; -public class QuarkusRun extends QuarkusTask { +public abstract class QuarkusRun extends QuarkusTask { private final Property workingDirectory; private final SourceSet mainSourceSet; @@ -113,6 +114,28 @@ public Map getQuarkusBuildEnvProperties() { return quarkusEnvProperties; } + protected Properties getBuildSystemProperties(ResolvedDependency appArtifact) { + final Map properties = getProject().getProperties(); + final Properties realProperties = new Properties(); + for (Map.Entry entry : properties.entrySet()) { + final String key = entry.getKey(); + final Object value = entry.getValue(); + if (key != null && value instanceof String && key.startsWith("quarkus.")) { + realProperties.setProperty(key, (String) value); + } + } + Map quarkusBuildProperties = extension().getQuarkusBuildProperties().get(); + if (!quarkusBuildProperties.isEmpty()) { + quarkusBuildProperties.entrySet().stream().filter(entry -> entry.getKey().startsWith("quarkus.")) + .forEach(entry -> { + realProperties.put(entry.getKey(), entry.getValue()); + }); + } + realProperties.putIfAbsent("quarkus.application.name", appArtifact.getArtifactId()); + realProperties.putIfAbsent("quarkus.application.version", appArtifact.getVersion()); + return realProperties; + } + @TaskAction public void runQuarkus() { final ApplicationModel appModel;