Skip to content

Commit

Permalink
Update to Gradle 8.12
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Dec 23, 2024
1 parent d9349c5 commit 40d17ba
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
@SuppressWarnings("unused")
public abstract class LoomGradlePluginBootstrap implements Plugin<PluginAware> {
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.11";
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.12";
private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 17;
private static final int MIN_SUPPORTED_MAJOR_IDEA_VERSION = 2022;

Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repositories {

configurations {
bootstrap {
transitive false
transitive = false
}
compileClasspath.extendsFrom bootstrap
runtimeClasspath.extendsFrom bootstrap
Expand Down Expand Up @@ -294,18 +294,18 @@ publishing {
if (!ENV.EXPERIMENTAL) {
// Also publish a snapshot so people can use the latest version if they wish
snapshot(MavenPublication) { publication ->
groupId project.group
artifactId project.base.archivesName.get()
version baseVersion + '-SNAPSHOT'
groupId = project.group
artifactId = project.base.archivesName.get()
version = baseVersion + '-SNAPSHOT'

from components.java
}

// Manually crate the plugin marker for snapshot versions
snapshotPlugin(MavenPublication) { publication ->
groupId 'fabric-loom'
artifactId 'fabric-loom.gradle.plugin'
version baseVersion + '-SNAPSHOT'
groupId = 'fabric-loom'
artifactId = 'fabric-loom.gradle.plugin'
version = baseVersion + '-SNAPSHOT'

pom.withXml({
// Based off org.gradle.plugin.devel.plugins.MavenPluginPublishPlugin
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "2.0.20"
kotlin = "2.0.21"
asm = "9.7.1"
commons-io = "2.15.1"
gson = "2.10.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle/test.libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mockito = "5.14.2"
java-debug = "0.52.0"
mixin = "0.15.3+mixin.0.8.7"

gradle-nightly = "8.12-20241110002642+0000"
gradle-nightly = "8.13-20241222002427+0000"
fabric-loader = "0.16.9"
fabric-installer = "1.0.1"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait {
setup:
def gradle = gradleProject(
repo: "https://github.com/FabricMC/fabric.git",
commit: "70277babddfaf52ee30013af94764da19473b3b1",
commit: "d70d2c06bb8fafdb72c6778b29fb050618015ab3",
version: version,
patch: "fabric_api"
)
Expand All @@ -58,7 +58,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait {
""".stripIndent()
}

def minecraftVersion = "1.21.4-pre3"
def minecraftVersion = "1.21.4"
def server = ServerRunner.create(gradle.projectDir, minecraftVersion)
.withMod(gradle.getOutputFile("fabric-api-999.0.0.jar"))

Expand Down
32 changes: 13 additions & 19 deletions src/test/resources/patches/fabric_api.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/build.gradle b/build.gradle
--- a/build.gradle (revision 70277babddfaf52ee30013af94764da19473b3b1)
+++ b/build.gradle (date 1732875235843)
--- a/build.gradle (revision d70d2c06bb8fafdb72c6778b29fb050618015ab3)
+++ b/build.gradle (date 1734958436644)
@@ -13,7 +13,7 @@

def ENV = System.getenv()
Expand Down Expand Up @@ -36,23 +36,17 @@ diff --git a/build.gradle b/build.gradle
}

def getBranch() {
@@ -247,19 +230,6 @@

test {
useJUnitPlatform()
-
- afterEvaluate {
- // See: https://github.com/FabricMC/fabric-loader/pull/585
- def classPathGroups = loom.mods.stream()
- .map { modSettings ->
- SourceSetHelper.getClasspath(modSettings, getProject()).stream()
- .map(File.&getAbsolutePath)
- .collect(Collectors.joining(File.pathSeparator))
- }
- .collect(Collectors.joining(File.pathSeparator+File.pathSeparator))
-
- systemProperty("fabric.classPathGroups", classPathGroups)
- }
@@ -250,10 +233,11 @@
}

tasks.withType(ProcessResources).configureEach {
- inputs.property "version", project.version
+ def version = project.version
+ inputs.property "version", version

filesMatching("fabric.mod.json") {
- expand "version": project.version
+ expand "version": version
}
}

4 changes: 2 additions & 2 deletions src/test/resources/projects/mavenLibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ publishing {
from components.java

artifact(remapJar) {
classifier "classifier"
classifier = "classifier"
}
}
}

repositories {
maven {
url "http://localhost:${System.getProperty("loom.test.mavenPort")}/"
url = "http://localhost:${System.getProperty("loom.test.mavenPort")}/"
allowInsecureProtocol = true
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/projects/signed/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ publishing {
from components.java
artifact(remapJar) {
builtBy remapJar
classifier "classifier"
classifier = "classifier"
}
}
}

repositories {
maven {
url "http://localhost:${System.getProperty("loom.test.mavenPort")}/"
url = "http://localhost:${System.getProperty("loom.test.mavenPort")}/"
allowInsecureProtocol = true
}
}
Expand Down

0 comments on commit 40d17ba

Please sign in to comment.