Skip to content

Commit

Permalink
make QuiltMappingsExtension local variable names clearer and consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
supersaiyansubtlety committed Nov 11, 2024
1 parent 5f1af63 commit 80f4351
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected MapIntermediaryExtension applyImpl(@NotNull Project project) {
// apply required plugins and save their registered objects
final PluginContainer plugins = project.getPlugins();

final QuiltMappingsExtension ext = plugins.apply(QuiltMappingsBasePlugin.class).getExt();
final QuiltMappingsExtension quiltExt = plugins.apply(QuiltMappingsBasePlugin.class).getExt();

final MapV2Plugin.Tasks mappingsV2Tasks =
plugins.apply(MapV2Plugin.class).getExt().getTasks();
Expand All @@ -73,7 +73,7 @@ protected MapIntermediaryExtension applyImpl(@NotNull Project project) {
ExtractTinyIntermediaryMappingsTask.class,
task -> {
task.getExtractionDest().convention(this.provideMappingsBuildFile(
ext.provideSuffixedMinecraftVersion("-" + Namespaces.INTERMEDIARY + "." + Extensions.TINY)
quiltExt.provideSuffixedMinecraftVersion("-" + Namespaces.INTERMEDIARY + "." + Extensions.TINY)
));
}
);
Expand Down Expand Up @@ -125,7 +125,7 @@ protected MapIntermediaryExtension applyImpl(@NotNull Project project) {
final var intermediaryV2MappingsJar = tasks.register(
IntermediaryMappingsV2JarTask.INTERMEDIARY_V_2_MAPPINGS_JAR_TASK_NAME,
IntermediaryMappingsV2JarTask.class,
ext.getUnpickVersion()
quiltExt.getUnpickVersion()
);
intermediaryV2MappingsJar.configure(task -> {
task.getMappings().convention(removeIntermediary.flatMap(RemoveIntermediaryTask::getOutputMappings));
Expand All @@ -136,7 +136,7 @@ protected MapIntermediaryExtension applyImpl(@NotNull Project project) {
final var intermediaryV2MergedMappingsJar = tasks.register(
IntermediaryMappingsV2JarTask.INTERMEDIARY_V_2_MERGED_MAPPINGS_JAR_TASK_NAME,
IntermediaryMappingsV2JarTask.class,
ext.getUnpickVersion()
quiltExt.getUnpickVersion()
);
intermediaryV2MergedMappingsJar.configure(task -> {
task.getMappings().convention(mergeIntermediary.flatMap(MergeIntermediaryTask::getOutputMappings));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected MapMinecraftJarsExtension applyImpl(@NotNull Project project) {
// configures MappingsDirOutputtingTasks (generatePackageInfoMappings)
// configures MappingsDirConsumingTasks
// (buildMappingsTiny, dropInvalidMappings, findDuplicateMappingFiles, mappingLint)
final QuiltMappingsExtension ext = plugins.apply(QuiltMappingsBasePlugin.class).getExt();
final QuiltMappingsExtension quiltExt = plugins.apply(QuiltMappingsBasePlugin.class).getExt();

final MinecraftJarsPlugin.Tasks minecraftJarsTasks =
plugins.apply(MinecraftJarsPlugin.class).getExt().getTasks();
Expand All @@ -104,7 +104,7 @@ protected MapMinecraftJarsExtension applyImpl(@NotNull Project project) {
task.getZippedFile().convention(this.provideRequiredFile(perVersionMappings));

task.getExtractionDest().convention(this.provideMappingsBuildFile(
ext.provideSuffixedMinecraftVersion("-" + Classifiers.INTERMEDIATE + "." + Extensions.TINY)
quiltExt.provideSuffixedMinecraftVersion("-" + Classifiers.INTERMEDIATE + "." + Extensions.TINY)
));
}
);
Expand Down Expand Up @@ -146,7 +146,7 @@ protected MapMinecraftJarsExtension applyImpl(@NotNull Project project) {

task.getOutputJar().convention(
this.provideMappedMinecraftBuildFile(
ext.provideSuffixedMinecraftVersion("-" + Classifiers.INTERMEDIATE + "." + Extensions.JAR)
quiltExt.provideSuffixedMinecraftVersion("-" + Classifiers.INTERMEDIATE + "." + Extensions.JAR)
)
);
}
Expand Down Expand Up @@ -231,7 +231,7 @@ protected MapMinecraftJarsExtension applyImpl(@NotNull Project project) {

task.getArtifactBaseName().convention(Constants.MAPPINGS_NAME);

task.getArtifactVersion().convention(ext.getMappingsVersion());
task.getArtifactVersion().convention(quiltExt.getMappingsVersion());

task.getArtifactClassifier().convention(Classifiers.TINY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class MinecraftJarsPlugin extends DefaultExtensionedMappingsProj
protected MinecraftJarsExtension applyImpl(@NotNull Project project) {
final PluginContainer plugins = project.getPlugins();

final QuiltMappingsExtension ext = plugins.apply(QuiltMappingsBasePlugin.class).getExt();
final QuiltMappingsExtension quiltExt = plugins.apply(QuiltMappingsBasePlugin.class).getExt();

final TaskContainer tasks = project.getTasks();

Expand All @@ -57,13 +57,13 @@ protected MinecraftJarsExtension applyImpl(@NotNull Project project) {
"https://piston-meta.mojang.com/mc/game/version_manifest_v2." + Extensions.JSON
);

params.getVersion().set(ext.getMinecraftVersion());
params.getVersion().set(quiltExt.getMinecraftVersion());
})
)
);

task.getDest().convention(
this.provideMinecraftBuildFile(ext.provideSuffixedMinecraftVersion("." + Extensions.JSON))
this.provideMinecraftBuildFile(quiltExt.provideSuffixedMinecraftVersion("." + Extensions.JSON))
);
}
);
Expand All @@ -84,11 +84,11 @@ protected MinecraftJarsExtension applyImpl(@NotNull Project project) {
DownloadMinecraftJarsTask.class,
task -> {
task.getClientJar().convention(this.provideMinecraftBuildFile(
ext.provideSuffixedMinecraftVersion("-client." + Extensions.JAR)
quiltExt.provideSuffixedMinecraftVersion("-client." + Extensions.JAR)
));

task.getServerBootstrapJar().convention(this.provideMinecraftBuildFile(
ext.provideSuffixedMinecraftVersion("-server-bootstrap." + Extensions.JAR)
quiltExt.provideSuffixedMinecraftVersion("-server-bootstrap." + Extensions.JAR)
));
}
);
Expand All @@ -102,7 +102,7 @@ protected MinecraftJarsExtension applyImpl(@NotNull Project project) {
);

task.getExtractionDest().convention(
this.provideMinecraftBuildFile(ext.provideSuffixedMinecraftVersion("-server." + Extensions.JAR))
this.provideMinecraftBuildFile(quiltExt.provideSuffixedMinecraftVersion("-server." + Extensions.JAR))
);
}
);
Expand All @@ -116,7 +116,7 @@ protected MinecraftJarsExtension applyImpl(@NotNull Project project) {
task.getServerJar().convention(extractServerJar.flatMap(ExtractServerJarTask::getExtractionDest));

task.getMergedFile().convention(
this.provideMinecraftBuildFile(ext.provideSuffixedMinecraftVersion("-merged." + Extensions.JAR))
this.provideMinecraftBuildFile(quiltExt.provideSuffixedMinecraftVersion("-merged." + Extensions.JAR))
);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected ProcessMappingsExtension applyImpl(@NotNull Project project) {
// adds javadoc task
plugins.apply(JavaPlugin.class);

final QuiltMappingsExtension ext = plugins.apply(QuiltMappingsBasePlugin.class).getExt();
final QuiltMappingsExtension quiltExt = plugins.apply(QuiltMappingsBasePlugin.class).getExt();

final MinecraftJarsPlugin.Tasks minecraftJarsTasks =
plugins.apply(MinecraftJarsPlugin.class).getExt().getTasks();
Expand Down Expand Up @@ -158,7 +158,7 @@ protected ProcessMappingsExtension applyImpl(@NotNull Project project) {
});

tasks.register(JavadocJarTask.JAVADOC_JAR_TASK_NAME, JavadocJarTask.class, task -> {
task.getArchiveVersion().convention(ext.getMappingsVersion());
task.getArchiveVersion().convention(quiltExt.getMappingsVersion());

task.from(javadoc.map(Javadoc::getDestinationDir));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public abstract class TargetDiffPlugin implements MappingsProjectPlugin {
public void apply(@NotNull Project project) {
final PluginContainer plugins = project.getPlugins();

final QuiltMappingsExtension ext = plugins.apply(QuiltMappingsBasePlugin.class).getExt();
final QuiltMappingsExtension quiltExt = plugins.apply(QuiltMappingsBasePlugin.class).getExt();

final MinecraftJarsPlugin.Tasks minecraftJarsTasks =
plugins.apply(MinecraftJarsPlugin.class).getExt().getTasks();
Expand All @@ -104,7 +104,7 @@ public void apply(@NotNull Project project) {
DownloadTargetMetaFileTask.DOWNLOAD_TARGET_META_FILE_TASK_NAME,
DownloadTargetMetaFileTask.class,
task -> {
task.getMinecraftVersion().convention(ext.getMinecraftVersion());
task.getMinecraftVersion().convention(quiltExt.getMinecraftVersion());

task.getDest().convention(this.provideMinecraftBuildFile(
task.getMinecraftVersion().map(createQuiltFileNameBuilder("." + Extensions.JSON))
Expand Down Expand Up @@ -157,7 +157,7 @@ public void apply(@NotNull Project project) {
// put mapped provider in a property so all tasks use the same cached value
final Property<Boolean> unpickVersionsMatch = this.getObjects().property(Boolean.class);
unpickVersionsMatch.set(provideUnpickVersionsMatch(
ext.getUnpickVersion(),
quiltExt.getUnpickVersion(),
extractTargetMappingsJar
.flatMap(ExtractTargetMappingJarTask::getExtractionDest)
.map(dest -> dest.file(MappingsV2JarTask.JAR_UNPICK_META_PATH))
Expand Down

2 comments on commit 80f4351

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No difference between head and target.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No difference between head and target.

Please sign in to comment.