Merge with Fabric 1.1, stage 3

This commit is contained in:
Juuz
2023-02-16 01:02:58 +02:00
18 changed files with 125 additions and 35 deletions

View File

@@ -53,7 +53,7 @@ public class RemapTaskConfiguration {
final TaskContainer tasks = project.getTasks();
final LoomGradleExtension extension = LoomGradleExtension.get(project);
if (getBooleanProperty(project, "fabric.loom.dontRemap")) {
if (GradleUtils.getBooleanProperty(project, Constants.Properties.DONT_REMAP)) {
extension.getUnmappedModCollection().from(project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME));
return;
}
@@ -103,7 +103,7 @@ public class RemapTaskConfiguration {
}
});
if (getBooleanProperty(project, "fabric.loom.disableRemappedVariants")) {
if (GradleUtils.getBooleanProperty(project, Constants.Properties.DISABLE_REMAPPED_VARIANTS)) {
return;
}
@@ -154,7 +154,7 @@ public class RemapTaskConfiguration {
tasks.named(BasePlugin.ASSEMBLE_TASK_NAME).configure(task -> task.dependsOn(remapSourcesTask));
if (getBooleanProperty(project, "fabric.loom.disableRemappedVariants")) {
if (GradleUtils.getBooleanProperty(project, "fabric.loom.disableRemappedVariants")) {
return;
}
@@ -177,15 +177,4 @@ public class RemapTaskConfiguration {
}
});
}
private static boolean getBooleanProperty(Project project, String key) {
return project.getProviders().gradleProperty(key).map(string -> {
try {
return Boolean.parseBoolean(string);
} catch (final IllegalArgumentException ex) {
return false;
}
})
.getOrElse(false);
}
}