File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
main/java/net/fabricmc/loom/configuration/decompile
test/groovy/net/fabricmc/loom/test/integration Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,19 @@ public void afterEvaluation() {
79
79
for (DecompilerOptions options : extension .getDecompilerOptions ()) {
80
80
final String decompilerName = options .getFormattedName ();
81
81
82
+ var commonTask = project .getTasks ().named ("gen%sSourcesWith%s" .formatted ("Common" , decompilerName ));
83
+ var clientOnlyTask = project .getTasks ().named ("gen%sSourcesWith%s" .formatted ("ClientOnly" , decompilerName ));
84
+
85
+ clientOnlyTask .configure (task -> {
86
+ task .mustRunAfter (commonTask );
87
+ });
88
+
82
89
project .getTasks ().register ("genSourcesWith" + decompilerName , task -> {
83
90
task .setDescription ("Decompile minecraft using %s." .formatted (decompilerName ));
84
91
task .setGroup (Constants .TaskGroup .FABRIC );
85
92
86
- task .dependsOn (project . getTasks (). named ( "gen%sSourcesWith%s" . formatted ( "Common" , decompilerName )) );
87
- task .dependsOn (project . getTasks (). named ( "gen%sSourcesWith%s" . formatted ( "ClientOnly" , decompilerName )) );
93
+ task .dependsOn (commonTask );
94
+ task .dependsOn (clientOnlyTask );
88
95
});
89
96
}
90
97
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import spock.lang.Unroll
29
29
30
30
import net.fabricmc.loom.test.util.GradleProjectTestTrait
31
31
32
+ import static net.fabricmc.loom.test.LoomTestConstants.PRE_RELEASE_GRADLE
32
33
import static net.fabricmc.loom.test.LoomTestConstants.STANDARD_TEST_VERSIONS
33
34
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
34
35
@@ -48,4 +49,16 @@ class SplitProjectTest extends Specification implements GradleProjectTestTrait {
48
49
where :
49
50
version << STANDARD_TEST_VERSIONS
50
51
}
52
+
53
+ @Unroll
54
+ def " genSources (gradle #version)" () {
55
+ setup :
56
+ def gradle = gradleProject(project : " splitSources" , version : PRE_RELEASE_GRADLE )
57
+
58
+ when :
59
+ def result = gradle. run(tasks : [" genSources" ])
60
+
61
+ then :
62
+ result. task(" :genSources" ). outcome == SUCCESS
63
+ }
51
64
}
You can’t perform that action at this time.
0 commit comments