-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
74 lines (67 loc) · 3.14 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
74 lines (67 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Pure-JVM bootstrap module.
plugins {
`java-library`
}
java {
toolchain {
// Match the FCL JRE 25 target. This is JVM, not ART.
languageVersion.set(JavaLanguageVersion.of(25))
}
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
dependencies {
// compileOnly: the JVM that runs our bootstrap will have getdown-pro.jar
// on its classpath (we ship it as an asset and add it explicitly). Compile
// against the committed asset copy — same jar we run against, and unlike the
// gitignored refs/ tree it's present in a clean checkout (e.g. CI).
compileOnly(files("$rootDir/app/src/main/assets/sk/getdown-pro.jar"))
// NativeBridgePrompt implements co.frenchpress.CredentialPrompt. Now that this
// module compiles under JDK 25 it can read the real shaded frenchpress.jar
// (class v69) directly, so the old release-21 API stubs are gone. Compile
// against the committed asset copy — same jar we ship and run against, present
// in a clean checkout (CI) — mirroring the getdown-pro.jar wiring above. Keep it
// compileOnly: at runtime NativeBridgePrompt binds to frenchpress on SK's
// classloader, and frenchpress classes must never enter sk-bootstrap.jar.
compileOnly(files("$rootDir/app/src/main/assets/frenchpress/frenchpress.jar"))
// Compile-only against the AngelAuraMC Android LWJGL jars so we can write
// GLFW shadows that satisfy SK's expectations.
val lwjglZip = file("$rootDir/app/src/main/assets/lwjgl/lwjgl-3.4.1-android-modules.zip")
if (!lwjglZip.exists()) {
// Fail loudly: a silent skip here lets GLFW.java compile errors blame
// the source instead of the missing classpath.
throw GradleException(
"Missing LWJGL modules zip at $lwjglZip. " +
"Run ../scripts/build-lwjgl3-android.sh then ../scripts/stage-launcher-assets.sh."
)
}
val extracted = layout.buildDirectory.dir("lwjgl-classpath").get().asFile
val needsExtract = !extracted.exists() ||
(extracted.listFiles()?.maxOfOrNull { it.lastModified() } ?: 0L) < lwjglZip.lastModified()
if (needsExtract) {
extracted.deleteRecursively()
extracted.mkdirs()
copy {
from(zipTree(lwjglZip)) { include("**/lwjgl.jar", "**/lwjgl-glfw.jar") }
into(extracted)
eachFile { path = name } // flatten
includeEmptyDirs = false
}
}
compileOnly(fileTree(extracted) { include("lwjgl.jar", "lwjgl-glfw.jar") })
}
tasks.named<Jar>("jar") {
archiveFileName.set("sk-bootstrap.jar")
// Belt-and-suspenders: stubs are a separate source set so they aren't here
// anyway, but never let a co.frenchpress class ship in sk-bootstrap.jar —
// it's first on SK's classpath and would shadow the real frenchpress.
exclude("co/frenchpress/**")
}
dependencies {
testImplementation("junit:junit:4.13.2")
testImplementation(files("$rootDir/app/src/main/assets/sk/getdown-pro.jar"))
testImplementation(files("$rootDir/app/src/main/assets/frenchpress/frenchpress.jar"))
}
tasks.named<Test>("test") {
useJUnit()
}