mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Allow specifying additional decompilers for generating sources (#213)
* decompilers * cleanup * oops * weird import * public * public 2 electric boogalo * move over fabric specific * ok * move to api package
This commit is contained in:
@@ -45,6 +45,7 @@ import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.Dependency;
|
||||
import org.gradle.api.plugins.BasePluginConvention;
|
||||
|
||||
import net.fabricmc.loom.api.decompilers.LoomDecompiler;
|
||||
import net.fabricmc.loom.processors.JarProcessorManager;
|
||||
import net.fabricmc.loom.providers.MappingsProvider;
|
||||
import net.fabricmc.loom.providers.MinecraftMappedProvider;
|
||||
@@ -63,6 +64,8 @@ public class LoomGradleExtension {
|
||||
|
||||
private List<Path> unmappedModsBuilt = new ArrayList<>();
|
||||
|
||||
final List<LoomDecompiler> decompilers = new ArrayList<>();
|
||||
|
||||
//Not to be set in the build.gradle
|
||||
private Project project;
|
||||
private LoomDependencyManager dependencyManager;
|
||||
@@ -71,6 +74,14 @@ public class LoomGradleExtension {
|
||||
private MappingSet[] srcMappingCache = new MappingSet[2];
|
||||
private Mercury[] srcMercuryCache = new Mercury[2];
|
||||
|
||||
/**
|
||||
* Loom will generate a new genSources task (with a new name, based off of {@link LoomDecompiler#name()})
|
||||
* that uses the specified decompiler instead.
|
||||
*/
|
||||
public void addDecompiler(LoomDecompiler decompiler) {
|
||||
decompilers.add(decompiler);
|
||||
}
|
||||
|
||||
public MappingSet getOrCreateSrcMappingCache(int id, Supplier<MappingSet> factory) {
|
||||
return srcMappingCache[id] != null ? srcMappingCache[id] : (srcMappingCache[id] = factory.get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user