From 3565743fc45674bd43e5bbc7c456a50024e4e47e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 2 Dec 2023 18:08:32 -0800 Subject: [PATCH] Remove deprecated forUseAtConfigurationTime call (#129) * Remove deprecated forUseAtConfigurationTime call * address review --- gradle/libs.versions.toml | 2 ++ subprojects/gradle-plugin/build.gradle.kts | 1 + .../internal/repository/MinecraftRepositoryPlugin.java | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bcbc0aa..22b98e2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,6 +12,7 @@ immutables = "2.10.0" indra = "3.1.3" junit = "5.10.1" mergeTool = "1.2.0" +mammoth = "1.3.1" [libraries] # shared @@ -37,6 +38,7 @@ junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } junit-launcher = { module = "org.junit.platform:junit-platform-launcher" } mergeTool = { module = "net.minecraftforge:mergetool", version.ref = "mergeTool" } shadowPlugin = { module = "com.github.jengelman.gradle.plugins:shadow", version = "6.1.0" } +mammoth = { module = "net.kyori:mammoth", version.ref = "mammoth" } [plugins] blossom = { id = "net.kyori.blossom", version = "2.1.0" } diff --git a/subprojects/gradle-plugin/build.gradle.kts b/subprojects/gradle-plugin/build.gradle.kts index 93630ec..d07b8e1 100644 --- a/subprojects/gradle-plugin/build.gradle.kts +++ b/subprojects/gradle-plugin/build.gradle.kts @@ -47,6 +47,7 @@ dependencies { exclude("org.ow2.asm") // Use our own ASM exclude("net.sf.jopt-simple") } + commonDeps(libs.mammoth) // Just main implementation(libs.gson) diff --git a/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/repository/MinecraftRepositoryPlugin.java b/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/repository/MinecraftRepositoryPlugin.java index 90ccef3..41d4911 100644 --- a/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/repository/MinecraftRepositoryPlugin.java +++ b/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/repository/MinecraftRepositoryPlugin.java @@ -24,6 +24,7 @@ */ package org.spongepowered.gradle.vanilla.internal.repository; +import net.kyori.mammoth.Properties; import org.checkerframework.checker.nullness.qual.Nullable; import org.gradle.api.Action; import org.gradle.api.InvalidUserDataException; @@ -302,8 +303,7 @@ private static Provider resolveCache( final String propertyName, final File root ) { - return providers.gradleProperty(propertyName) - .forUseAtConfigurationTime() + return Properties.forUseAtConfigurationTime(providers.gradleProperty(propertyName)) .map(dirName -> { final File dir = new File(dirName); if (dir.isAbsolute()) {