From 34f560a6186ea27f456ec3dea981e7fa3de6c5e9 Mon Sep 17 00:00:00 2001 From: Aleksandar Gradinac Date: Tue, 15 Jun 2021 17:14:15 +0200 Subject: [PATCH] Fix the search path for agent collected config in the agent mode --- .../org/graalvm/buildtools/gradle/dsl/NativeImageOptions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 d53a04448..82c577fe5 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 @@ -175,8 +175,8 @@ protected void configure(Project project, String sourceSetName) { } if (project.hasProperty(Utils.AGENT_PROPERTY) || getAgent().get()) { - Path agentOutput = GradleUtils.getTargetDir(project) - .resolve(Utils.AGENT_OUTPUT_FOLDER).toAbsolutePath(); + Path agentOutput = project.getBuildDir().toPath() + .resolve(Utils.AGENT_OUTPUT_FOLDER).resolve(sourceSetName).toAbsolutePath(); if (!agentOutput.toFile().exists()) { // Maybe user chose to persist configuration into the codebase, so lets also check if that folder exists.