Skip to content

Commit

Permalink
Fix generatedCode output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Jun 6, 2021
1 parent fd40c8e commit d8fd0b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -78,10 +78,10 @@ public Set<File> 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
Expand Down

0 comments on commit d8fd0b9

Please sign in to comment.