pull in annotationProcessor dependencies from fabric-loader JSON too

This commit is contained in:
asie
2019-05-27 22:14:35 +02:00
parent 89d207d06b
commit 4134c7ef50
3 changed files with 15 additions and 7 deletions

View File

@@ -139,12 +139,13 @@ public class LoomGradleExtension {
}
@Nullable
private static Dependency findDependency(Collection<Configuration> configs, BiPredicate<String, String> groupNameFilter) {
private static Dependency findDependency(Project p, Collection<Configuration> configs, BiPredicate<String, String> groupNameFilter) {
for (Configuration config : configs) {
for (Dependency dependency : config.getDependencies()) {
String group = dependency.getGroup();
String name = dependency.getName();
if (groupNameFilter.test(group, name)) {
p.getLogger().debug("Loom findDependency found: " + group + ":" + name + ":" + dependency.getVersion());
return dependency;
}
}
@@ -171,12 +172,12 @@ public class LoomGradleExtension {
private Dependency getMixinDependency() {
return recurseProjects((p) -> {
List<Configuration> configs = new ArrayList<>();
// check compile first
configs.add(p.getConfigurations().getByName("compile"));
// check compile classpath first
configs.add(p.getConfigurations().getByName("compileClasspath"));
// failing that, buildscript
configs.addAll(p.getBuildscript().getConfigurations());
return findDependency(configs, (group, name) -> {
return findDependency(p, configs, (group, name) -> {
if (name.equalsIgnoreCase("mixin") && group.equalsIgnoreCase("org.spongepowered")) {
return true;
}