apply nested JAR dependencies to every remapJar task which nests

dev/0.11
Adrian Siekierka 2019-04-22 01:25:03 +02:00
parent 7c25b0399c
commit 3094d70731
2 changed files with 13 additions and 4 deletions

View File

@ -34,7 +34,7 @@ dependencies {
implementation ('org.zeroturnaround:zt-zip:1.13')
implementation ('com.google.code.gson:gson:2.8.5')
implementation ('com.google.guava:guava:27.1-jre')
implementation ('net.fabricmc:stitch:0.1.2.49') {
implementation ('net.fabricmc:stitch:0.1.2.50') {
exclude module: 'enigma'
}
implementation ('net.fabricmc:tiny-remapper:0.1.0.33') {
@ -42,7 +42,7 @@ dependencies {
}
implementation ('org.jetbrains:intellij-fernflower:1.0.0.8')
implementation ('net.fabricmc:sponge-mixin:0.7.11.22') {
implementation ('net.fabricmc:sponge-mixin:0.7.11.23') {
exclude module: 'launchwrapper'
exclude module: 'guava'
}

View File

@ -267,8 +267,17 @@ public class AbstractPlugin implements Plugin<Project> {
remapJarTask.doLast(task -> project1.getArtifacts().add("archives", remapJarTask.jar));
remapJarTask.dependsOn(project1.getTasks().getByName("jar"));
project1.getTasks().getByName("build").dependsOn(remapJarTask);
Map<Project, Set<Task>> taskMap = project.getAllTasks(true);
for (Map.Entry<Project, Set<Task>> entry : taskMap.entrySet()) {
Set<Task> taskSet = entry.getValue();
for (Task task : taskSet) {
if (task instanceof RemapJar && ((RemapJar) task).isNestJar()) {
//Run all the sub project remap jars tasks before the root projects jar, this is to allow us to include projects
NestedJars.getRequiredTasks(project1).forEach(remapJarTask::dependsOn);
NestedJars.getRequiredTasks(project1).forEach(task::dependsOn);
}
}
}
try {
AbstractArchiveTask sourcesTask = (AbstractArchiveTask) project1.getTasks().getByName("sourcesJar");