Attempt to look in the root project for the loom version if required

dev/0.11
modmuss50 2019-04-14 19:08:26 +01:00
parent 60ec4c1fdb
commit c9aaa68e5f
2 changed files with 5 additions and 3 deletions

View File

@ -64,9 +64,7 @@ public class AbstractPlugin implements Plugin<Project> {
public void apply(Project target) { public void apply(Project target) {
this.project = target; this.project = target;
if(isRootProject(target)){
project.getLogger().lifecycle("Fabric Loom: " + AbstractPlugin.class.getPackage().getImplementationVersion()); project.getLogger().lifecycle("Fabric Loom: " + AbstractPlugin.class.getPackage().getImplementationVersion());
}
// Apply default plugins // Apply default plugins
project.apply(ImmutableMap.of("plugin", "java")); project.apply(ImmutableMap.of("plugin", "java"));

View File

@ -157,6 +157,10 @@ public class LoomGradleExtension {
return false; return false;
}); });
if(dependency == null && !AbstractPlugin.isRootProject(project)){
return project.getRootProject().getExtensions().getByType(LoomGradleExtension.class).getLoomVersion();
}
return dependency != null ? dependency.getVersion() : null; return dependency != null ? dependency.getVersion() : null;
} }