summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-07 11:00:16 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-07 11:00:16 +0100
commite7ad22515e1d79f02f8cf2c88435e26854552a46 (patch)
treee237ab8083b2919f8ddd18af762e9a03f01a1919 /Makefile
parent64223f61fc8413ad69ba0e814fbbc552a6c57c33 (diff)
Bump kotlin to 2.4.21
Support <clinit>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 32 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 7f4f548..d80c617 100644
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,50 @@
-.PHONY: all clean compileStubs
+.PHONY: all clean compileStubs jars
+
+# Versions the jar lists (jars/*.txt) are generated for — see
+# tools/gen_jar_lists.py. Keep in sync with test_project/gradle/
+# libs.versions.toml (agp / kotlin).
+KOTLIN_VERSION ?= 2.4.21
+AGP_VERSION ?= 9.4.1
all: dist/kotlin-proxy-compiler-stubs.jar
+# Regenerate jars/defs.txt + scan.txt + fallback.txt + .stamp from the
+# Gradle cache (the cache must already hold these versions - run the
+# test_project once first, even a red build resolves everything).
+# jars/.stamp is a REAL prerequisite: bumping KOTLIN_VERSION/AGP_VERSION
+# above (or editing the tool) makes it stale, which rewrites the lists,
+# which cascades the whole stub rebuild.
+jars: jars/.stamp
+
+jars/.stamp: tools/gen_jar_lists.py Makefile
+ python3 tools/gen_jar_lists.py --kotlin-version $(KOTLIN_VERSION) \
+ --agp-version $(AGP_VERSION) --out-dir jars
+
clean:
rm -f dist/kotlin-proxy-compiler-stubs.jar
rm -rf stubs/classes_min/*
+ rm -f jars/.stamp
-stubs/classes_min/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class: tools/gen_class.py jars/scan.txt jars/defs.txt jars/fallback.txt
+stubs/classes_min/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class: \
+ tools/gen_class.py jars/scan.txt jars/defs.txt jars/fallback.txt \
+ jars/.stamp
python3 tools/gen_class.py \
--scan-jars jars/scan.txt \
--def-jars jars/defs.txt \
--fallback-jars jars/fallback.txt \
--seed-only --no-closure \
- --seed 'org/jetbrains/kotlin/cli/jvm/K2JVMCompiler,org/jetbrains/kotlin/cli/jvm/K2JVMCompiler$Companion,org/jetbrains/kotlin/cli/jvm/K2JVMCompilerKt' \
+ --seed 'org/jetbrains/kotlin/cli/jvm/K2JVMCompiler,org/jetbrains/kotlin/cli/jvm/K2JVMCompiler$$Companion,org/jetbrains/kotlin/cli/jvm/K2JVMCompilerKt' \
--out stubs/classes_min
-DEFS = $(shell grep -v '^[[:space:]]*#' jars/defs.txt | tr '\n' ':')
-
-compileStubs: stubs/classes_min/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class jars/defs.txt stubs/src/kotlin/proxy/*.java
+compileStubs: stubs/classes_min/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class \
+ jars/defs.txt stubs/src/kotlin/proxy/*.java
+ # DEFS is computed at recipe time: defs.txt may have been rewritten
+ # earlier in this same make run (via jars/.stamp), and a $(shell)
+ # variable would still hold the pre-rewrite contents.
+ DEFS=$$(grep -v '^[[:space:]]*#' jars/defs.txt | tr '\n' ':'); \
javac -nowarn -proc:none -d stubs/classes_min \
- -cp "$(DEFS)" \
- stubs/src/kotlin/proxy/*.java
+ -cp "$$DEFS" \
+ stubs/src/kotlin/proxy/*.java
dist/kotlin-proxy-compiler-stubs.jar: compileStubs
jar cf $@ -C stubs/classes_min .