Update to Loom 1.1 and Gradle 8

This commit is contained in:
shedaniel
2023-03-04 03:25:05 +08:00
parent 5bac879be0
commit f0222338f5
5 changed files with 15 additions and 14 deletions

View File

@@ -8,9 +8,9 @@ buildscript {
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.0-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false
id "org.cadixdev.licenser" version "0.6.1"
id "io.github.juuxel.loom-quiltflower" version "1.7.2" apply false
id "io.github.juuxel.loom-quiltflower" version "1.8.0" apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
id "maven-publish"
}

View File

@@ -44,7 +44,8 @@ import java.nio.file.Path
task generateAccessWidener {
doLast {
List<String> lines = ["", "##############################", "# This section is generated automatically with Gradle task generateAccessWidener!!!", "##############################", ""]
Path inputJar = loom.namedMinecraftProvider.parentMinecraftProvider.mergedJar
Path inputJar = loom.namedMinecraftProvider.parentMinecraftProvider.mergedJar.path
logger.lifecycle("Generating access widener for $inputJar")
try (def fs = FileSystems.newFileSystem(URI.create("jar:${inputJar.toUri()}"), [create: false])) {
generateItemConstructors(lines, fs)

View File

@@ -45,28 +45,28 @@ shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
archiveClassifier = "dev-shadow"
}
remapJar {
injectAccessWidener = true
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
archiveClassifier = null
}
task renameJarForPublication(type: Zip, dependsOn: remapJar) {
from remapJar.archiveFile.map { zipTree(it) }
extension "jar"
archiveExtension = "jar"
metadataCharset "UTF-8"
destinationDirectory = base.libsDirectory
classifier project.name
archiveClassifier = project.name
}
assemble.dependsOn renameJarForPublication
jar {
classifier "dev"
archiveClassifier = "dev"
}
sourcesJar {

View File

@@ -48,7 +48,7 @@ shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
archiveClassifier = "dev-shadow"
// Replace classes with forge's version
exclude "dev/architectury/core/block/ArchitecturyLiquidBlock.class"
@@ -65,21 +65,21 @@ shadowJar {
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
archiveClassifier = null
}
task renameJarForPublication(type: Zip, dependsOn: remapJar) {
from remapJar.archiveFile.map { zipTree(it) }
extension "jar"
archiveExtension = "jar"
metadataCharset "UTF-8"
destinationDirectory = base.libsDirectory
classifier project.name
archiveClassifier = project.name
}
assemble.dependsOn renameJarForPublication
jar {
classifier "dev"
archiveClassifier = "dev"
}
sourcesJar {

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists