From c2028d81b1bedf3a50aa566e1042a00a456fc94f Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 21 Mar 2026 02:50:37 +0900 Subject: [PATCH] Fix build, hopefully --- .../AccessTransformerJarProcessor.java | 4 +-- .../loom/accesstransformer/package-info.java | 28 +++++++++++++++++++ .../loom/extensions/package-info.java | 28 +++++++++++++++++++ .../loom/forge/config/package-info.java | 28 +++++++++++++++++++ .../loom/forge/dependency/package-info.java | 28 +++++++++++++++++++ .../loom/forge/minecraft/package-info.java | 28 +++++++++++++++++++ .../architectury/loom/forge/package-info.java | 28 +++++++++++++++++++ .../loom/forge/tool/package-info.java | 28 +++++++++++++++++++ .../loom/mappings/ForgeMappingsMerger.java | 8 +++--- .../architectury/loom/mappings/MCPReader.java | 4 +-- .../loom/mappings/crane/package-info.java | 28 +++++++++++++++++++ .../loom/mappings/package-info.java | 28 +++++++++++++++++++ .../loom/mcpconfig/McpExecutorBuilder.java | 6 ++-- .../mcpconfig/steplogic/package-info.java | 28 +++++++++++++++++++ .../loom/metadata/package-info.java | 28 +++++++++++++++++++ .../loom/neoforge/StringConstantPatcher.java | 4 +-- .../loom/neoforge/package-info.java | 28 +++++++++++++++++++ .../architectury/loom/util/LoggerFilter.java | 4 +-- .../dev/architectury/loom/util/Version.java | 4 +-- .../loom/util/collection/package-info.java | 28 +++++++++++++++++++ .../loom/util/function/package-info.java | 28 +++++++++++++++++++ .../architectury/loom/util/package-info.java | 28 +++++++++++++++++++ .../loom/build/nesting/JarNester.java | 4 +-- .../net/fabricmc/loom/build/package-info.java | 28 +++++++++++++++++++ .../classpathgroups/ClasspathGroup.java | 2 +- .../mods/AccessWidenerUtils.java | 1 - .../LayeredMappingSpecBuilderImpl.java | 2 +- .../task/launch/GenerateLog4jConfigTask.java | 2 +- 28 files changed, 470 insertions(+), 23 deletions(-) create mode 100644 src/main/java/dev/architectury/loom/accesstransformer/package-info.java create mode 100644 src/main/java/dev/architectury/loom/extensions/package-info.java create mode 100644 src/main/java/dev/architectury/loom/forge/config/package-info.java create mode 100644 src/main/java/dev/architectury/loom/forge/dependency/package-info.java create mode 100644 src/main/java/dev/architectury/loom/forge/minecraft/package-info.java create mode 100644 src/main/java/dev/architectury/loom/forge/package-info.java create mode 100644 src/main/java/dev/architectury/loom/forge/tool/package-info.java create mode 100644 src/main/java/dev/architectury/loom/mappings/crane/package-info.java create mode 100644 src/main/java/dev/architectury/loom/mappings/package-info.java create mode 100644 src/main/java/dev/architectury/loom/mcpconfig/steplogic/package-info.java create mode 100644 src/main/java/dev/architectury/loom/metadata/package-info.java create mode 100644 src/main/java/dev/architectury/loom/neoforge/package-info.java create mode 100644 src/main/java/dev/architectury/loom/util/collection/package-info.java create mode 100644 src/main/java/dev/architectury/loom/util/function/package-info.java create mode 100644 src/main/java/dev/architectury/loom/util/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/build/package-info.java diff --git a/src/main/java/dev/architectury/loom/accesstransformer/AccessTransformerJarProcessor.java b/src/main/java/dev/architectury/loom/accesstransformer/AccessTransformerJarProcessor.java index 218cb7bd..1b5edf28 100644 --- a/src/main/java/dev/architectury/loom/accesstransformer/AccessTransformerJarProcessor.java +++ b/src/main/java/dev/architectury/loom/accesstransformer/AccessTransformerJarProcessor.java @@ -44,7 +44,7 @@ import dev.architectury.loom.util.TempFiles; import org.gradle.api.Project; import org.gradle.api.logging.Logger; import org.gradle.api.logging.Logging; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; @@ -74,7 +74,7 @@ public class AccessTransformerJarProcessor implements MinecraftJarProcessor entries = new ArrayList<>(); for (File atFile : localAccessTransformers) { diff --git a/src/main/java/dev/architectury/loom/accesstransformer/package-info.java b/src/main/java/dev/architectury/loom/accesstransformer/package-info.java new file mode 100644 index 00000000..62ef856d --- /dev/null +++ b/src/main/java/dev/architectury/loom/accesstransformer/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.accesstransformer; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/extensions/package-info.java b/src/main/java/dev/architectury/loom/extensions/package-info.java new file mode 100644 index 00000000..a359ed2d --- /dev/null +++ b/src/main/java/dev/architectury/loom/extensions/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.extensions; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/forge/config/package-info.java b/src/main/java/dev/architectury/loom/forge/config/package-info.java new file mode 100644 index 00000000..c6f34dd1 --- /dev/null +++ b/src/main/java/dev/architectury/loom/forge/config/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.forge.config; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/forge/dependency/package-info.java b/src/main/java/dev/architectury/loom/forge/dependency/package-info.java new file mode 100644 index 00000000..478e28c9 --- /dev/null +++ b/src/main/java/dev/architectury/loom/forge/dependency/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.forge.dependency; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/forge/minecraft/package-info.java b/src/main/java/dev/architectury/loom/forge/minecraft/package-info.java new file mode 100644 index 00000000..cdc67f2a --- /dev/null +++ b/src/main/java/dev/architectury/loom/forge/minecraft/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.forge.minecraft; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/forge/package-info.java b/src/main/java/dev/architectury/loom/forge/package-info.java new file mode 100644 index 00000000..4da752cc --- /dev/null +++ b/src/main/java/dev/architectury/loom/forge/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.forge; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/forge/tool/package-info.java b/src/main/java/dev/architectury/loom/forge/tool/package-info.java new file mode 100644 index 00000000..0c6e2c3c --- /dev/null +++ b/src/main/java/dev/architectury/loom/forge/tool/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.forge.tool; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/mappings/ForgeMappingsMerger.java b/src/main/java/dev/architectury/loom/mappings/ForgeMappingsMerger.java index 45c2272f..4e6784cc 100644 --- a/src/main/java/dev/architectury/loom/mappings/ForgeMappingsMerger.java +++ b/src/main/java/dev/architectury/loom/mappings/ForgeMappingsMerger.java @@ -38,7 +38,7 @@ import java.util.function.Consumer; import dev.architectury.loom.forge.dependency.SrgProvider; import dev.architectury.loom.util.collection.CollectionUtil; import dev.architectury.loom.util.collection.Multimap; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.mappings.layered.MappingContext; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; @@ -177,7 +177,7 @@ public final class ForgeMappingsMerger { return output; } - private void mergeField(MappingTree.ClassMapping newNsClass, MappingTree.FieldMapping newNsField, @Nullable MappingTree.ClassMapping tinyClass) throws IOException { + private void mergeField(MappingTree.ClassMapping newNsClass, MappingTree.FieldMapping newNsField, MappingTree.@Nullable ClassMapping tinyClass) throws IOException { String[] dstNames = createDstNameArray(newNsField); MappingTree.FieldMapping tinyField = null; String srcDesc = newNsField.getSrcDesc(); @@ -209,7 +209,7 @@ public final class ForgeMappingsMerger { } } - private void mergeMethod(MappingTree.ClassMapping newNsClass, MappingTree.MethodMapping newNsMethod, @Nullable MappingTree.ClassMapping tinyClass) throws IOException { + private void mergeMethod(MappingTree.ClassMapping newNsClass, MappingTree.MethodMapping newNsMethod, MappingTree.@Nullable ClassMapping tinyClass) throws IOException { String[] dstNames = createDstNameArray(newNsMethod); MappingTree.MethodMapping tinyMethod = null; String intermediaryName, namedName; @@ -233,7 +233,7 @@ public final class ForgeMappingsMerger { return; } - @Nullable MappingTree.MethodMapping fillMethod = null; + MappingTree.@Nullable MethodMapping fillMethod = null; if (extra != null) { MappingTree.MethodMapping extraMethod = extra.getMethod(newNsClass.getSrcName(), newNsMethod.getSrcName(), newNsMethod.getSrcDesc()); diff --git a/src/main/java/dev/architectury/loom/mappings/MCPReader.java b/src/main/java/dev/architectury/loom/mappings/MCPReader.java index c9e06a28..ef9a9a41 100644 --- a/src/main/java/dev/architectury/loom/mappings/MCPReader.java +++ b/src/main/java/dev/architectury/loom/mappings/MCPReader.java @@ -38,7 +38,7 @@ import java.util.regex.Pattern; import com.opencsv.CSVReader; import com.opencsv.exceptions.CsvValidationException; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.util.FileSystemUtil; import net.fabricmc.mappingio.MappingReader; @@ -276,7 +276,7 @@ public class MCPReader { private record MemberToken( TokenType type, - @Nullable MCPReader.MemberToken owner, + MCPReader.@Nullable MemberToken owner, String name, @Nullable String descriptor ) { diff --git a/src/main/java/dev/architectury/loom/mappings/crane/package-info.java b/src/main/java/dev/architectury/loom/mappings/crane/package-info.java new file mode 100644 index 00000000..e47a3600 --- /dev/null +++ b/src/main/java/dev/architectury/loom/mappings/crane/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.mappings.crane; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/mappings/package-info.java b/src/main/java/dev/architectury/loom/mappings/package-info.java new file mode 100644 index 00000000..fc7bfbcf --- /dev/null +++ b/src/main/java/dev/architectury/loom/mappings/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.mappings; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/mcpconfig/McpExecutorBuilder.java b/src/main/java/dev/architectury/loom/mcpconfig/McpExecutorBuilder.java index ba691e9b..28d153a1 100644 --- a/src/main/java/dev/architectury/loom/mcpconfig/McpExecutorBuilder.java +++ b/src/main/java/dev/architectury/loom/mcpconfig/McpExecutorBuilder.java @@ -58,7 +58,7 @@ import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.Dependency; import org.gradle.api.file.FileCollection; import org.gradle.api.provider.Provider; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.configuration.providers.minecraft.MinecraftProvider; @@ -81,7 +81,7 @@ public final class McpExecutorBuilder { private final Map functions; private final Map config = new HashMap<>(); private final StepLogic.SetupContext setupContext = new SetupContextImpl(); - private @Nullable StepLogic.StepLogicProvider stepLogicProvider = null; + private StepLogic.@Nullable StepLogicProvider stepLogicProvider = null; public McpExecutorBuilder(Project project, MinecraftProvider minecraftProvider, Path cache, McpConfigProvider provider, String environment) { this.project = project; @@ -208,7 +208,7 @@ public final class McpExecutorBuilder { * * @param stepLogicProvider the provider, or null to disable */ - public void setStepLogicProvider(@Nullable StepLogic.StepLogicProvider stepLogicProvider) { + public void setStepLogicProvider(StepLogic.@Nullable StepLogicProvider stepLogicProvider) { this.stepLogicProvider = stepLogicProvider; } diff --git a/src/main/java/dev/architectury/loom/mcpconfig/steplogic/package-info.java b/src/main/java/dev/architectury/loom/mcpconfig/steplogic/package-info.java new file mode 100644 index 00000000..775b4fd0 --- /dev/null +++ b/src/main/java/dev/architectury/loom/mcpconfig/steplogic/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.mcpconfig.steplogic; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/metadata/package-info.java b/src/main/java/dev/architectury/loom/metadata/package-info.java new file mode 100644 index 00000000..568963c6 --- /dev/null +++ b/src/main/java/dev/architectury/loom/metadata/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.metadata; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/neoforge/StringConstantPatcher.java b/src/main/java/dev/architectury/loom/neoforge/StringConstantPatcher.java index 214c8b09..1b8451e0 100644 --- a/src/main/java/dev/architectury/loom/neoforge/StringConstantPatcher.java +++ b/src/main/java/dev/architectury/loom/neoforge/StringConstantPatcher.java @@ -3,7 +3,7 @@ package dev.architectury.loom.neoforge; import java.util.HashMap; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.MethodVisitor; @@ -64,7 +64,7 @@ public final class StringConstantPatcher extends ClassVisitor { private static @Nullable String getNamedClassName(MappingTreeView mappings, String intermediary) { final int intermediaryNsId = mappings.getNamespaceId(MappingsNamespace.INTERMEDIARY.toString()); - final @Nullable MappingTreeView.ClassMappingView c = mappings.getClass(intermediary, intermediaryNsId); + final MappingTreeView.@Nullable ClassMappingView c = mappings.getClass(intermediary, intermediaryNsId); return c != null ? c.getName(MappingsNamespace.NAMED.toString()) : null; } diff --git a/src/main/java/dev/architectury/loom/neoforge/package-info.java b/src/main/java/dev/architectury/loom/neoforge/package-info.java new file mode 100644 index 00000000..3b7507c4 --- /dev/null +++ b/src/main/java/dev/architectury/loom/neoforge/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.neoforge; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/util/LoggerFilter.java b/src/main/java/dev/architectury/loom/util/LoggerFilter.java index 52b61fa6..31e1c0f3 100644 --- a/src/main/java/dev/architectury/loom/util/LoggerFilter.java +++ b/src/main/java/dev/architectury/loom/util/LoggerFilter.java @@ -26,7 +26,7 @@ package dev.architectury.loom.util; import java.io.PrintStream; -import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.NonNull; public class LoggerFilter { public static void replaceSystemOut() { @@ -34,7 +34,7 @@ public class LoggerFilter { PrintStream previous = System.out; System.setOut(new PrintStream(previous) { @Override - public PrintStream printf(@NotNull String format, Object... args) { + public PrintStream printf(@NonNull String format, Object... args) { if (format.equals("unknown invokedynamic bsm: %s/%s%s (tag=%d iif=%b)%n")) { return this; } diff --git a/src/main/java/dev/architectury/loom/util/Version.java b/src/main/java/dev/architectury/loom/util/Version.java index 4e8a27d8..74f3441d 100644 --- a/src/main/java/dev/architectury/loom/util/Version.java +++ b/src/main/java/dev/architectury/loom/util/Version.java @@ -29,7 +29,7 @@ import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; /** @@ -74,7 +74,7 @@ public record Version(int major, int minor, int micro, int patch, @Nullable Stri } @Override - public int compareTo(@NotNull Version other) { + public int compareTo(@NonNull Version other) { if (this.major != other.major) { return this.major - other.major; } else if (this.minor != other.minor) { diff --git a/src/main/java/dev/architectury/loom/util/collection/package-info.java b/src/main/java/dev/architectury/loom/util/collection/package-info.java new file mode 100644 index 00000000..fc0c4488 --- /dev/null +++ b/src/main/java/dev/architectury/loom/util/collection/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.util.collection; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/util/function/package-info.java b/src/main/java/dev/architectury/loom/util/function/package-info.java new file mode 100644 index 00000000..fc14eecd --- /dev/null +++ b/src/main/java/dev/architectury/loom/util/function/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.util.function; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/dev/architectury/loom/util/package-info.java b/src/main/java/dev/architectury/loom/util/package-info.java new file mode 100644 index 00000000..5d7bd6f1 --- /dev/null +++ b/src/main/java/dev/architectury/loom/util/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package dev.architectury.loom.util; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java b/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java index 34ab8d31..d9b597df 100644 --- a/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java +++ b/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java @@ -36,7 +36,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import org.gradle.api.UncheckedIOException; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import net.fabricmc.loom.LoomGradlePlugin; @@ -144,7 +144,7 @@ public class JarNester { } } - private static @Nullable NestableJarGenerationTask.Metadata readNestedFile(File file, Logger logger) { + private static NestableJarGenerationTask.@Nullable Metadata readNestedFile(File file, Logger logger) { try { return ZipUtils.unpackGsonNullable(file.toPath(), NestableJarGenerationTask.NESTING_METADATA_PATH, NestableJarGenerationTask.Metadata.class); } catch (IOException e) { diff --git a/src/main/java/net/fabricmc/loom/build/package-info.java b/src/main/java/net/fabricmc/loom/build/package-info.java new file mode 100644 index 00000000..47f0b76a --- /dev/null +++ b/src/main/java/net/fabricmc/loom/build/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.build; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/classpathgroups/ClasspathGroup.java b/src/main/java/net/fabricmc/loom/configuration/classpathgroups/ClasspathGroup.java index 152b57c8..00064f27 100644 --- a/src/main/java/net/fabricmc/loom/configuration/classpathgroups/ClasspathGroup.java +++ b/src/main/java/net/fabricmc/loom/configuration/classpathgroups/ClasspathGroup.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Set; import org.gradle.api.file.FileSystemLocation; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.ModSettings; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java b/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java index 000c22df..1405437e 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java @@ -33,7 +33,6 @@ import org.objectweb.asm.commons.Remapper; import net.fabricmc.classtweaker.api.ClassTweakerReader; import net.fabricmc.classtweaker.api.ClassTweakerWriter; import net.fabricmc.classtweaker.visitors.ClassTweakerRemapperVisitor; -import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; import net.fabricmc.loom.util.ModPlatform; import net.fabricmc.loom.util.fmj.FabricModJson; import net.fabricmc.loom.util.fmj.FabricModJsonFactory; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingSpecBuilderImpl.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingSpecBuilderImpl.java index e04cf004..5b834973 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingSpecBuilderImpl.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingSpecBuilderImpl.java @@ -30,7 +30,7 @@ import java.util.List; import dev.architectury.loom.mappings.crane.CraneMappingsSpec; import org.gradle.api.Action; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.LoomGradleExtensionAPI; import net.fabricmc.loom.api.mappings.layered.spec.FileMappingsSpecBuilder; diff --git a/src/main/java/net/fabricmc/loom/task/launch/GenerateLog4jConfigTask.java b/src/main/java/net/fabricmc/loom/task/launch/GenerateLog4jConfigTask.java index eb05ce87..1b2d4395 100644 --- a/src/main/java/net/fabricmc/loom/task/launch/GenerateLog4jConfigTask.java +++ b/src/main/java/net/fabricmc/loom/task/launch/GenerateLog4jConfigTask.java @@ -41,7 +41,7 @@ import org.gradle.api.tasks.Optional; import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.TaskAction; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.task.AbstractLoomTask;