mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
Allow accessTransformer to be configured
Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
@@ -87,6 +87,7 @@ public class LoomGradleExtension {
|
||||
public boolean remapMod = true;
|
||||
public String customManifest = null;
|
||||
public File accessWidener = null;
|
||||
public File accessTransformer = null;
|
||||
public Function<String, Object> intermediaryUrl = mcVer -> "https://maven.fabricmc.net/net/fabricmc/intermediary/" + mcVer + "/intermediary-" + mcVer + "-v2.jar";
|
||||
public boolean shareCaches = false;
|
||||
public List<String> mixinConfigs = new ArrayList<>(); // FORGE: Passed to Minecraft
|
||||
@@ -280,6 +281,10 @@ public class LoomGradleExtension {
|
||||
this.accessWidener = project.file(file);
|
||||
}
|
||||
|
||||
public void accessTransformer(Object file) {
|
||||
this.accessTransformer = project.file(file);
|
||||
}
|
||||
|
||||
public File getUserCache() {
|
||||
File userCache = new File(project.getGradle().getGradleUserHomeDir(), "caches" + File.separator + "fabric-loom");
|
||||
|
||||
|
||||
@@ -123,15 +123,18 @@ public class MinecraftPatchedProvider extends DependencyProvider {
|
||||
public void initFiles() throws IOException {
|
||||
filesDirty = false;
|
||||
projectAtHash = new File(getExtension().getProjectPersistentCache(), "at.sha256");
|
||||
projectAt = getExtension().accessTransformer;
|
||||
|
||||
SourceSet main = getProject().getConvention().findPlugin(JavaPluginConvention.class).getSourceSets().getByName("main");
|
||||
if (projectAt == null) {
|
||||
SourceSet main = getProject().getConvention().findPlugin(JavaPluginConvention.class).getSourceSets().getByName("main");
|
||||
|
||||
for (File srcDir : main.getResources().getSrcDirs()) {
|
||||
File projectAt = new File(srcDir, "META-INF/accesstransformer.cfg");
|
||||
for (File srcDir : main.getResources().getSrcDirs()) {
|
||||
File projectAt = new File(srcDir, "META-INF/accesstransformer.cfg");
|
||||
|
||||
if (projectAt.exists()) {
|
||||
this.projectAt = projectAt;
|
||||
break;
|
||||
if (projectAt.exists()) {
|
||||
this.projectAt = projectAt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user