Setup the test sourceset better when using split sources. (#1179)

* Setup the test sourceset better when using split sources.

Fixes #1060

Also added a tool to extract test projects to make them easier to work on.

* Fix
This commit is contained in:
modmuss
2024-09-26 20:39:22 +01:00
committed by GitHub
parent bc9ce581e4
commit 567f978578
6 changed files with 115 additions and 3 deletions

View File

@@ -205,6 +205,12 @@ public abstract sealed class MinecraftSourceSets permits MinecraftSourceSets.Sin
extendsFrom(project, clientOnlySourceSet.getCompileClasspathConfigurationName(), mainSourceSet.getCompileClasspathConfigurationName());
extendsFrom(project, clientOnlySourceSet.getRuntimeClasspathConfigurationName(), mainSourceSet.getRuntimeClasspathConfigurationName());
// Test source set depends on client
final SourceSet testSourceSet = SourceSetHelper.getSourceSetByName(SourceSet.TEST_SOURCE_SET_NAME, project);
extendsFrom(project, testSourceSet.getCompileClasspathConfigurationName(), clientOnlySourceSet.getCompileClasspathConfigurationName());
extendsFrom(project, testSourceSet.getRuntimeClasspathConfigurationName(), clientOnlySourceSet.getRuntimeClasspathConfigurationName());
project.getDependencies().add(testSourceSet.getImplementationConfigurationName(), clientOnlySourceSet.getOutput());
RemapConfigurations.configureClientConfigurations(project, clientOnlySourceSet);
// Include the client only output in the jars