diff options
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/gen_class.py | 6 | ||||
| -rw-r--r-- | tools/gen_jar_lists.py | 33 |
2 files changed, 3 insertions, 36 deletions
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" |
