mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 21:05:58 -05:00
Lazily eval jar tasks.
This commit is contained in:
@@ -210,14 +210,14 @@ public abstract sealed class MinecraftSourceSets permits MinecraftSourceSets.Sin
|
||||
});
|
||||
|
||||
// The sources task can be registered at a later time.
|
||||
project.getTasks().withType(Jar.class, sources -> {
|
||||
if (!mainSourceSet.getSourcesJarTaskName().equals(sources.getName())) {
|
||||
project.getTasks().configureEach(task -> {
|
||||
if (!mainSourceSet.getSourcesJarTaskName().equals(task.getName()) || !(task instanceof Jar jar)) {
|
||||
// Not the sources task we are looking for.
|
||||
return;
|
||||
}
|
||||
|
||||
// The client only sources to the combined sources jar.
|
||||
sources.from(clientOnlySourceSet.getAllSource());
|
||||
jar.from(clientOnlySourceSet.getAllSource());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user