mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
First pass on "shareCaches".
This commit is contained in:
@@ -61,6 +61,7 @@ public class LoomGradleExtension {
|
||||
public String customManifest = null;
|
||||
public File accessWidener = null;
|
||||
public Function<String, Object> intermediaryUrl = mcVer -> "https://maven.fabricmc.net/net/fabricmc/intermediary/" + mcVer + "/intermediary-" + mcVer + "-v2.jar";
|
||||
public boolean shareCaches = false;
|
||||
|
||||
private List<Path> unmappedModsBuilt = new ArrayList<>();
|
||||
|
||||
@@ -338,4 +339,24 @@ public class LoomGradleExtension {
|
||||
//Done like this to work around this possibly not being a java string...
|
||||
return s -> intermediaryUrl.apply(s).toString();
|
||||
}
|
||||
|
||||
public boolean isRootProject() {
|
||||
return project.getRootProject() == project;
|
||||
}
|
||||
|
||||
public LoomGradleExtension getRootGradleExtension() {
|
||||
if (isRootProject()) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return project.getRootProject().getExtensions().getByType(LoomGradleExtension.class);
|
||||
}
|
||||
|
||||
public LoomGradleExtension getSharedGradleExtension() {
|
||||
return isShareCaches() ? getRootGradleExtension() : this;
|
||||
}
|
||||
|
||||
public boolean isShareCaches() {
|
||||
return shareCaches;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user