Skip to content

Commit

Permalink
Really really fix the implicit task dependencies bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGregory084 committed Jul 17, 2023
1 parent 56cbcd4 commit fd5e0a2
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.jvm.tasks.Jar;

import java.io.File;
import java.nio.file.Path;
Expand Down Expand Up @@ -111,9 +112,10 @@ private void configureBuildInfoTask(
tasks.getByName(mainSourceSet.getCompileJavaTaskName())
.dependsOn(generateBuildInfoTask);

if (tasks.getNames().contains(mainSourceSet.getSourcesJarTaskName())) {
tasks.getByName(mainSourceSet.getSourcesJarTaskName())
.dependsOn(generateBuildInfoTask);
}
tasks.withType(Jar.class).configureEach(task -> {
if (task.getName().equals(mainSourceSet.getSourcesJarTaskName())) {
task.dependsOn(generateBuildInfoTask);
}
});
}
}

0 comments on commit fd5e0a2

Please sign in to comment.