diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bb238928..f96f64e9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,7 @@ on: - 'dev/0.8' - 'dev/0.9' - 'dev/0.10.0' + - 'dev/0.11.0' jobs: build: @@ -16,10 +17,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 16 + java-version: 17 - name: Upload to Maven run: ./gradlew publish --stacktrace env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf701005..e1043a73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: strategy: fail-fast: false matrix: - version: [ 7.0.0-jdk16 , 7.2-jdk17 ] + version: [ 7.3.1-jdk17 ] runs-on: ubuntu-20.04 container: image: gradle:${{ matrix.version }} @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: gradle:7.0.1-jdk16 + image: gradle:7.3.1-jdk17 options: --user root steps: @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - version: [7.0.0-jdk16 , 7.2-jdk17] + version: [7.3.1-jdk17] test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }} runs-on: ubuntu-20.04 @@ -66,10 +66,10 @@ jobs: strategy: fail-fast: false matrix: - java: [ 16 ] + java: [ 17 ] test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }} - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v2 diff --git a/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java b/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java index 01feb2c0..3badd32b 100644 --- a/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java +++ b/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java @@ -14,7 +14,7 @@ import org.gradle.util.GradleVersion; @SuppressWarnings("unused") public class LoomGradlePluginBootstrap implements Plugin { private static final int MIN_SUPPORTED_MAJOR_GRADLE_VERSION = 7; - private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 16; + private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 17; private static final int MIN_SUPPORTED_MAJOR_IDEA_VERSION = 2021; private static final String PLUGIN_CLASS_NAME = "net.fabricmc.loom.LoomGradlePlugin"; diff --git a/bootstrap/test-project/build.gradle b/bootstrap/test-project/build.gradle index ab88e467..5e49c3db 100644 --- a/bootstrap/test-project/build.gradle +++ b/bootstrap/test-project/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'dev.architectury.loom' version '0.10.local' + id 'dev.architectury.loom' version '0.11.local' } dependencies { diff --git a/build.gradle b/build.gradle index 0ad20060..f8fc4a8a 100644 --- a/build.gradle +++ b/build.gradle @@ -13,17 +13,17 @@ plugins { id 'me.shedaniel.java-version-bridge' version '1.0-SNAPSHOT' } -sourceCompatibility = 16 -targetCompatibility = 16 +sourceCompatibility = 17 +targetCompatibility = 17 tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" - it.options.release = 16 + it.options.release = 17 } group = "dev.architectury" archivesBaseName = project.name -def baseVersion = '0.10.0' +def baseVersion = '0.11.0' def runNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "9999" def isSnapshot = System.getenv("PR_NUM") != null @@ -73,10 +73,10 @@ dependencies { bootstrap project(":bootstrap") // libraries - implementation ('commons-io:commons-io:2.8.0') - implementation ('com.google.code.gson:gson:2.8.8') - implementation ('com.fasterxml.jackson.core:jackson-databind:2.12.5') - implementation ('com.google.guava:guava:30.1.1-jre') + implementation ('commons-io:commons-io:2.11.0') + implementation ('com.google.code.gson:gson:2.8.9') + implementation ('com.fasterxml.jackson.core:jackson-databind:2.13.0') + implementation ('com.google.guava:guava:31.0.1-jre') implementation ('org.ow2.asm:asm:9.2') implementation ('org.ow2.asm:asm-analysis:9.2') implementation ('org.ow2.asm:asm-commons:9.2') @@ -109,7 +109,7 @@ dependencies { // Kapt integration - compileOnly('org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21') + compileOnly('org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0') // Forge patches implementation ('net.minecraftforge:installertools:1.2.0') @@ -127,7 +127,7 @@ dependencies { testImplementation 'io.javalin:javalin:3.13.11' testImplementation 'net.fabricmc:fabric-installer:0.9.0' - compileOnly 'org.jetbrains:annotations:22.0.0' + compileOnly 'org.jetbrains:annotations:23.0.0' } blossom { @@ -180,11 +180,11 @@ spotless { checkstyle { configFile = file('checkstyle.xml') - toolVersion = '8.44' + toolVersion = '9.2' } codenarc { - toolVersion = "2.1.0" + toolVersion = "2.2.0" configFile = file("codenarc.groovy") } @@ -200,7 +200,7 @@ gradlePlugin { build.dependsOn downgradeJava jacoco { - toolVersion = "0.8.6" + toolVersion = "0.8.7" } // Run to get test coverage. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d435ce29..3cd8500c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java b/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java index bdc94f3a..1856ea6b 100644 --- a/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java +++ b/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java @@ -46,7 +46,6 @@ import net.fabricmc.loom.configuration.ide.IdeConfiguration; import net.fabricmc.loom.decompilers.DecompilerConfiguration; import net.fabricmc.loom.extension.LoomFiles; import net.fabricmc.loom.extension.LoomGradleExtensionImpl; -import net.fabricmc.loom.extension.MinecraftGradleExtension; import net.fabricmc.loom.task.LoomTasks; public class LoomGradlePlugin implements BootstrappedPlugin { @@ -84,9 +83,8 @@ public class LoomGradlePlugin implements BootstrappedPlugin { project.apply(ImmutableMap.of("plugin", "eclipse")); project.apply(ImmutableMap.of("plugin", "idea")); - // Setup extensions, minecraft wraps loom - LoomGradleExtensionAPI extension = project.getExtensions().create(LoomGradleExtensionAPI.class, "loom", LoomGradleExtensionImpl.class, project, LoomFiles.create(project)); - project.getExtensions().create(LoomGradleExtensionAPI.class, "minecraft", MinecraftGradleExtension.class, extension); + // Setup extensions + project.getExtensions().create(LoomGradleExtensionAPI.class, "loom", LoomGradleExtensionImpl.class, project, LoomFiles.create(project)); project.getExtensions().create("fabricApi", FabricApiExtension.class, project); CompileConfiguration.setupConfigurations(project); diff --git a/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java b/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java index 1e939f3c..edf28d37 100644 --- a/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java +++ b/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java @@ -24,7 +24,6 @@ package net.fabricmc.loom.api; -import java.io.File; import java.util.List; import java.util.function.Consumer; @@ -58,62 +57,20 @@ public interface LoomGradleExtensionAPI { RegularFileProperty getAccessWidenerPath(); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default File getAccessWidener() { - getDeprecationHelper().replaceWithInLoom0_11("accessWidener", "accessWidenerPath"); - return getAccessWidenerPath().getAsFile().getOrNull(); - } - - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default void setAccessWidener(File file) { - getDeprecationHelper().replaceWithInLoom0_11("accessWidener", "accessWidenerPath"); - getAccessWidenerPath().set(file); - } - Property getShareRemapCaches(); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default void setShareCaches(boolean shareCaches) { - getDeprecationHelper().replaceWithInLoom0_11("shareCaches", "shareRemapCaches"); - getShareRemapCaches().set(shareCaches); - } - - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default boolean isShareCaches() { - getDeprecationHelper().replaceWithInLoom0_11("shareCaches", "shareRemapCaches"); - return getShareRemapCaches().get(); - } - default void shareCaches() { getShareRemapCaches().set(true); } ListProperty getGameDecompilers(); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default List getDecompilers() { - getDeprecationHelper().replaceWithInLoom0_11("decompilers", "gameDecompilers"); - return getGameDecompilers().get(); - } - default void addDecompiler(LoomDecompiler decompiler) { getGameDecompilers().add(decompiler); } ListProperty getGameJarProcessors(); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default List getJarProcessors() { - getDeprecationHelper().replaceWithInLoom0_11("jarProcessors", "gameJarProcessors"); - return getGameJarProcessors().get(); - } - default void addJarProcessor(JarProcessor processor) { getGameJarProcessors().add(processor); } @@ -126,36 +83,8 @@ public interface LoomGradleExtensionAPI { Dependency layered(Action action); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default String getRefmapName() { - getDeprecationHelper().replaceWithInLoom0_11("refmapName", "mixin.defaultRefmapName"); - return getMixin().getDefaultRefmapName().get(); - } - - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default void setRefmapName(String refmapName) { - getDeprecationHelper().replaceWithInLoom0_11("refmapName", "mixin.defaultRefmapName"); - getMixin().getDefaultRefmapName().set(refmapName); - } - Property getRemapArchives(); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default boolean isRemapMod() { - getDeprecationHelper().replaceWithInLoom0_11("remapMod", "remapArchives"); - return getRemapArchives().get(); - } - - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default void setRemapMod(boolean remapMod) { - getDeprecationHelper().replaceWithInLoom0_11("remapMod", "remapArchives"); - getRemapArchives().set(remapMod); - } - void runs(Action> action); NamedDomainObjectContainer getRunConfigs(); @@ -168,20 +97,6 @@ public interface LoomGradleExtensionAPI { Property getCustomMinecraftManifest(); - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default void setCustomManifest(String customManifest) { - getDeprecationHelper().replaceWithInLoom0_11("customManifest", "customMinecraftManifest"); - getCustomMinecraftManifest().set(customManifest); - } - - @Deprecated(forRemoval = true) - @ApiStatus.ScheduledForRemoval(inVersion = "0.11") - default String getCustomManifest() { - getDeprecationHelper().replaceWithInLoom0_11("customManifest", "customMinecraftManifest"); - return getCustomMinecraftManifest().getOrNull(); - } - /** * If true, Loom will replace the {@code -dev} jars in the {@code *Elements} configurations * with remapped outgoing variants. diff --git a/src/main/java/net/fabricmc/loom/build/ModCompileRemapper.java b/src/main/java/net/fabricmc/loom/build/ModCompileRemapper.java index 76475caa..f41460ba 100644 --- a/src/main/java/net/fabricmc/loom/build/ModCompileRemapper.java +++ b/src/main/java/net/fabricmc/loom/build/ModCompileRemapper.java @@ -157,11 +157,6 @@ public class ModCompileRemapper { project.getDependencies().add(info.targetConfig.getName(), info.getRemappedNotation()); } - // Report deprecation warnings - if (entry.replacedWith() != null && !modDependencies.isEmpty()) { - extension.getDeprecationHelper().replaceWithInLoom0_11(entry.sourceConfiguration(), entry.replacedWith()); - } - // Export to other projects if (entry.targetConfiguration().equals(JavaPlugin.API_CONFIGURATION_NAME)) { project.getConfigurations().getByName(Constants.Configurations.NAMED_ELEMENTS).extendsFrom(remappedConfig); diff --git a/src/main/java/net/fabricmc/loom/configuration/RemappedConfigurationEntry.java b/src/main/java/net/fabricmc/loom/configuration/RemappedConfigurationEntry.java index 2eba6f40..dd373bdc 100644 --- a/src/main/java/net/fabricmc/loom/configuration/RemappedConfigurationEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/RemappedConfigurationEntry.java @@ -28,13 +28,8 @@ import java.util.Set; import org.gradle.api.artifacts.ConfigurationContainer; import org.gradle.api.plugins.JavaPlugin; -import org.jetbrains.annotations.Nullable; - -public record RemappedConfigurationEntry(String sourceConfiguration, String targetConfiguration, boolean compileClasspath, boolean runtimeClasspath, PublishingMode publishingMode, @Nullable String replacedWith) { - public RemappedConfigurationEntry(String sourceConfiguration, String targetConfiguration, boolean compileClasspath, boolean runtimeClasspath, PublishingMode publishingMode) { - this(sourceConfiguration, targetConfiguration, compileClasspath, runtimeClasspath, publishingMode, null); - } +public record RemappedConfigurationEntry(String sourceConfiguration, String targetConfiguration, boolean compileClasspath, boolean runtimeClasspath, PublishingMode publishingMode) { public String getRemappedConfiguration() { return sourceConfiguration + "Mapped"; } diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingsSpecBuilderImpl.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingsSpecBuilderImpl.java index fd7c15ad..9ee645d5 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingsSpecBuilderImpl.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingsSpecBuilderImpl.java @@ -27,8 +27,7 @@ package net.fabricmc.loom.configuration.providers.mappings.mojmap; import net.fabricmc.loom.api.mappings.layered.spec.MojangMappingsSpecBuilder; public class MojangMappingsSpecBuilderImpl implements MojangMappingsSpecBuilder { - // TODO 0.11 loom change default to false - private boolean nameSyntheticMembers = true; + private boolean nameSyntheticMembers = false; private MojangMappingsSpecBuilderImpl() { } diff --git a/src/main/java/net/fabricmc/loom/extension/MinecraftGradleExtension.java b/src/main/java/net/fabricmc/loom/extension/MinecraftGradleExtension.java deleted file mode 100644 index bd33fd62..00000000 --- a/src/main/java/net/fabricmc/loom/extension/MinecraftGradleExtension.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * This file is part of fabric-loom, licensed under the MIT License (MIT). - * - * Copyright (c) 2021 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. - */ - -package net.fabricmc.loom.extension; - -import java.util.List; -import java.util.function.Consumer; - -import org.gradle.api.Action; -import org.gradle.api.NamedDomainObjectContainer; -import org.gradle.api.artifacts.Dependency; -import org.gradle.api.file.ConfigurableFileCollection; -import org.gradle.api.file.RegularFileProperty; -import org.gradle.api.provider.ListProperty; -import org.gradle.api.provider.Property; -import org.gradle.api.provider.Provider; -import org.gradle.api.publish.maven.MavenPublication; - -import net.fabricmc.loom.api.ForgeExtensionAPI; -import net.fabricmc.loom.api.LoomGradleExtensionAPI; -import net.fabricmc.loom.api.MixinExtensionAPI; -import net.fabricmc.loom.api.decompilers.LoomDecompiler; -import net.fabricmc.loom.api.decompilers.architectury.ArchitecturyLoomDecompiler; -import net.fabricmc.loom.api.mappings.layered.spec.LayeredMappingSpecBuilder; -import net.fabricmc.loom.configuration.ide.RunConfig; -import net.fabricmc.loom.configuration.ide.RunConfigSettings; -import net.fabricmc.loom.configuration.launch.LaunchProviderSettings; -import net.fabricmc.loom.configuration.processors.JarProcessor; -import net.fabricmc.loom.util.DeprecationHelper; -import net.fabricmc.loom.util.ModPlatform; - -public class MinecraftGradleExtension implements LoomGradleExtensionAPI { - private final LoomGradleExtensionAPI parent; - private boolean deprecationReported = false; - - public MinecraftGradleExtension(LoomGradleExtensionAPI parent) { - this.parent = parent; - } - - private void reportDeprecation() { - if (!deprecationReported) { - getDeprecationHelper().replaceWithInLoom0_11("minecraft", "loom"); - deprecationReported = true; - } - } - - @Override - public DeprecationHelper getDeprecationHelper() { - return parent.getDeprecationHelper(); - } - - @Override - public RegularFileProperty getAccessWidenerPath() { - reportDeprecation(); - return parent.getAccessWidenerPath(); - } - - @Override - public Property getShareRemapCaches() { - reportDeprecation(); - return parent.getShareRemapCaches(); - } - - @Override - public ListProperty getGameDecompilers() { - reportDeprecation(); - return parent.getGameDecompilers(); - } - - @Override - public ListProperty getGameJarProcessors() { - reportDeprecation(); - return parent.getGameJarProcessors(); - } - - @Override - public ConfigurableFileCollection getLog4jConfigs() { - reportDeprecation(); - return parent.getLog4jConfigs(); - } - - @Override - public Dependency layered(Action action) { - reportDeprecation(); - return parent.layered(action); - } - - @Override - public Property getRemapArchives() { - reportDeprecation(); - return parent.getRemapArchives(); - } - - @Override - public void runs(Action> action) { - reportDeprecation(); - parent.runs(action); - } - - @Override - public NamedDomainObjectContainer getRunConfigs() { - reportDeprecation(); - return parent.getRunConfigs(); - } - - @Override - public void mixin(Action action) { - reportDeprecation(); - parent.mixin(action); - } - - @Override - public MixinExtensionAPI getMixin() { - reportDeprecation(); - return parent.getMixin(); - } - - @Override - public Property getCustomMinecraftManifest() { - reportDeprecation(); - return parent.getCustomMinecraftManifest(); - } - - @Override - public Property getSetupRemappedVariants() { - reportDeprecation(); - return parent.getSetupRemappedVariants(); - } - - @Override - public void disableDeprecatedPomGeneration(MavenPublication publication) { - reportDeprecation(); - parent.disableDeprecatedPomGeneration(publication); - } - - @Override - public String getModVersion() { - reportDeprecation(); - throw new UnsupportedOperationException("Use loom extension"); - } - - @Override - public Property getEnableTransitiveAccessWideners() { - reportDeprecation(); - throw new UnsupportedOperationException(); - } - - @Override - public Property getIntermediaryUrl() { - reportDeprecation(); - return parent.getIntermediaryUrl(); - } - - @Override - public ListProperty getArchGameDecompilers() { - reportDeprecation(); - return parent.getArchGameDecompilers(); - } - - @Override - public void silentMojangMappingsLicense() { - reportDeprecation(); - parent.silentMojangMappingsLicense(); - } - - @Override - public boolean isSilentMojangMappingsLicenseEnabled() { - reportDeprecation(); - return parent.isSilentMojangMappingsLicenseEnabled(); - } - - @Override - public Provider getPlatform() { - reportDeprecation(); - return parent.getPlatform(); - } - - @Override - public void setGenerateSrgTiny(Boolean generateSrgTiny) { - reportDeprecation(); - parent.setGenerateSrgTiny(generateSrgTiny); - } - - @Override - public boolean shouldGenerateSrgTiny() { - reportDeprecation(); - return parent.shouldGenerateSrgTiny(); - } - - @Override - public void launches(Action> action) { - reportDeprecation(); - parent.launches(action); - } - - @Override - public NamedDomainObjectContainer getLaunchConfigs() { - reportDeprecation(); - return parent.getLaunchConfigs(); - } - - @Override - public List getTasksBeforeRun() { - reportDeprecation(); - return parent.getTasksBeforeRun(); - } - - @Override - public List> getSettingsPostEdit() { - reportDeprecation(); - return parent.getSettingsPostEdit(); - } - - @Override - public ForgeExtensionAPI getForge() { - reportDeprecation(); - return parent.getForge(); - } - - @Override - public void forge(Action action) { - reportDeprecation(); - parent.forge(action); - } -} diff --git a/src/main/java/net/fabricmc/loom/task/LoomTasks.java b/src/main/java/net/fabricmc/loom/task/LoomTasks.java index 47ea0eb6..6eb2b90e 100644 --- a/src/main/java/net/fabricmc/loom/task/LoomTasks.java +++ b/src/main/java/net/fabricmc/loom/task/LoomTasks.java @@ -31,6 +31,7 @@ import java.io.UncheckedIOException; import com.google.common.base.Preconditions; import org.gradle.api.Project; import org.gradle.api.tasks.TaskContainer; +import org.gradle.api.tasks.TaskProvider; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.decompilers.LoomDecompiler; @@ -60,12 +61,12 @@ public final class LoomTasks { tasks.register("downloadAssets", DownloadAssetsTask.class, t -> t.setDescription("Downloads required assets for Fabric.")); tasks.register("remapSourcesJar", RemapSourcesJarTask.class, t -> t.setDescription("Remaps the project sources jar to intermediary names.")); - tasks.getByName("check").dependsOn( - tasks.register("validateAccessWidener", ValidateAccessWidenerTask.class, t -> { - t.setDescription("Validate all the rules in the access widener against the Minecraft jar"); - t.setGroup("verification"); - }) - ); + TaskProvider validateAccessWidener = tasks.register("validateAccessWidener", ValidateAccessWidenerTask.class, t -> { + t.setDescription("Validate all the rules in the access widener against the Minecraft jar"); + t.setGroup("verification"); + }); + + tasks.named("check").configure(task -> task.dependsOn(validateAccessWidener)); registerIDETasks(tasks); registerRunTasks(tasks, project); @@ -184,8 +185,10 @@ public final class LoomTasks { task.getInputJar().set(inputJar); if (mappingsProvider.hasUnpickDefinitions()) { - task.dependsOn(tasks.getByName("unpickJar")); + task.dependsOn(tasks.named("unpickJar")); } + + task.dependsOn(tasks.named("validateAccessWidener")); }); } @@ -207,7 +210,7 @@ public final class LoomTasks { task.setDescription("Decompile minecraft using the default decompiler."); task.setGroup(Constants.TaskGroup.FABRIC); - task.dependsOn(project.getTasks().getByName("genSourcesWithCfr")); + task.dependsOn(project.getTasks().named("genSourcesWithCfr")); }); }); } diff --git a/src/main/java/net/fabricmc/loom/task/RunClientTask.java b/src/main/java/net/fabricmc/loom/task/RunClientTask.java deleted file mode 100644 index 4120dd82..00000000 --- a/src/main/java/net/fabricmc/loom/task/RunClientTask.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of fabric-loom, licensed under the MIT License (MIT). - * - * Copyright (c) 2016-2021 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. - */ - -package net.fabricmc.loom.task; - -import net.fabricmc.loom.LoomGradleExtension; -import net.fabricmc.loom.configuration.ide.RunConfig; - -@Deprecated // Replaced by RunGameTask -public class RunClientTask extends AbstractRunTask { - public RunClientTask() { - super(project -> { - LoomGradleExtension extension = LoomGradleExtension.get(project); - return RunConfig.runConfig(project, extension.getRunConfigs().getByName("client")); - }); - LoomGradleExtension.get(getProject()).getDeprecationHelper().replaceWithInLoom0_11("RunClientTask", "RunGameTask"); - } -} diff --git a/src/main/java/net/fabricmc/loom/task/RunServerTask.java b/src/main/java/net/fabricmc/loom/task/RunServerTask.java deleted file mode 100644 index 635c5345..00000000 --- a/src/main/java/net/fabricmc/loom/task/RunServerTask.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of fabric-loom, licensed under the MIT License (MIT). - * - * Copyright (c) 2016-2021 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. - */ - -package net.fabricmc.loom.task; - -import net.fabricmc.loom.LoomGradleExtension; -import net.fabricmc.loom.configuration.ide.RunConfig; - -@Deprecated // Replaced by RunGameTask -public class RunServerTask extends AbstractRunTask { - public RunServerTask() { - super(project -> { - LoomGradleExtension extension = LoomGradleExtension.get(project); - return RunConfig.runConfig(project, extension.getRunConfigs().getByName("client")); - }); - LoomGradleExtension.get(getProject()).getDeprecationHelper().replaceWithInLoom0_11("RunServerTask", "RunGameTask"); - } -} diff --git a/src/main/java/net/fabricmc/loom/util/Constants.java b/src/main/java/net/fabricmc/loom/util/Constants.java index 8160b361..eee920b2 100644 --- a/src/main/java/net/fabricmc/loom/util/Constants.java +++ b/src/main/java/net/fabricmc/loom/util/Constants.java @@ -48,7 +48,6 @@ public class Constants { public static final List MOD_COMPILE_ENTRIES = ImmutableList.of( new RemappedConfigurationEntry("modApi", JavaPlugin.API_CONFIGURATION_NAME, true, true, PublishingMode.COMPILE_AND_RUNTIME), new RemappedConfigurationEntry("modImplementation", JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, true, true, PublishingMode.RUNTIME_ONLY), - new RemappedConfigurationEntry("modRuntime", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, true, PublishingMode.NONE, "modRuntimeOnly"), new RemappedConfigurationEntry("modCompileOnly", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, false, PublishingMode.NONE), new RemappedConfigurationEntry("modCompileOnlyApi", JavaPlugin.COMPILE_ONLY_API_CONFIGURATION_NAME, true, false, PublishingMode.COMPILE_ONLY), new RemappedConfigurationEntry("modRuntimeOnly", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, true, PublishingMode.RUNTIME_ONLY), @@ -118,7 +117,7 @@ public class Constants { public static final String MIXIN_COMPILE_EXTENSIONS = "0.4.6"; public static final String DEV_LAUNCH_INJECTOR = "0.2.1+build.8"; public static final String TERMINAL_CONSOLE_APPENDER = "1.2.0"; - public static final String JETBRAINS_ANNOTATIONS = "22.0.0"; + public static final String JETBRAINS_ANNOTATIONS = "23.0.0"; public static final String JAVAX_ANNOTATIONS = "3.0.2"; public static final String FORGE_RUNTIME = "1.1.3"; public static final String ACCESS_TRANSFORMERS = "3.0.1"; diff --git a/src/main/java/net/fabricmc/loom/util/DeprecationHelper.java b/src/main/java/net/fabricmc/loom/util/DeprecationHelper.java index f38c9022..d7b693db 100644 --- a/src/main/java/net/fabricmc/loom/util/DeprecationHelper.java +++ b/src/main/java/net/fabricmc/loom/util/DeprecationHelper.java @@ -31,14 +31,6 @@ import org.gradle.api.logging.LogLevel; import org.gradle.api.logging.configuration.WarningMode; public interface DeprecationHelper { - default void replaceWithInLoom0_10(String currentName, String newName) { - toBeRemovedIn(currentName, newName, "Loom 0.10"); - } - - default void replaceWithInLoom0_11(String currentName, String newName) { - toBeRemovedIn(currentName, newName, "Loom 0.11"); - } - default void replaceWithInLoom0_12(String currentName, String newName) { toBeRemovedIn(currentName, newName, "Loom 0.12"); } diff --git a/src/test/groovy/net/fabricmc/loom/test/LoomTestConstants.groovy b/src/test/groovy/net/fabricmc/loom/test/LoomTestConstants.groovy index eadb75f2..aaca59c8 100644 --- a/src/test/groovy/net/fabricmc/loom/test/LoomTestConstants.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/LoomTestConstants.groovy @@ -28,7 +28,7 @@ import org.gradle.util.GradleVersion class LoomTestConstants { public final static String DEFAULT_GRADLE = GradleVersion.current().getVersion() - public final static String PRE_RELEASE_GRADLE = "7.4-20211201231918+0000" + public final static String PRE_RELEASE_GRADLE = "7.4-20211203231050+0000" public final static String[] STANDARD_TEST_VERSIONS = [DEFAULT_GRADLE, PRE_RELEASE_GRADLE] } diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/layeredmappings/LayeredMappingSpecBuilderTest.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/layeredmappings/LayeredMappingSpecBuilderTest.groovy index 9ed383c5..7a3ccd4f 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/layeredmappings/LayeredMappingSpecBuilderTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/layeredmappings/LayeredMappingSpecBuilderTest.groovy @@ -41,7 +41,7 @@ class LayeredMappingSpecBuilderTest extends LayeredMappingsSpecification { } def layers = spec.layers() then: - spec.version == "layered+hash.2192" + spec.version == "layered+hash.2198" layers.size() == 2 layers[0].class == IntermediaryMappingsSpec layers[1].class == MojangMappingsSpec @@ -56,7 +56,7 @@ class LayeredMappingSpecBuilderTest extends LayeredMappingsSpecification { def layers = spec.layers() def parchment = layers[2] as ParchmentMappingsSpec then: - spec.version == "layered+hash.863752565" + spec.version == "layered+hash.863752751" layers.size() == 3 layers[0].class == IntermediaryMappingsSpec layers[1].class == MojangMappingsSpec @@ -76,7 +76,7 @@ class LayeredMappingSpecBuilderTest extends LayeredMappingsSpecification { def layers = spec.layers() def parchment = layers[2] as ParchmentMappingsSpec then: - spec.version == "layered+hash.863752571" + spec.version == "layered+hash.863752757" layers.size() == 3 layers[0].class == IntermediaryMappingsSpec layers[1].class == MojangMappingsSpec @@ -96,7 +96,7 @@ class LayeredMappingSpecBuilderTest extends LayeredMappingsSpecification { def layers = spec.layers() def parchment = layers[2] as ParchmentMappingsSpec then: - spec.version == "layered+hash.1144427326" + spec.version == "layered+hash.1144427140" layers.size() == 3 layers[0].class == IntermediaryMappingsSpec layers[1].class == MojangMappingsSpec