mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 05:05:20 -05:00
Update to ASM 9.7.1 (#1188)
* Update to ASM 9.7.1 * Fix Gradle 8.12 nightlies
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[versions]
|
||||
kotlin = "1.9.24"
|
||||
asm = "9.6"
|
||||
asm = "9.7.1"
|
||||
commons-io = "2.15.1"
|
||||
gson = "2.10.1"
|
||||
guava = "33.0.0-jre"
|
||||
|
||||
@@ -6,7 +6,7 @@ mockito = "5.13.0"
|
||||
java-debug = "0.52.0"
|
||||
mixin = "0.15.3+mixin.0.8.7"
|
||||
|
||||
gradle-nightly = "8.11-20240926001708+0000"
|
||||
gradle-nightly = "8.12-20241009055624+0000"
|
||||
fabric-loader = "0.16.5"
|
||||
fabric-installer = "1.0.1"
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.gradle.api.Transformer;
|
||||
import org.gradle.process.internal.JvmOptions;
|
||||
import org.gradle.workers.internal.DaemonForkOptions;
|
||||
import org.gradle.workers.internal.WorkerDaemonClientsManager;
|
||||
|
||||
@@ -45,7 +46,7 @@ public class WorkerDaemonClientsManagerHelper {
|
||||
Transformer<List<Object>, List<Object>> transformer = workerDaemonClients -> {
|
||||
for (Object /* WorkerDaemonClient */ client : workerDaemonClients) {
|
||||
DaemonForkOptions forkOptions = getForkOptions(client);
|
||||
Map<String, Object> systemProperties = forkOptions.getJavaForkOptions().getSystemProperties();
|
||||
Map<String, Object> systemProperties = getSystemProperties(forkOptions);
|
||||
|
||||
if (systemProperties == null || !jvmMarkerValue.equals(systemProperties.get(MARKER_PROP))) {
|
||||
// Not the JVM we are looking for
|
||||
@@ -70,6 +71,30 @@ public class WorkerDaemonClientsManagerHelper {
|
||||
return stopped.get();
|
||||
}
|
||||
|
||||
private static Map<String, Object> getSystemProperties(DaemonForkOptions forkOptions) {
|
||||
try {
|
||||
Method getJavaForkOptionsMethod = forkOptions.getClass().getDeclaredMethod("getJavaForkOptions");
|
||||
getJavaForkOptionsMethod.setAccessible(true);
|
||||
Object /* JavaForkOptions */ javaForkOptions = getJavaForkOptionsMethod.invoke(forkOptions);
|
||||
Method getSystemPropertiesMethod = javaForkOptions.getClass().getDeclaredMethod("getSystemProperties");
|
||||
getSystemPropertiesMethod.setAccessible(true);
|
||||
//noinspection unchecked
|
||||
return (Map<String, Object>) getSystemPropertiesMethod.invoke(javaForkOptions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||
// Gradle 8.11 and below
|
||||
}
|
||||
|
||||
// Gradle 8.12+
|
||||
try {
|
||||
Method getJvmOptions = forkOptions.getClass().getDeclaredMethod("getJvmOptions");
|
||||
getJvmOptions.setAccessible(true);
|
||||
JvmOptions jvmOptions = (JvmOptions) getJvmOptions.invoke(forkOptions);
|
||||
return jvmOptions.getMutableSystemProperties();
|
||||
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||
throw new RuntimeException("Failed to daemon system properties", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static DaemonForkOptions getForkOptions(Object /* WorkerDaemonClient */ client) {
|
||||
try {
|
||||
Method getForkOptionsMethod = client.getClass().getDeclaredMethod("getForkOptions");
|
||||
|
||||
Reference in New Issue
Block a user