diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2026-11-23 18:39:39 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2026-11-23 18:39:39 +0100 |
| commit | cccddb2dbd7993c8a82f2aa1fe00dccd363a9783 (patch) | |
| tree | 77fc0c067db45f83a520198a5e632dbb8a7d9dac | |
| parent | 084dcd31bf7dfb2a154080f7f5a03e15ba038e37 (diff) | |
Remove fallback, not needed
| -rw-r--r-- | Makefile | 9 | ||||
| -rw-r--r-- | jars/fallback.txt | 5 | ||||
| -rwxr-xr-x | tools/gen_class.py | 6 | ||||
| -rw-r--r-- | tools/gen_jar_lists.py | 33 |
4 files changed, 6 insertions, 47 deletions
@@ -46,7 +46,7 @@ $(GEN_ARGS_JAVA): tools/gen_arg_table.py tools/ArgProbe.java \ --defs jars/defs.txt \ --out $@ -# Regenerate jars/defs.txt + scan.txt + fallback.txt + .stamp from the +# Regenerate jars/defs.txt + scan.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 @@ -54,7 +54,6 @@ $(GEN_ARGS_JAVA): tools/gen_arg_table.py tools/ArgProbe.java \ # which cascades the whole stub rebuild. jars/defs.txt: jars/.stamp jars/scan.txt: jars/.stamp -jars/fallback.txt: jars/.stamp jars/.stamp: tools/gen_jar_lists.py Makefile python3 tools/gen_jar_lists.py --kotlin-version $(KOTLIN_VERSION) \ @@ -72,12 +71,11 @@ clean: # its tree's javac step. gen_class.py wipes --out first, so the two trees are # independent. $(LOG_OUT)/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class: \ - tools/gen_class.py jars/scan.txt jars/defs.txt jars/fallback.txt \ + tools/gen_class.py jars/scan.txt jars/defs.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 '$(SEED_CLASSES)' \ --out $(LOG_OUT) @@ -86,12 +84,11 @@ $(LOG_OUT)/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class: \ # KotlinProxyLog (no loaded/call) and route reference returns through # KotlinProxyNoLog. $(NOLOG_OUT)/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class: \ - tools/gen_class.py jars/scan.txt jars/defs.txt jars/fallback.txt \ + tools/gen_class.py jars/scan.txt jars/defs.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 --no-log \ --seed '$(SEED_CLASSES)' \ --out $(NOLOG_OUT) diff --git a/jars/fallback.txt b/jars/fallback.txt deleted file mode 100644 index 2ceb457..0000000 --- a/jars/fallback.txt +++ /dev/null @@ -1,5 +0,0 @@ -# auto-generated by tools/gen_jar_lists.py - org.jetbrains.kotlin KGP-plugin-family jars at other cached versions, newest first. Definition lookup only (fallback.txt is scanned after defs.txt). -/home/the_jk/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-tooling-core/2.2.10/685151c03e638207a3b5045002411fbef78fdeb/kotlin-tooling-core-2.2.10.jar -/home/the_jk/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin-api/2.2.10/8b990c8b8a53b5179f6a7a43718079cabac9d4c9/kotlin-gradle-plugin-api-2.2.10.jar -/home/the_jk/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin-api/2.2.10/8b990c8b8a53b5179f6a7a43718079cabac9d4c9/kotlin-gradle-plugin-api-2.2.10-gradle813.jar -/home/the_jk/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin/2.2.10/5b7032e3454baa99627177ef48a324dbf33d42a3/kotlin-gradle-plugin-2.2.10-gradle813.jar diff --git a/tools/gen_class.py b/tools/gen_class.py index b52871e..ac88bdc 100755 --- a/tools/gen_class.py +++ b/tools/gen_class.py @@ -32,7 +32,7 @@ needed. Usage: python3 gen_class.py --scan-jars <list> --def-jars <list> --out <dir> - [--fallback-jars <list>] [--report <file>] [--no-log] + [--report <file>] [--no-log] """ import argparse @@ -723,7 +723,6 @@ def main(): ap = argparse.ArgumentParser() ap.add_argument("--scan-jars", required=True) ap.add_argument("--def-jars", required=True) - ap.add_argument("--fallback-jars", default=None) ap.add_argument("--out", required=True) ap.add_argument("--report", default=None) ap.add_argument("--exclude", default=None, @@ -762,11 +761,10 @@ def main(): if ("." in s and "/" not in s) else s) scan_jars = read_list(args.scan_jars) def_jars = read_list(args.def_jars) - fb_jars = read_list(args.fallback_jars) if args.fallback_jars else [] # defs: internal name -> (jar, info) (first jar wins) defs = {} - for jar in def_jars + fb_jars: + for jar in def_jars: if not jar or not os.path.exists(jar): print(f"warn: missing def jar {jar}", file=sys.stderr) continue diff --git a/tools/gen_jar_lists.py b/tools/gen_jar_lists.py index 06ab026..99b9329 100644 --- a/tools/gen_jar_lists.py +++ b/tools/gen_jar_lists.py @@ -24,9 +24,6 @@ Files written (one jar path per line, '#' comments allowed downstream): actually sees. scan.txt the AGP core jars at the pinned AGP version (the classes "AGP uses" - seed source for the full-closure mode). - fallback.txt KGP-plugin-family jars at OTHER cached versions, newest - first - definition lookup only, for classes missing from - the pinned set. Also writes <out-dir>/.stamp as "<kotlin-version> <agp-version>" so the Makefile can detect version drift without parsing the lists. @@ -49,14 +46,6 @@ SCAN_ARTIFACTS = [ "builder-model", ] -# KGP plugin family used for fallback definition lookup (other versions of -# the plugin that the build actually runs with). -FALLBACK_ARTIFACTS = [ - "kotlin-gradle-plugin", - "kotlin-gradle-plugin-api", - "kotlin-tooling-core", -] - KOTLIN_GROUP = "org.jetbrains.kotlin" AGP_GROUP = "com.android.tools.build" @@ -127,7 +116,7 @@ def main(): help="Gradle module cache root " "(default: %(default)s)") ap.add_argument("--out-dir", default="jars", - help="directory for defs.txt/scan.txt/fallback.txt " + help="directory for defs.txt/scan.txt " "(default: %(default)s)") args = ap.parse_args() cache = args.gradle_cache @@ -192,30 +181,10 @@ def main(): *scan, ] - # ---- fallback.txt: KGP family at other versions, newest first ---- - fb = [] - for artifact in FALLBACK_ARTIFACTS: - for v in all_versions(cache, KOTLIN_GROUP, artifact): - if v == args.kotlin_version: - continue - fb.extend((v, j) for j in - find_jars(cache, KOTLIN_GROUP, artifact, v)) - fb.sort(key=lambda t: (t[0], os.path.basename(t[1])), reverse=True) - fb_lines = [ - f"# auto-generated by tools/gen_jar_lists.py - {KOTLIN_GROUP} " - f"KGP-plugin-family jars at other cached versions, newest first. " - f"Definition lookup only (fallback.txt is scanned after defs.txt).", - *(j for _, j in fb), - ] - if not fb: - print("note: no other KGP-plugin versions in cache; " - "fallback.txt will be empty") - # ---- write ---- os.makedirs(args.out_dir, exist_ok=True) write_if_changed(os.path.join(args.out_dir, "defs.txt"), defs_lines) write_if_changed(os.path.join(args.out_dir, "scan.txt"), scan_lines) - write_if_changed(os.path.join(args.out_dir, "fallback.txt"), fb_lines) stamp = os.path.join(args.out_dir, ".stamp") stamp_content = f"{args.kotlin_version} {args.agp_version}\n" |
