Skip to content

Commit

Permalink
Fix data gen folder not being added to resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Dec 9, 2023
1 parent 3df66d6 commit cf8cbb2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import java.io.UncheckedIOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.xml.parsers.DocumentBuilder;
Expand Down Expand Up @@ -104,7 +106,6 @@ public void configureDataGeneration(Action<DataGenerationSettings> action) {
DataGenerationSettings settings = getProject().getObjects().newInstance(DataGenerationSettings.class);
settings.getOutputDirectory().set(getProject().file("src/main/generated"));
settings.getCreateRunConfiguration().convention(true);
settings.getCreateSourceSet().convention(true);
settings.getCreateSourceSet().convention(false);
settings.getStrictValidation().convention(false);
settings.getAddToResources().convention(true);
Expand All @@ -117,7 +118,9 @@ public void configureDataGeneration(Action<DataGenerationSettings> action) {
if (settings.getAddToResources().get()) {
mainSourceSet.resources(files -> {
// Add the src/main/generated to the main sourceset's resources.
files.getSrcDirs().add(outputDirectory);
Set<File> srcDirs = new HashSet<>(files.getSrcDirs());
srcDirs.add(outputDirectory);
files.setSrcDirs(srcDirs);
});
}

Expand Down

0 comments on commit cf8cbb2

Please sign in to comment.