Merge branch 'pull/205' into dev/0.4

# Conflicts:
#	src/main/java/net/fabricmc/loom/task/RemapJarTask.java
dev/0.11
modmuss50 2020-05-13 19:47:28 +01:00
commit 11e24e57b4
3 changed files with 15 additions and 1 deletions

View File

@ -297,6 +297,7 @@ public class AbstractPlugin implements Plugin<Project> {
extension.addUnmappedMod(jarTask.getArchivePath().toPath()); extension.addUnmappedMod(jarTask.getArchivePath().toPath());
remapJarTask.getAddNestedDependencies().set(true); remapJarTask.getAddNestedDependencies().set(true);
remapJarTask.getRemapAccessWidener().set(true);
project1.getArtifacts().add("archives", remapJarTask); project1.getArtifacts().add("archives", remapJarTask);
remapJarTask.dependsOn(jarTask); remapJarTask.dependsOn(jarTask);

View File

@ -99,6 +99,10 @@ public class LoomGradleExtension {
return installerJson; return installerJson;
} }
public void accessWidener(Object file) {
this.accessWidener = project.file(file);
}
public File getUserCache() { public File getUserCache() {
File userCache = new File(project.getGradle().getGradleUserHomeDir(), "caches" + File.separator + "fabric-loom"); File userCache = new File(project.getGradle().getGradleUserHomeDir(), "caches" + File.separator + "fabric-loom");

View File

@ -53,11 +53,15 @@ import net.fabricmc.tinyremapper.TinyUtils;
public class RemapJarTask extends Jar { public class RemapJarTask extends Jar {
private RegularFileProperty input; private RegularFileProperty input;
private Property<Boolean> addNestedDependencies; private Property<Boolean> addNestedDependencies;
private Property<Boolean> remapAccessWidener;
public RemapJarTask() { public RemapJarTask() {
super(); super();
input = GradleSupport.getfileProperty(getProject()); input = GradleSupport.getfileProperty(getProject());
addNestedDependencies = getProject().getObjects().property(Boolean.class); addNestedDependencies = getProject().getObjects().property(Boolean.class);
remapAccessWidener = getProject().getObjects().property(Boolean.class);
// false by default, I have no idea why I have to do it for this property and not the other one
remapAccessWidener.set(false);
} }
@TaskAction @TaskAction
@ -114,7 +118,7 @@ public class RemapJarTask extends Jar {
throw new RuntimeException("Failed to remap " + input + " to " + output, e); throw new RuntimeException("Failed to remap " + input + " to " + output, e);
} }
if (extension.accessWidener != null) { if (getRemapAccessWidener().getOrElse(false) && extension.accessWidener != null) {
extension.getJarProcessorManager().getByType(AccessWidenerJarProcessor.class).remapAccessWidener(output, remapper.getRemapper()); extension.getJarProcessorManager().getByType(AccessWidenerJarProcessor.class).remapAccessWidener(output, remapper.getRemapper());
} }
@ -155,4 +159,9 @@ public class RemapJarTask extends Jar {
public Property<Boolean> getAddNestedDependencies() { public Property<Boolean> getAddNestedDependencies() {
return addNestedDependencies; return addNestedDependencies;
} }
@Input
public Property<Boolean> getRemapAccessWidener() {
return remapAccessWidener;
}
} }