Skip to content

Commit

Permalink
Merge pull request #38938 from radcortez/fix-38557
Browse files Browse the repository at this point in the history
Propagate user.dir to Gradle worker
  • Loading branch information
gsmet authored Feb 22, 2024
2 parents 8b1b93e + f3a45e9 commit 55dad2c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ WorkQueue workQueue(Map<String, String> configMap, Supplier<List<Action<? super
private void configureProcessWorkerSpec(ProcessWorkerSpec processWorkerSpec, Map<String, String> configMap,
List<Action<? super JavaForkOptions>> customizations) {
JavaForkOptions forkOptions = processWorkerSpec.getForkOptions();

customizations.forEach(a -> a.execute(forkOptions));

// Propagate user.dir to load config sources that use it (instead of the worker user.dir)
String userDir = configMap.get("user.dir");
if (userDir != null) {
forkOptions.systemProperty("user.dir", userDir);
}

String quarkusWorkerMaxHeap = System.getProperty("quarkus.gradle-worker.max-heap");
if (quarkusWorkerMaxHeap != null && forkOptions.getAllJvmArgs().stream().noneMatch(arg -> arg.startsWith("-Xmx"))) {
forkOptions.jvmArgs("-Xmx" + quarkusWorkerMaxHeap);
Expand Down

0 comments on commit 55dad2c

Please sign in to comment.