Only generate the run configs on the root project
parent
a9a160b0bf
commit
c43e771ef5
|
@ -65,7 +65,9 @@ public class AbstractPlugin implements Plugin<Project> {
|
||||||
public void apply(Project target) {
|
public void apply(Project target) {
|
||||||
this.project = target;
|
this.project = target;
|
||||||
|
|
||||||
project.getLogger().lifecycle("Fabric Loom: " + AbstractPlugin.class.getPackage().getImplementationVersion());
|
if(isRootProject(target)){
|
||||||
|
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"));
|
||||||
|
@ -281,4 +283,8 @@ public class AbstractPlugin implements Plugin<Project> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isRootProject(Project project){
|
||||||
|
return project.getRootProject() == project;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
package net.fabricmc.loom.task;
|
package net.fabricmc.loom.task;
|
||||||
|
|
||||||
|
import net.fabricmc.loom.AbstractPlugin;
|
||||||
import net.fabricmc.loom.LoomGradleExtension;
|
import net.fabricmc.loom.LoomGradleExtension;
|
||||||
import net.fabricmc.loom.util.RunConfig;
|
import net.fabricmc.loom.util.RunConfig;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
|
@ -50,6 +51,10 @@ public class GenIdeaProjectTask extends DefaultLoomTask {
|
||||||
@TaskAction
|
@TaskAction
|
||||||
public void genIdeaRuns() throws IOException, ParserConfigurationException, SAXException, TransformerException {
|
public void genIdeaRuns() throws IOException, ParserConfigurationException, SAXException, TransformerException {
|
||||||
Project project = this.getProject();
|
Project project = this.getProject();
|
||||||
|
//Only generate the idea runs on the root project
|
||||||
|
if(!AbstractPlugin.isRootProject(project)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
|
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
|
||||||
project.getLogger().lifecycle(":Building idea workspace");
|
project.getLogger().lifecycle(":Building idea workspace");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue