Unreflect everything

This commit is contained in:
2026-06-11 18:26:15 +02:00
parent 36b31fac77
commit f5d9c6e175
18 changed files with 217 additions and 305 deletions
@@ -42,6 +42,45 @@ tasks.withType<Test>().configureEach {
jvmArgs("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED")
}
// ─── Collect all .accesswidener files from this plugin's resources ────────────
val accessWidenerFiles: FileCollection = fileTree("src/") {
include("**/*.accesswidener")
}
val paperJarProvider: Provider<File> = provider {
val dep = libs.nms.get()
configurations["compileClasspath"].resolvedConfiguration.resolvedArtifacts.first { artifact ->
artifact.moduleVersion.id.module.group == dep.module.group && artifact.moduleVersion.id.module.name == dep.module.name
}.file
}
// ─── Widen the Paper dev JAR so the IDE / javac see the patched access ────────
val widenedJar by tasks.registering(JavaExec::class) {
description = "Produces a widened copy of the Paper dev JAR for compile-time use."
group = "widener"
// Re-run whenever the .accesswidener files change
inputs.file(paperJarProvider)
inputs.files(accessWidenerFiles)
val output = layout.buildDirectory.file("widened/paper-widened.jar")
outputs.file(output)
classpath = project(":AccessWidener").tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar").get().outputs.files
mainClass.set("de.steamwar.Main")
doFirst {
args = buildList {
add(paperJarProvider.get().absolutePath)
add(output.get().asFile.absolutePath)
addAll(accessWidenerFiles.map { it.absolutePath })
}
}
dependsOn(":AccessWidener:shadowJar")
}
dependencies {
compileOnly(libs.classindex)
annotationProcessor(libs.classindex)
@@ -53,6 +92,7 @@ dependencies {
compileOnly(libs.paperapi)
compileOnly(libs.nms)
compileOnly(files(widenedJar))
compileOnly(libs.authlib)
compileOnly(libs.datafixer)
compileOnly(libs.netty)
@@ -61,3 +101,7 @@ dependencies {
implementation(libs.anvilgui)
}
tasks.compileJava {
dependsOn(widenedJar)
}