diff --git a/build.gradle b/build.gradle index 1619808958..10cf5c55d0 100644 --- a/build.gradle +++ b/build.gradle @@ -263,7 +263,6 @@ publishing { classifier ConstantsJarTask.CONSTANTS_CLASSIFIER } - // TODO why don't these specify classifiers? // quilt-mappings--sources.jar artifact sourcesJar // quilt-mappings--javadoc.jar diff --git a/buildSrc/src/main/java/quilt/internal/plugin/MappingsVerificationPlugin.java b/buildSrc/src/main/java/quilt/internal/plugin/MappingsVerificationPlugin.java index 5f9ab08dc8..244733537e 100644 --- a/buildSrc/src/main/java/quilt/internal/plugin/MappingsVerificationPlugin.java +++ b/buildSrc/src/main/java/quilt/internal/plugin/MappingsVerificationPlugin.java @@ -1,6 +1,7 @@ package quilt.internal.plugin; import org.gradle.api.Project; +import org.gradle.api.Task; import org.gradle.api.plugins.PluginContainer; import org.gradle.api.tasks.TaskContainer; import org.gradle.api.tasks.TaskProvider; @@ -25,7 +26,8 @@ * * * If {@link LifecycleBasePlugin} is applied, configures the {@value LifecycleBasePlugin#CHECK_TASK_NAME} task - * to depend on the {@value MappingLintTask#MAPPING_LINT_TASK_NAME} task, which in turn depends on the + * to {@linkplain Task#dependsOn(Object...) depend on} the {@value MappingLintTask#MAPPING_LINT_TASK_NAME} task, + * which in turn {@linkplain Task#dependsOn(Object...) depend on} the * {@value FindDuplicateMappingFilesTask#FIND_DUPLICATE_MAPPING_FILES_TASK_NAME} task. */ public abstract class MappingsVerificationPlugin implements MappingsProjectPlugin { diff --git a/buildSrc/src/main/java/quilt/internal/task/EnigmaProfileConsumingTask.java b/buildSrc/src/main/java/quilt/internal/task/EnigmaProfileConsumingTask.java index dc8b039ae7..dea1cde345 100644 --- a/buildSrc/src/main/java/quilt/internal/task/EnigmaProfileConsumingTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/EnigmaProfileConsumingTask.java @@ -13,8 +13,8 @@ /** * A task that takes an {@link EnigmaProfile} as input. - *

- * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} default values. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach */ public interface EnigmaProfileConsumingTask extends MappingsTask { @Internal("@ServiceReference is @Incubating") diff --git a/buildSrc/src/main/java/quilt/internal/task/MappingsDirConsumingTask.java b/buildSrc/src/main/java/quilt/internal/task/MappingsDirConsumingTask.java index 974cf7fba9..80d46ab00c 100644 --- a/buildSrc/src/main/java/quilt/internal/task/MappingsDirConsumingTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/MappingsDirConsumingTask.java @@ -2,7 +2,13 @@ import org.gradle.api.file.DirectoryProperty; import org.gradle.api.tasks.InputDirectory; +import quilt.internal.plugin.QuiltMappingsBasePlugin; +/** + * A task that takes a directory containing mappings as input. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public interface MappingsDirConsumingTask extends MappingsTask { @InputDirectory DirectoryProperty getMappingsDir(); diff --git a/buildSrc/src/main/java/quilt/internal/task/QuiltMappingsArtifactTask.java b/buildSrc/src/main/java/quilt/internal/task/QuiltMappingsArtifactTask.java index b20962ed8f..bc7e679f04 100644 --- a/buildSrc/src/main/java/quilt/internal/task/QuiltMappingsArtifactTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/QuiltMappingsArtifactTask.java @@ -11,9 +11,8 @@ *

* Has no effect if the implementing task isn't a subclass of either * {@link ArtifactFileTask} or {@link AbstractArchiveTask}. - *

- * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach(Action) configures} - * the base name and the version. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach */ public interface QuiltMappingsArtifactTask extends MappingsTask { static boolean isInstance(Task task) { diff --git a/buildSrc/src/main/java/quilt/internal/task/VersionDownloadInfoConsumingTask.java b/buildSrc/src/main/java/quilt/internal/task/VersionDownloadInfoConsumingTask.java index df6cc922eb..d927f5da93 100644 --- a/buildSrc/src/main/java/quilt/internal/task/VersionDownloadInfoConsumingTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/VersionDownloadInfoConsumingTask.java @@ -2,14 +2,13 @@ import org.gradle.api.provider.Property; import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.TaskCollection; import quilt.internal.plugin.MinecraftJarsPlugin; import quilt.internal.util.VersionDownloadInfo; /** * A task that takes {@link VersionDownloadInfo} as input. - *

- * {@link MinecraftJarsPlugin} {@linkplain TaskCollection#configureEach configures} some defaults. + * + * @see MinecraftJarsPlugin MinecraftJarsPlugin's configureEach */ public interface VersionDownloadInfoConsumingTask extends MappingsTask { @Input diff --git a/buildSrc/src/main/java/quilt/internal/task/build/AddProposedMappingsTask.java b/buildSrc/src/main/java/quilt/internal/task/build/AddProposedMappingsTask.java index 6b1ef98b53..a323548ab8 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/AddProposedMappingsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/AddProposedMappingsTask.java @@ -38,10 +38,18 @@ import org.jetbrains.annotations.VisibleForTesting; import quilt.internal.Constants.Groups; import quilt.internal.plugin.MapMinecraftJarsPlugin; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.DefaultMappingsTask; import quilt.internal.task.EnigmaProfileConsumingTask; +import quilt.internal.util.EnigmaProfileService; import quilt.internal.util.ProviderUtil; +/** + * Runs {@link Enigma} to add any proposed mappings from proposers configured in the passed + * {@linkplain #getEnigmaProfileService() Enigma profile}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class AddProposedMappingsTask extends DefaultMappingsTask implements EnigmaProfileConsumingTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/build/BuildMappingsTinyTask.java b/buildSrc/src/main/java/quilt/internal/task/build/BuildMappingsTinyTask.java index 430552e27b..4ad4c0c3ea 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/BuildMappingsTinyTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/BuildMappingsTinyTask.java @@ -14,10 +14,14 @@ import quilt.internal.Constants.Groups; import quilt.internal.Constants.Namespaces; import quilt.internal.plugin.MapMinecraftJarsPlugin; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.DefaultMappingsTask; import quilt.internal.task.MappingsDirConsumingTask; import quilt.internal.util.ProviderUtil; +/** + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class BuildMappingsTinyTask extends DefaultMappingsTask implements MappingsDirConsumingTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/build/CompressTinyTask.java b/buildSrc/src/main/java/quilt/internal/task/build/CompressTinyTask.java index 850c7a3c3f..bbab0543cb 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/CompressTinyTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/CompressTinyTask.java @@ -19,10 +19,8 @@ /** * Compresses the input {@link #getMappings() mappings} using GZip. - *

- * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default - * {@link ArtifactFileTask#getArtifactBaseName() archiveBaseName} and - * {@link ArtifactFileTask#getArtifactVersion() archiveVersion}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach */ public abstract class CompressTinyTask extends DefaultMappingsTask implements ArtifactFileTask, QuiltMappingsArtifactTask { diff --git a/buildSrc/src/main/java/quilt/internal/task/build/DropInvalidMappingsTask.java b/buildSrc/src/main/java/quilt/internal/task/build/DropInvalidMappingsTask.java index 3d28bbb967..89da75f774 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/DropInvalidMappingsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/DropInvalidMappingsTask.java @@ -8,9 +8,17 @@ import org.gradle.api.tasks.TaskAction; import quilt.internal.Constants.Groups; import quilt.internal.plugin.MapMinecraftJarsPlugin; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.DefaultMappingsTask; import quilt.internal.task.MappingsDirConsumingTask; +/** + * Removes any invalid mappings found in the passed {@link #getMappingsDir() mappingsDir}. + *

+ * Invalid mappings are usually the result of differences between Minecraft versions. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class DropInvalidMappingsTask extends DefaultMappingsTask implements MappingsDirConsumingTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/build/GeneratePackageInfoMappingsTask.java b/buildSrc/src/main/java/quilt/internal/task/build/GeneratePackageInfoMappingsTask.java index ae051d7739..2aebe5639c 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/GeneratePackageInfoMappingsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/GeneratePackageInfoMappingsTask.java @@ -15,6 +15,7 @@ import org.objectweb.asm.tree.ClassNode; import quilt.internal.Constants.Groups; import quilt.internal.plugin.MapMinecraftJarsPlugin; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.DefaultMappingsTask; import quilt.internal.task.mappings.MappingsDirOutputtingTask; @@ -30,6 +31,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +/** + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class GeneratePackageInfoMappingsTask extends DefaultMappingsTask implements MappingsDirOutputtingTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/build/IntermediaryMappingsV2JarTask.java b/buildSrc/src/main/java/quilt/internal/task/build/IntermediaryMappingsV2JarTask.java index 596bb6042d..1f9bace707 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/IntermediaryMappingsV2JarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/IntermediaryMappingsV2JarTask.java @@ -1,11 +1,10 @@ package quilt.internal.task.build; -import org.gradle.api.tasks.TaskCollection; import org.gradle.api.tasks.TaskContainer; -import org.gradle.api.tasks.bundling.AbstractArchiveTask; import quilt.internal.Constants; import quilt.internal.Constants.Namespaces; import quilt.internal.plugin.MapIntermediaryPlugin; +import quilt.internal.plugin.MapV2Plugin; import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.setup.IntermediaryDependantTask; @@ -13,10 +12,10 @@ /** * Creates a jar file containing {@value Constants#INTERMEDIARY_MAPPINGS_NAME} mappings in Quilt's v2 mapping format. - *

- * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default - * {@link AbstractArchiveTask#getArchiveBaseName() archiveBaseName} and - * {@link AbstractArchiveTask#getArchiveVersion() archiveVersion}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + * @see MapIntermediaryPlugin MapIntermediaryPlugin's configureEach + * @see MapV2Plugin MapV2Plugin's configureEach */ public abstract class IntermediaryMappingsV2JarTask extends MappingsV2JarTask implements IntermediaryDependantTask { /** diff --git a/buildSrc/src/main/java/quilt/internal/task/build/MappingsV2JarTask.java b/buildSrc/src/main/java/quilt/internal/task/build/MappingsV2JarTask.java index 3aad6d3413..1075fe59d5 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/MappingsV2JarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/MappingsV2JarTask.java @@ -4,9 +4,7 @@ import org.gradle.api.file.RegularFileProperty; import org.gradle.api.tasks.InputFile; -import org.gradle.api.tasks.TaskCollection; import org.gradle.api.tasks.TaskContainer; -import org.gradle.api.tasks.bundling.AbstractArchiveTask; import org.gradle.jvm.tasks.Jar; import org.gradle.work.DisableCachingByDefault; import quilt.internal.Constants.Groups; @@ -18,13 +16,9 @@ /** * Creates a jar file with Quilt's v2 mapping format. - *

- * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default - * {@link AbstractArchiveTask#getArchiveBaseName() archiveBaseName} and - * {@link AbstractArchiveTask#getArchiveVersion() archiveVersion}.
- * {@link MapV2Plugin} {@linkplain TaskCollection#configureEach configures} a default - * {@link MappingsV2JarTask#getUnpickMeta() unpickMeta} and - * {@link MappingsV2JarTask#getUnpickDefinition() unpickDefinition}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + * @see MapV2Plugin MapV2Plugin's configureEach */ // TODO why? diff --git a/buildSrc/src/main/java/quilt/internal/task/build/MergeIntermediaryTask.java b/buildSrc/src/main/java/quilt/internal/task/build/MergeIntermediaryTask.java index ef4b735b2e..bf5f3be361 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/MergeIntermediaryTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/MergeIntermediaryTask.java @@ -3,8 +3,11 @@ import net.fabricmc.mappingio.MappingVisitor; import net.fabricmc.mappingio.adapter.MappingDstNsReorder; +import org.gradle.api.Task; import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.specs.Spec; import org.gradle.api.tasks.InputFile; +import org.gradle.api.tasks.TaskCollection; import org.gradle.api.tasks.TaskContainer; import org.jetbrains.annotations.VisibleForTesting; import quilt.internal.Constants; @@ -18,6 +21,9 @@ import java.nio.file.Path; import java.util.List; +/** + * @see MapIntermediaryPlugin MapIntermediaryPlugin's configureEach + */ public abstract class MergeIntermediaryTask extends AbstractTinyMergeTask implements IntermediaryDependantTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapIntermediaryPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/build/RemoveIntermediaryTask.java b/buildSrc/src/main/java/quilt/internal/task/build/RemoveIntermediaryTask.java index 71590b2a02..13e55ede56 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/RemoveIntermediaryTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/RemoveIntermediaryTask.java @@ -6,10 +6,14 @@ import net.fabricmc.mappingio.format.MappingFormat; import net.fabricmc.mappingio.format.tiny.Tiny2FileWriter; import net.fabricmc.mappingio.tree.MemoryMappingTree; + +import org.gradle.api.Task; import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.specs.Spec; import org.gradle.api.tasks.InputFile; import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.TaskCollection; import org.gradle.api.tasks.TaskContainer; import org.jetbrains.annotations.VisibleForTesting; import quilt.internal.Constants.Groups; @@ -24,6 +28,12 @@ import java.nio.file.Path; import java.util.Collections; +/** + * TODO is this (and the name) accurate? It looks like it actually replaces official with intermediary.

+ * Removes the {@value Namespaces#INTERMEDIARY} namespace from the {@link #getInput() input} mappings. + * + * @see MapIntermediaryPlugin MapIntermediaryPlugin's configureEach + */ public abstract class RemoveIntermediaryTask extends DefaultMappingsTask implements IntermediaryDependantTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapIntermediaryPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/build/TinyJarTask.java b/buildSrc/src/main/java/quilt/internal/task/build/TinyJarTask.java index cf4e8d60a1..18a753b67b 100644 --- a/buildSrc/src/main/java/quilt/internal/task/build/TinyJarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/build/TinyJarTask.java @@ -13,10 +13,8 @@ /** * Creates a jar file with the input {@link #getMappings() mappings} located at {@value JAR_MAPPINGS_PATH}. - *

- * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default - * {@link AbstractArchiveTask#getArchiveBaseName() archiveBaseName} and - * {@link AbstractArchiveTask#getArchiveVersion() archiveVersion}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach */ public abstract class TinyJarTask extends Jar implements QuiltMappingsArtifactTask { /** diff --git a/buildSrc/src/main/java/quilt/internal/task/diff/RemapTargetMinecraftJarTask.java b/buildSrc/src/main/java/quilt/internal/task/diff/RemapTargetMinecraftJarTask.java index 6ca22d749c..4a5a6a9bd5 100644 --- a/buildSrc/src/main/java/quilt/internal/task/diff/RemapTargetMinecraftJarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/diff/RemapTargetMinecraftJarTask.java @@ -2,8 +2,12 @@ import quilt.internal.Constants.Groups; import quilt.internal.Constants.Namespaces; +import quilt.internal.plugin.MapMinecraftJarsPlugin; import quilt.internal.task.jarmapping.MapJarTask; +/** + * @see MapMinecraftJarsPlugin MapMinecraftJarsPlugin's configureEach + */ public abstract class RemapTargetMinecraftJarTask extends MapJarTask implements UnpickVersionsMatchConsumingTask { public static final String REMAP_TARGET_MINECRAFT_JAR_TASK_NAME = "remapTargetMinecraftJar"; diff --git a/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapJarTask.java b/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapJarTask.java index 7b041df22b..825f5ec7d4 100644 --- a/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapJarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapJarTask.java @@ -16,9 +16,9 @@ import quilt.internal.util.JarRemapper; /** - * Creates a jar file by applying mappings to an input jar. - *

- * {@link MapMinecraftJarsPlugin} {@linkplain TaskCollection#configureEach configures} some defaults. + * Copies a {@linkplain #getInputJar() Jar} and applies {@linkplain #getMappingsFile() mappings}. + * + * @see MapMinecraftJarsPlugin MapMinecraftJarsPlugin's configureEach */ public abstract class MapJarTask extends DefaultMappingsTask { public static final Map JAVAX_TO_JETBRAINS = Map.of( diff --git a/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapNamedJarTask.java b/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapNamedJarTask.java index d08f23b377..3d4d50ceb2 100644 --- a/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapNamedJarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapNamedJarTask.java @@ -3,8 +3,12 @@ import org.gradle.api.tasks.TaskContainer; import quilt.internal.Constants.Groups; import quilt.internal.Constants.Namespaces; +import quilt.internal.plugin.MapMinecraftJarsPlugin; import quilt.internal.plugin.MapV2Plugin; +/** + * @see MapMinecraftJarsPlugin MapMinecraftJarsPlugin's configureEach + */ public abstract class MapNamedJarTask extends MapJarTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapV2Plugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapPerVersionMappingsJarTask.java b/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapPerVersionMappingsJarTask.java index 080e840027..bdb5ddb2fa 100644 --- a/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapPerVersionMappingsJarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/jarmapping/MapPerVersionMappingsJarTask.java @@ -5,6 +5,9 @@ import quilt.internal.Constants.Namespaces; import quilt.internal.plugin.MapMinecraftJarsPlugin; +/** + * @see MapMinecraftJarsPlugin MapMinecraftJarsPlugin's configureEach + */ public abstract class MapPerVersionMappingsJarTask extends MapJarTask { /** * {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/lint/FindDuplicateMappingFilesTask.java b/buildSrc/src/main/java/quilt/internal/task/lint/FindDuplicateMappingFilesTask.java index e573d4b22c..8e4296cda7 100644 --- a/buildSrc/src/main/java/quilt/internal/task/lint/FindDuplicateMappingFilesTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/lint/FindDuplicateMappingFilesTask.java @@ -7,6 +7,7 @@ import org.gradle.api.tasks.TaskAction; import quilt.internal.Constants.Groups; import quilt.internal.plugin.MappingsVerificationPlugin; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.DefaultMappingsTask; import quilt.internal.task.MappingsDirConsumingTask; @@ -17,12 +18,25 @@ import java.nio.file.Path; import java.util.stream.Stream; +/** + * Searches the passed {@link #getMappingsDir() mappingsDir} for any mappings files that map the same class.
+ * The task fails if any duplicates or other errors are found. + *

+ * Duplicate mappings are usually the result of running {@code git merge/rebase} and + * inadvertently combining two histories that give the same class two different names. + *

+ * Any file that's empty or that lacks the {@value MAPPING_EXTENSION} extension will also be reported. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class FindDuplicateMappingFilesTask extends DefaultMappingsTask implements MappingsDirConsumingTask { /** * {@linkplain org.gradle.api.tasks.TaskContainer#register Registered} by {@link MappingsVerificationPlugin}. */ public static final String FIND_DUPLICATE_MAPPING_FILES_TASK_NAME = "findDuplicateMappingFiles"; + public static final String MAPPING_EXTENSION = "mapping"; + private static final Pattern EXPECTED_CLASS = Pattern.compile("^CLASS (?:net/minecraft|com/mojang/blaze3d)/(?:\\w+/)*\\w+(?= )"); @@ -57,15 +71,15 @@ public void run() { emptyFiles.add(mappingFile); } - if (!mappingFile.toString().endsWith(".mapping")) { + if (!mappingFile.toString().endsWith("." + MAPPING_EXTENSION)) { wrongExtensionFiles.add(mappingFile); } } catch (IOException e) { - throw new GradleException("Unexpected error accessing mapping file", e); + throw new GradleException("Unexpected error accessing " + MAPPING_EXTENSION + " file", e); } }); } catch (IOException e) { - throw new GradleException("Unexpected error accessing mappings directory", e); + throw new GradleException("Unexpected error accessing " + MAPPING_EXTENSION + "s directory", e); } final Logger logger = this.getLogger(); @@ -101,7 +115,7 @@ public void run() { } if (!wrongExtensionFiles.isEmpty()) { - final String message = "%d file%s without the mapping extension".formatted( + final String message = ("%d file%s without the " + MAPPING_EXTENSION + " extension").formatted( wrongExtensionFiles.size(), wrongExtensionFiles.size() == 1 ? "" : "s" ); diff --git a/buildSrc/src/main/java/quilt/internal/task/lint/MappingLintTask.java b/buildSrc/src/main/java/quilt/internal/task/lint/MappingLintTask.java index 467b8b554c..ab66bfc356 100644 --- a/buildSrc/src/main/java/quilt/internal/task/lint/MappingLintTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/lint/MappingLintTask.java @@ -50,9 +50,19 @@ import org.gradle.workers.WorkerExecutor; import quilt.internal.Constants.Groups; import quilt.internal.plugin.MappingsVerificationPlugin; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.DefaultMappingsTask; import quilt.internal.task.MappingsDirConsumingTask; +/** + * Runs the mappings in the passed {@link #getMappingsDir() mappingsDir} through the passed {@link #getCheckers()}.
+ * The task fails if any {@link Checker}'s + * {@link Checker#check(Entry, EntryMapping, Function, ErrorReporter) check} fails. + *

+ * Spelling and naming convention {@link Checker}s are amongst the {@link Checker#DEFAULT_CHECKERS DEFAULT_CHECKERS}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class MappingLintTask extends DefaultMappingsTask implements MappingsDirConsumingTask { /** * {@linkplain org.gradle.api.tasks.TaskContainer#register Registered} by {@link MappingsVerificationPlugin}. diff --git a/buildSrc/src/main/java/quilt/internal/task/mappings/AbstractEnigmaMappingsTask.java b/buildSrc/src/main/java/quilt/internal/task/mappings/AbstractEnigmaMappingsTask.java index 1710384977..aa477fdf6e 100644 --- a/buildSrc/src/main/java/quilt/internal/task/mappings/AbstractEnigmaMappingsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/mappings/AbstractEnigmaMappingsTask.java @@ -5,9 +5,13 @@ import org.gradle.api.tasks.JavaExec; import org.gradle.api.tasks.UntrackedTask; import quilt.internal.Constants.Groups; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.task.EnigmaProfileConsumingTask; import quilt.internal.task.MappingsDirConsumingTask; +/** + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ // TODO use getArgumentProviders instead of overriding exec @UntrackedTask(because = """ diff --git a/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsServerTask.java b/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsServerTask.java index 48f692c1ae..5709b39db1 100644 --- a/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsServerTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsServerTask.java @@ -8,6 +8,7 @@ import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.options.Option; import org.quiltmc.enigma.network.DedicatedEnigmaServer; +import quilt.internal.plugin.QuiltMappingsBasePlugin; import quilt.internal.plugin.QuiltMappingsPlugin; import java.util.ArrayList; @@ -35,6 +36,8 @@ *

  • {@value QuiltMappingsPlugin#ENIGMA_SERVER_ARGS_PROP} * for any additional command line args * + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach */ public abstract class EnigmaMappingsServerTask extends AbstractEnigmaMappingsTask { public static final String MAPPINGS_SERVER_TASK_NAME = "mappingsServer"; diff --git a/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsTask.java b/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsTask.java index 1a25d3f09e..2243410735 100644 --- a/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/mappings/EnigmaMappingsTask.java @@ -1,5 +1,12 @@ package quilt.internal.task.mappings; +import quilt.internal.plugin.QuiltMappingsBasePlugin; + +/** + * Launches the {@linkplain org.quiltmc.enigma.gui.Main Enigma GUI}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach + */ public abstract class EnigmaMappingsTask extends AbstractEnigmaMappingsTask { public static final String MAPPINGS_TASK_NAME = "mappings"; public static final String MAPPINGS_UNPICKED_TASK_NAME = "mappingsUnpicked"; diff --git a/buildSrc/src/main/java/quilt/internal/task/mappings/MappingsDirOutputtingTask.java b/buildSrc/src/main/java/quilt/internal/task/mappings/MappingsDirOutputtingTask.java index de98b39212..fbb9cc74cb 100644 --- a/buildSrc/src/main/java/quilt/internal/task/mappings/MappingsDirOutputtingTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/mappings/MappingsDirOutputtingTask.java @@ -17,9 +17,8 @@ * An implementing task should only output to files within {@link #getMappingsDir() mappingsDir} and should * not output to the whole directory unless it is an {@link org.gradle.api.tasks.UntrackedTask @UntrackedTask} * whose output is not intended for consumption by other tasks. - *

    - * {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} - * a default {@link #getMappingsDir mappingsDir}. + * + * @see QuiltMappingsBasePlugin QuiltMappingsBasePlugin's configureEach */ public interface MappingsDirOutputtingTask extends MappingsTask { @Internal( diff --git a/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftJarsTask.java b/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftJarsTask.java index b3331e5c28..5d587505fe 100644 --- a/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftJarsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftJarsTask.java @@ -16,6 +16,11 @@ import quilt.internal.util.DownloadUtil; import quilt.internal.util.VersionDownloadInfo; +/** + * Downloads the Minecraft client and server jars for the passed {@linkplain #getVersionDownloadInfo version}. + * + * @see MinecraftJarsPlugin MinecraftJarsPlugin's configureEach + */ public abstract class DownloadMinecraftJarsTask extends DefaultMappingsTask implements VersionDownloadInfoConsumingTask { /** diff --git a/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftLibrariesTask.java b/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftLibrariesTask.java index f663423db8..0591283446 100644 --- a/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftLibrariesTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/setup/DownloadMinecraftLibrariesTask.java @@ -24,6 +24,11 @@ import java.util.Map; import java.util.stream.Collectors; +/** + * Downloads the Minecraft's libraries for the passed {@linkplain #getVersionDownloadInfo version}. + * + * @see MinecraftJarsPlugin MinecraftJarsPlugin's configureEach + */ // TODO why? @DisableCachingByDefault(because = "unknown") public abstract class DownloadMinecraftLibrariesTask extends DefaultMappingsTask implements diff --git a/buildSrc/src/main/java/quilt/internal/task/setup/ExtractTinyIntermediaryMappingsTask.java b/buildSrc/src/main/java/quilt/internal/task/setup/ExtractTinyIntermediaryMappingsTask.java index 7def6f091c..95c94b5f46 100644 --- a/buildSrc/src/main/java/quilt/internal/task/setup/ExtractTinyIntermediaryMappingsTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/setup/ExtractTinyIntermediaryMappingsTask.java @@ -1,8 +1,14 @@ package quilt.internal.task.setup; +import org.gradle.api.Task; +import org.gradle.api.specs.Spec; +import org.gradle.api.tasks.TaskCollection; import org.gradle.api.tasks.TaskContainer; import quilt.internal.plugin.MapIntermediaryPlugin; +/** + * @see MapIntermediaryPlugin MapIntermediaryPlugin's configureEach + */ public abstract class ExtractTinyIntermediaryMappingsTask extends ExtractTinyMappingsTask implements IntermediaryDependantTask { /** diff --git a/buildSrc/src/main/java/quilt/internal/task/setup/IntermediaryDependantTask.java b/buildSrc/src/main/java/quilt/internal/task/setup/IntermediaryDependantTask.java index fae9ebb98b..e3f8bd07e2 100644 --- a/buildSrc/src/main/java/quilt/internal/task/setup/IntermediaryDependantTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/setup/IntermediaryDependantTask.java @@ -1,13 +1,16 @@ package quilt.internal.task.setup; +import org.gradle.api.Task; +import org.gradle.api.specs.Spec; import org.gradle.api.tasks.TaskCollection; import quilt.internal.plugin.MapIntermediaryPlugin; +import quilt.internal.plugin.MapMinecraftJarsPlugin; import quilt.internal.task.MappingsTask; /** * A task that depends on {@value quilt.internal.Constants#INTERMEDIARY_MAPPINGS_NAME} mappings * for the current Minecraft version. - *

    - * {@link MapIntermediaryPlugin} {@linkplain TaskCollection#configureEach configures} some defaults. + * + * @see MapIntermediaryPlugin MapIntermediaryPlugin's configureEach */ public interface IntermediaryDependantTask extends MappingsTask { } diff --git a/buildSrc/src/main/java/quilt/internal/task/unpick/UnpickJarTask.java b/buildSrc/src/main/java/quilt/internal/task/unpick/UnpickJarTask.java index 79df3b7207..1f6a74b4e3 100644 --- a/buildSrc/src/main/java/quilt/internal/task/unpick/UnpickJarTask.java +++ b/buildSrc/src/main/java/quilt/internal/task/unpick/UnpickJarTask.java @@ -16,8 +16,8 @@ /** * Unpicks a jar file using {@link daomephsta.unpick.cli.Main}. - *

    - * {@link MapV2Plugin} {@linkplain TaskCollection#configureEach configures} some defaults. + * + * @see MapV2Plugin MapV2Plugin's configuration */ public abstract class UnpickJarTask extends JavaExec implements MappingsTask { /**