Update to Gradle 9, Loom 1.15, EGT 0.7
This commit is contained in:
@@ -3,7 +3,7 @@ import gg.essential.gradle.util.*
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
id("io.github.goooler.shadow") apply false
|
id("com.gradleup.shadow") apply false
|
||||||
id("gg.essential.multi-version")
|
id("gg.essential.multi-version")
|
||||||
id("gg.essential.defaults.repo")
|
id("gg.essential.defaults.repo")
|
||||||
id("gg.essential.defaults.java")
|
id("gg.essential.defaults.java")
|
||||||
@@ -22,6 +22,7 @@ base.archivesName.set("replaymod")
|
|||||||
java.withSourcesJar()
|
java.withSourcesJar()
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
|
mixin.useLegacyMixinAp = true
|
||||||
mixin.defaultRefmapName.set("mixins.replaymod.refmap.json")
|
mixin.defaultRefmapName.set("mixins.replaymod.refmap.json")
|
||||||
noServerRunConfigs()
|
noServerRunConfigs()
|
||||||
}
|
}
|
||||||
@@ -318,9 +319,9 @@ val configureRelocation by tasks.registering {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val bundleJar by tasks.registering(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
|
val bundleJar by tasks.registering(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
|
||||||
from(tasks.remapJar.flatMap { it.archiveFile })
|
from((if (platform.isUnobfuscated) tasks.jar else tasks.remapJar).flatMap { it.archiveFile }.map { zipTree(it) })
|
||||||
|
|
||||||
from(jGui.tasks.remapJar.flatMap { it.archiveFile }.map { zipTree(it) }) {
|
from((if (platform.isUnobfuscated) jGui.tasks.jar else jGui.tasks.remapJar).flatMap { it.archiveFile }.map { zipTree(it) }) {
|
||||||
filesMatching("mixins.jgui.json") {
|
filesMatching("mixins.jgui.json") {
|
||||||
filter { it.replace("de.johni0702", "com.replaymod.lib.de.johni0702") }
|
filter { it.replace("de.johni0702", "com.replaymod.lib.de.johni0702") }
|
||||||
}
|
}
|
||||||
@@ -330,8 +331,8 @@ val bundleJar by tasks.registering(com.github.jengelman.gradle.plugins.shadow.ta
|
|||||||
}
|
}
|
||||||
relocate("de.johni0702", "com.replaymod.lib.de.johni0702")
|
relocate("de.johni0702", "com.replaymod.lib.de.johni0702")
|
||||||
|
|
||||||
manifest.inheritFrom(tasks.jar.get().manifest)
|
manifest.from(tasks.jar.get().manifest)
|
||||||
from(shade)
|
from(shade.elements.map { it.map { zipTree(it) } })
|
||||||
configurations = listOf(shadow)
|
configurations = listOf(shadow)
|
||||||
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")
|
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")
|
||||||
|
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
2
jGui
2
jGui
Submodule jGui updated: 985836c3d0...68de9e2d2a
@@ -1,31 +1,42 @@
|
|||||||
import groovy.json.JsonOutput
|
import groovy.json.JsonOutput
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
import org.gradle.kotlin.dsl.support.serviceOf
|
||||||
|
import org.gradle.process.ExecOperations
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("gg.essential.multi-version.root")
|
id("gg.essential.multi-version.root")
|
||||||
id("gg.essential.loom") version "1.7.35" apply false
|
id("gg.essential.loom") version "1.15.48" apply false
|
||||||
id("com.github.hierynomus.license") version "0.15.0"
|
id("com.github.hierynomus.license") version "0.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
val latestVersion = file("version.txt").readLines().first()
|
val latestVersion = file("version.txt").readLines().first()
|
||||||
var releaseCommit = command("git", "blame", "-p", "-l", "version.txt").first().split(" ").first()
|
var releaseCommit = providers.exec {
|
||||||
|
commandLine("git", "blame", "-p", "-l", "version.txt")
|
||||||
|
}.standardOutput.asText.map { it.trim().split("/n").first().split(" ").first() }.get()
|
||||||
if (latestVersion == "2.1.0") { // First version since change from tag-based
|
if (latestVersion == "2.1.0") { // First version since change from tag-based
|
||||||
releaseCommit = "35ac26e91689ac9bdf12dbb9902c452464a75108" // git rev-parse 1.12.2-2.1.0
|
releaseCommit = "35ac26e91689ac9bdf12dbb9902c452464a75108" // git rev-parse 1.12.2-2.1.0
|
||||||
}
|
}
|
||||||
val currentCommit = command("git", "rev-parse", "HEAD").first()
|
val currentCommit = providers.exec {
|
||||||
|
commandLine("git", "rev-parse", "HEAD")
|
||||||
|
}.standardOutput.asText.map { it.trim().split("/n").first() }.get()
|
||||||
if (releaseCommit == currentCommit) {
|
if (releaseCommit == currentCommit) {
|
||||||
version = latestVersion
|
version = latestVersion
|
||||||
} else {
|
} else {
|
||||||
val diff = command("git", "log", "--format=oneline", "$releaseCommit..$currentCommit").size
|
val diff = providers.exec {
|
||||||
|
commandLine("git", "log", "--format=oneline", "$releaseCommit..$currentCommit")
|
||||||
|
}.standardOutput.asText.map { it.trim().split("/n").size }.get()
|
||||||
version = "$latestVersion-$diff-g${currentCommit.substring(0, 7)}"
|
version = "$latestVersion-$diff-g${currentCommit.substring(0, 7)}"
|
||||||
}
|
}
|
||||||
if (gitDescribe().endsWith("*")) {
|
val dirty = providers.exec {
|
||||||
|
commandLine("git", "describe", "--always", "--dirty=*")
|
||||||
|
}.standardOutput.asText.map { it.trim().endsWith("*") }.get()
|
||||||
|
if (dirty) {
|
||||||
version = "$version-dirty"
|
version = "$version-dirty"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.replaymod"
|
group = "com.replaymod"
|
||||||
|
|
||||||
val bundleJar by tasks.creating(Copy::class) {
|
val bundleJar by tasks.registering(Copy::class) {
|
||||||
into("$buildDir/libs")
|
into("$buildDir/libs")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,26 +56,15 @@ subprojects {
|
|||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
val projectBundleJar = project.tasks.findByName("bundleJar")
|
val projectBundleJar = project.tasks.findByName("bundleJar")
|
||||||
if (projectBundleJar != null && projectBundleJar.hasProperty("archivePath") && project.name != "core") {
|
if (projectBundleJar != null && projectBundleJar.hasProperty("archivePath") && project.name != "core") {
|
||||||
bundleJar.dependsOn(projectBundleJar)
|
bundleJar.configure {
|
||||||
bundleJar.from(projectBundleJar.withGroovyBuilder { getProperty("archivePath") })
|
dependsOn(projectBundleJar)
|
||||||
|
from(projectBundleJar.withGroovyBuilder { getProperty("archivePath") })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun gitDescribe(): String {
|
fun ExecOperations.command(vararg cmd: String): List<String> {
|
||||||
try {
|
|
||||||
val stdout = ByteArrayOutputStream()
|
|
||||||
exec {
|
|
||||||
commandLine("git", "describe", "--always", "--dirty=*")
|
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
return stdout.toString().trim()
|
|
||||||
} catch (e: Throwable) {
|
|
||||||
return "unknown"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun command(vararg cmd: Any): List<String> {
|
|
||||||
val stdout = ByteArrayOutputStream()
|
val stdout = ByteArrayOutputStream()
|
||||||
exec {
|
exec {
|
||||||
commandLine(*cmd)
|
commandLine(*cmd)
|
||||||
@@ -73,7 +73,10 @@ fun command(vararg cmd: Any): List<String> {
|
|||||||
return stdout.toString().trim().split("\n")
|
return stdout.toString().trim().split("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun generateVersionsJson(): Map<String, Any> {
|
fun generateVersionsJson(execOps: ExecOperations): Map<String, Any> {
|
||||||
|
fun command(vararg cmd: String): List<String> =
|
||||||
|
execOps.command(*cmd)
|
||||||
|
|
||||||
val versionComparator = compareBy<String>(
|
val versionComparator = compareBy<String>(
|
||||||
{ (it.split(".").getOrNull(0) ?: "0").toInt() },
|
{ (it.split(".").getOrNull(0) ?: "0").toInt() },
|
||||||
{ (it.split(".").getOrNull(1) ?: "0").toInt() },
|
{ (it.split(".").getOrNull(1) ?: "0").toInt() },
|
||||||
@@ -145,18 +148,24 @@ fun generateVersionsJson(): Map<String, Any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val writeVersionsJson by tasks.registering {
|
val writeVersionsJson by tasks.registering {
|
||||||
|
val execOps = project.serviceOf<ExecOperations>()
|
||||||
doLast {
|
doLast {
|
||||||
val versionsRoot = generateVersionsJson()
|
val versionsRoot = generateVersionsJson(execOps)
|
||||||
val versionsJson = JsonOutput.prettyPrint(JsonOutput.toJson(versionsRoot))
|
val versionsJson = JsonOutput.prettyPrint(JsonOutput.toJson(versionsRoot))
|
||||||
File("versions.json").writeText(versionsJson)
|
File("versions.json").writeText(versionsJson)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val doRelease by tasks.registering {
|
val doRelease by tasks.registering {
|
||||||
|
val execOps = project.serviceOf<ExecOperations>()
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
|
fun command(vararg cmd: String): List<String> =
|
||||||
|
execOps.command(*cmd)
|
||||||
|
|
||||||
// Parse version
|
// Parse version
|
||||||
val version = project.extra["releaseVersion"] as String
|
val version = project.extra["releaseVersion"] as String
|
||||||
if (gitDescribe().endsWith("*")) {
|
if (command("git", "describe", "--always", "--dirty=*").first().endsWith("*")) {
|
||||||
throw InvalidUserDataException("Git working tree is dirty. Make sure to commit all changes.")
|
throw InvalidUserDataException("Git working tree is dirty. Make sure to commit all changes.")
|
||||||
}
|
}
|
||||||
val (modVersion, preVersion) = if ("-b" in version) {
|
val (modVersion, preVersion) = if ("-b" in version) {
|
||||||
@@ -181,7 +190,7 @@ val doRelease by tasks.registering {
|
|||||||
command("git", "commit", "-m", commitMessage)
|
command("git", "commit", "-m", commitMessage)
|
||||||
|
|
||||||
// Generate versions.json content
|
// Generate versions.json content
|
||||||
val versionsRoot = generateVersionsJson()
|
val versionsRoot = generateVersionsJson(execOps)
|
||||||
val versionsJson = JsonOutput.prettyPrint(JsonOutput.toJson(versionsRoot))
|
val versionsJson = JsonOutput.prettyPrint(JsonOutput.toJson(versionsRoot))
|
||||||
|
|
||||||
// Switch to master branch to update versions.json
|
// Switch to master branch to update versions.json
|
||||||
@@ -191,11 +200,11 @@ val doRelease by tasks.registering {
|
|||||||
File("versions.json").writeText(versionsJson)
|
File("versions.json").writeText(versionsJson)
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
project.exec { commandLine("git", "add", "versions.json") }
|
command("git", "add", "versions.json")
|
||||||
project.exec { commandLine("git", "commit", "-m", "Update versions.json for $version") }
|
command("git", "commit", "-m", "Update versions.json for $version")
|
||||||
|
|
||||||
// Return to previous branch
|
// Return to previous branch
|
||||||
project.exec { commandLine("git", "checkout", "-") }
|
command("git", "checkout", "-")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ pluginManagement {
|
|||||||
maven("https://repo.essential.gg/repository/maven-public")
|
maven("https://repo.essential.gg/repository/maven-public")
|
||||||
}
|
}
|
||||||
plugins {
|
plugins {
|
||||||
id("gg.essential.multi-version.root") version "0.6.7"
|
id("gg.essential.multi-version.root") version "0.7.0-alpha.4"
|
||||||
id("io.github.goooler.shadow") version "8.1.7"
|
id("com.gradleup.shadow") version "9.4.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import net.minecraft.client.render.entity.LivingEntityRenderer;
|
|||||||
//#endif
|
//#endif
|
||||||
public abstract class MixinRenderLivingBase {
|
public abstract class MixinRenderLivingBase {
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@Inject(method = "render", at = @At(
|
@Inject(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(
|
||||||
//#else
|
//#else
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
//$$ @Inject(method = "render(Lnet/minecraft/entity/LivingEntity;DDDFF)V", at = @At(
|
//$$ @Inject(method = "render(Lnet/minecraft/entity/LivingEntity;DDDFF)V", at = @At(
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import static com.replaymod.core.versions.MCVer.*;
|
|||||||
//#endif
|
//#endif
|
||||||
public abstract class MixinRenderLivingBase {
|
public abstract class MixinRenderLivingBase {
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
@Inject(method = "hasLabel", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true)
|
||||||
//#else
|
//#else
|
||||||
//$$ @Inject(method = "canRenderName(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true)
|
//$$ @Inject(method = "canRenderName(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true)
|
||||||
//#endif
|
//#endif
|
||||||
@@ -45,7 +45,7 @@ public abstract class MixinRenderLivingBase {
|
|||||||
//#if MC>=12102
|
//#if MC>=12102
|
||||||
//$$ method = "updateRenderState(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/client/render/entity/state/LivingEntityRenderState;F)V",
|
//$$ method = "updateRenderState(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/client/render/entity/state/LivingEntityRenderState;F)V",
|
||||||
//#elseif MC>=11500
|
//#elseif MC>=11500
|
||||||
method = "render",
|
method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V",
|
||||||
//#else
|
//#else
|
||||||
//$$ method = "render(Lnet/minecraft/entity/LivingEntity;FFFFFF)V",
|
//$$ method = "render(Lnet/minecraft/entity/LivingEntity;FFFFFF)V",
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class MixinTileEntityEndPortalRenderer {
|
|||||||
static
|
static
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//$$ @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getMeasuringTimeMs()J"))
|
//$$ @Redirect(method = "render(Lnet/minecraft/block/entity/EndPortalBlockEntity;DDDFI)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getMeasuringTimeMs()J"))
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
//$$ @Redirect(method = "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntityEndPortal;DDDFIF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getSystemTime()J"))
|
//$$ @Redirect(method = "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntityEndPortal;DDDFIF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getSystemTime()J"))
|
||||||
|
|||||||
0
versions/1.14.4-forge/.gitkeep
Normal file
0
versions/1.14.4-forge/.gitkeep
Normal file
0
versions/1.20.4/.gitkeep
Normal file
0
versions/1.20.4/.gitkeep
Normal file
0
versions/1.21.2/.gitkeep
Normal file
0
versions/1.21.2/.gitkeep
Normal file
Reference in New Issue
Block a user