Skip to content

Commit

Permalink
Update default target for metadataCopy task
Browse files Browse the repository at this point in the history
  • Loading branch information
dnestoro committed Mar 6, 2024
1 parent c791bf6 commit 5f8ca42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/docs/snippets/gradle/groovy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ graalvmNative {
// Copies metadata collected from tasks into the specified directories.
metadataCopy {
inputTaskNames.add("test") // Tasks previously executed with the agent attached.
outputDirectories.add("src/main/resources/META-INF/native-image")
outputDirectories.add("src/main/resources/META-INF/native-image/<groupId>/<artifactId>/") // Replace <groupId> and <artifactId> with GAV coordinates of your project
mergeWithExisting = true // Instead of copying, merge with existing metadata in the output directories.
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/snippets/gradle/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ graalvmNative {
// Copies metadata collected from tasks into the specified directories.
metadataCopy {
inputTaskNames.add("test") // Tasks previously executed with the agent attached.
outputDirectories.add("src/main/resources/META-INF/native-image")
outputDirectories.add("src/main/resources/META-INF/native-image/<groupId>/<artifactId>/") // Replace <groupId> and <artifactId> with GAV coordinates of your project
mergeWithExisting.set(true) // Instead of copying, merge with existing metadata in the output directories.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ public void execute() throws MojoExecutionException {
String buildDirectory = project.getBuild().getDirectory() + "/native/agent-output/";
String destinationDir = config.getOutputDirectory();
if (destinationDir == null) {
destinationDir = project.getBuild().getOutputDirectory() + DEFAULT_OUTPUT_DIRECTORY;
destinationDir = project.getBuild().getOutputDirectory()
.concat(DEFAULT_OUTPUT_DIRECTORY).concat("/")
.concat(project.getGroupId()).concat("/")
.concat(project.getArtifactId());
}

if (!Files.isDirectory(Paths.get(destinationDir))) {
Expand Down

0 comments on commit 5f8ca42

Please sign in to comment.