From d8fd0b974b89a36018995475a44f40fa04dcdd55 Mon Sep 17 00:00:00 2001 From: Guillaume Le Floch Date: Sun, 6 Jun 2021 20:12:29 +0200 Subject: [PATCH] Fix generatedCode output dir --- .../src/main/java/io/quarkus/gradle/QuarkusPlugin.java | 4 ---- .../java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java index f1a8c420e5bf4..68c30b0de1272 100644 --- a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java +++ b/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java @@ -217,11 +217,7 @@ public void execute(Task test) { tasks.withType(Test.class).whenTaskAdded(configureTestTask::accept); SourceSet generatedSourceSet = sourceSets.create(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES); - generatedSourceSet.getOutput() - .dir(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES); SourceSet generatedTestSourceSet = sourceSets.create(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES); - generatedTestSourceSet.getOutput() - .dir(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES); // Register the quarkus-generated-code for (String provider : QuarkusGenerateCode.CODE_GENERATION_PROVIDER) { diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java index e34da5d08d799..cb291cb5c6cf0 100644 --- a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java +++ b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java @@ -20,7 +20,7 @@ import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.api.tasks.CompileClasspath; import org.gradle.api.tasks.InputFiles; -import org.gradle.api.tasks.OutputDirectories; +import org.gradle.api.tasks.OutputDirectory; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskAction; @@ -78,10 +78,10 @@ public Set getInputDirectory() { return inputDirectories; } - @OutputDirectories - public FileCollection getGeneratedOutputDirectory() { + @OutputDirectory + public File getGeneratedOutputDirectory() { final String generatedSourceSetName = test ? QUARKUS_TEST_GENERATED_SOURCES : QUARKUS_GENERATED_SOURCES; - return QuarkusGradleUtils.getSourceSet(getProject(), generatedSourceSetName).getOutput().getDirs(); + return QuarkusGradleUtils.getSourceSet(getProject(), generatedSourceSetName).getJava().getOutputDir(); } @TaskAction