Allow other source sets to be remapped without needing an access widener
This commit is contained in:
parent
26755cb82c
commit
a134913c71
3 changed files with 13 additions and 1 deletions
|
@ -295,6 +295,7 @@ public class AbstractPlugin implements Plugin<Project> {
|
|||
|
||||
extension.addUnmappedMod(jarTask.getArchivePath().toPath());
|
||||
remapJarTask.getAddNestedDependencies().set(true);
|
||||
remapJarTask.getRemapAccessWidener().set(true);
|
||||
|
||||
project1.getArtifacts().add("archives", remapJarTask);
|
||||
remapJarTask.dependsOn(jarTask);
|
||||
|
|
|
@ -100,6 +100,10 @@ public class LoomGradleExtension {
|
|||
return installerJson;
|
||||
}
|
||||
|
||||
public void accessWidener(Object file) {
|
||||
this.accessWidener = project.file(file);
|
||||
}
|
||||
|
||||
public File getUserCache() {
|
||||
File userCache = new File(project.getGradle().getGradleUserHomeDir(), "caches" + File.separator + "fabric-loom");
|
||||
|
||||
|
|
|
@ -53,11 +53,13 @@ import net.fabricmc.tinyremapper.TinyUtils;
|
|||
public class RemapJarTask extends Jar {
|
||||
private RegularFileProperty input;
|
||||
private Property<Boolean> addNestedDependencies;
|
||||
private Property<Boolean> remapAccessWidener;
|
||||
|
||||
public RemapJarTask() {
|
||||
super();
|
||||
input = GradleSupport.getfileProperty(getProject());
|
||||
addNestedDependencies = getProject().getObjects().property(Boolean.class);
|
||||
remapAccessWidener = getProject().getObjects().property(Boolean.class);
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
|
@ -129,7 +131,7 @@ public class RemapJarTask extends Jar {
|
|||
}
|
||||
}
|
||||
|
||||
if (extension.accessWidener != null) {
|
||||
if (getRemapAccessWidener().getOrElse(false) && extension.accessWidener != null) {
|
||||
extension.getJarProcessorManager().getByType(AccessWidenerJarProcessor.class).remapAccessWidener(output);
|
||||
}
|
||||
|
||||
|
@ -154,4 +156,9 @@ public class RemapJarTask extends Jar {
|
|||
public Property<Boolean> getAddNestedDependencies() {
|
||||
return addNestedDependencies;
|
||||
}
|
||||
|
||||
@Input
|
||||
public Property<Boolean> getRemapAccessWidener() {
|
||||
return remapAccessWidener;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue