0.2.7 refactors (#178)

* Rough work on project based jars, skeleton for AccessEscalators?

* First working draft

* Minor changes

* Add support for mutable, better error checking when parsing file.
Code cleanup
Remap if needed when reading

* Fix inner classes and genSources

* Fix CME

* Caching, only regen jar when input changes

* Some work, untested

* Fix writing, fix checkstyle issues

* More fixes

* Move jars into a maven file structure, cleans up the file structure, and will benefit idea 2020
Add some basic validation to the AccessWidenerRemapper, will present any issues with the mappings when building (May need a way to disable?)
+ Some bugs fixes

* Fix issues with source jars in idea 2020, should be backwards compatible with 2019

* Move to lorenz-tiny

* Build fix + small cleanup

* Remove accesswidener's for now

* Update dev launch injector, should fix all issues with spaces in the path.
This commit is contained in:
modmuss50
2020-03-06 11:15:34 +00:00
committed by GitHub
parent d62a63c8bd
commit ee462f8f9e
24 changed files with 445 additions and 242 deletions

View File

@@ -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.processors.JarProcessorManager;
import net.fabricmc.loom.providers.MappingsProvider;
import net.fabricmc.loom.providers.MinecraftMappedProvider;
import net.fabricmc.loom.providers.MinecraftProvider;
@@ -58,12 +59,14 @@ public class LoomGradleExtension {
public boolean autoGenIDERuns = true;
public boolean extractJars = false;
public String customManifest = null;
public File accessWidener = null;
private List<Path> unmappedModsBuilt = new ArrayList<>();
//Not to be set in the build.gradle
private Project project;
private LoomDependencyManager dependencyManager;
private JarProcessorManager jarProcessorManager;
private JsonObject installerJson;
private MappingSet[] srcMappingCache = new MappingSet[2];
private Mercury[] srcMercuryCache = new Mercury[2];
@@ -116,6 +119,16 @@ public class LoomGradleExtension {
return projectCache;
}
public File getProjectPersistentCache() {
File projectCache = new File(project.file(".gradle"), "loom-cache");
if (!projectCache.exists()) {
projectCache.mkdirs();
}
return projectCache;
}
public File getRootProjectBuildCache() {
File projectCache = new File(project.getRootProject().getBuildDir(), "loom-cache");
@@ -167,7 +180,7 @@ public class LoomGradleExtension {
}
public File getNativesDirectory() {
File natives = new File(getUserCache(), "natives/" + getMinecraftProvider().minecraftVersion);
File natives = new File(getUserCache(), "natives/" + getMinecraftProvider().getMinecraftVersion());
if (!natives.exists()) {
natives.mkdirs();
@@ -283,6 +296,14 @@ public class LoomGradleExtension {
this.dependencyManager = dependencyManager;
}
public JarProcessorManager getJarProcessorManager() {
return jarProcessorManager;
}
public void setJarProcessorManager(JarProcessorManager jarProcessorManager) {
this.jarProcessorManager = jarProcessorManager;
}
public String getRefmapName() {
if (refmapName == null || refmapName.isEmpty()) {
String defaultRefmapName = project.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-refmap.json";