I am trying to figure out how to solve this new issue in gradle 7.1.1 but do it in my plugin this time instead β Gradle 7.1.1 broke sourceSet redirect?
I read this code in the java plugin
private void configureSourceSets(Project project, JavaPluginExtension pluginExtension, BuildOutputCleanupRegistry buildOutputCleanupRegistry) {
SourceSetContainer sourceSets = pluginExtension.getSourceSets();
SourceSet main = (SourceSet)sourceSets.create("main");
SourceSet test = (SourceSet)sourceSets.create("test");
test.setCompileClasspath(project.getObjects().fileCollection().from(new Object[]{main.getOutput(), project.getConfigurations().getByName("testCompileClasspath")}));
test.setRuntimeClasspath(project.getObjects().fileCollection().from(new Object[]{test.getOutput(), main.getOutput(), project.getConfigurations().getByName("testRuntimeClasspath")}));
sourceSets.all((sourceSet) -> {
buildOutputCleanupRegistry.registerOutputs(sourceSet.getOutput());
});
}
Using the above as an example, I think I want to call
main.setRuntimeClasspath(.) for files src/main/java//*.html
test.setRuntimeClasspath(β¦) for files in src/test/java//*html
This is a βsetβ method though and I donβt want to erase the classpath and replace. I only want to add to the classpath that is being set in the above code. Is there a way to do that?
thanks,
Dean