diff --git a/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java b/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java index 9e252dcb0fb33..50f315897cd65 100644 --- a/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java +++ b/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java @@ -305,6 +305,7 @@ private BuildResult runAugment(boolean firstRun, Set changedResources, .setTargetDir(quarkusBootstrap.getTargetDirectory()) .setDeploymentClassLoader(deploymentClassLoader) .setBuildSystemProperties(quarkusBootstrap.getBuildSystemProperties()) + .setRuntimeProperties(quarkusBootstrap.getRuntimeProperties()) .setEffectiveModel(curatedApplication.getApplicationModel()) .setDependencyInfoProvider(quarkusBootstrap.getDependencyInfoProvider()); if (quarkusBootstrap.getBaseName() != null) { diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangDevModeLauncherImpl.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangDevModeLauncherImpl.java index 207281a09cb35..49dbca6aee629 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangDevModeLauncherImpl.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangDevModeLauncherImpl.java @@ -15,6 +15,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Map; +import java.util.Properties; import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -85,7 +86,7 @@ public static Closeable main(String... args) { Path srcDir = projectRoot.resolve("src/main/java"); Files.createDirectories(srcDir); - Files.createSymbolicLink(srcDir.resolve(sourceFile.getFileName().toString()), sourceFile); + Path source = Files.createSymbolicLink(srcDir.resolve(sourceFile.getFileName().toString()), sourceFile); final LocalProject currentProject = LocalProject.loadWorkspace(projectRoot); final ResolvedDependency appArtifact = ResolvedDependencyBuilder.newInstance() .setCoords(currentProject.getAppArtifact(ArtifactCoords.TYPE_JAR)) @@ -93,6 +94,8 @@ public static Closeable main(String... args) { .setWorkspaceModule(currentProject.toWorkspaceModule()) .build(); + Properties configurationProperties = getConfigurationProperties(source); + //todo : proper support for everything final QuarkusBootstrap.Builder builder = QuarkusBootstrap.builder() .setBaseClassLoader(JBangDevModeLauncherImpl.class.getClassLoader()) @@ -117,7 +120,9 @@ public static Closeable main(String... args) { return artifact; }).collect(Collectors.toList())) .setApplicationRoot(targetClasses) - .setProjectRoot(projectRoot); + .setProjectRoot(projectRoot) + .setBuildSystemProperties(configurationProperties) + .setRuntimeProperties(configurationProperties); Map context = new HashMap<>(); context.put("app-project", currentProject); @@ -174,4 +179,19 @@ private static String getQuarkusVersion() { throw new RuntimeException(e); } } + + private static Properties getConfigurationProperties(final Path source) throws IOException { + Properties properties = new Properties(); + for (String line : Files.readAllLines(source)) { + if (line.startsWith("//Q:CONFIG")) { + String conf = line.substring(10).trim(); + int equals = conf.indexOf("="); + if (equals == -1) { + throw new RuntimeException("invalid config " + line); + } + properties.setProperty(conf.substring(0, equals), conf.substring(equals + 1)); + } + } + return properties; + } }