0.3.1-0-pre.2.fix.3
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# file: scripts/audit_distribution_layout.py
|
||||
# version: 10
|
||||
# version: 11
|
||||
|
||||
"""Audit the static distribution layout expected by supported POCs."""
|
||||
|
||||
@@ -204,6 +204,38 @@ def audit_snake_tauri_android_integration(root: pathlib.Path) -> list[str]:
|
||||
return violations
|
||||
|
||||
|
||||
def audit_snake_tauri_generated_android(root: pathlib.Path) -> list[str]:
|
||||
"""Reject a locally generated Snake Android tree that drifted from Tauri 2.11.x."""
|
||||
|
||||
violations: list[str] = []
|
||||
android_root = root / "crates/apps/game-snake-poc-tauri/gen/android"
|
||||
if not android_root.exists():
|
||||
return violations
|
||||
|
||||
wrapper_path = android_root / "gradle/wrapper/gradle-wrapper.properties"
|
||||
build_path = android_root / "build.gradle.kts"
|
||||
if not wrapper_path.exists() or not build_path.exists():
|
||||
violations.append(
|
||||
"DIST-LAYOUT-041: generated Snake Tauri Android tree is incomplete; remove gen/android and rerun cargo tauri android init"
|
||||
)
|
||||
return violations
|
||||
|
||||
wrapper = wrapper_path.read_text(encoding="utf-8")
|
||||
build = build_path.read_text(encoding="utf-8")
|
||||
expected_fragments = (
|
||||
(wrapper, "gradle-8.14.3-bin.zip", "Gradle 8.14.3"),
|
||||
(build, 'classpath("com.android.tools.build:gradle:8.11.0")', "Android Gradle Plugin 8.11.0"),
|
||||
(build, 'classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")', "Kotlin Gradle Plugin 1.9.25"),
|
||||
)
|
||||
for content, fragment, label in expected_fragments:
|
||||
if fragment not in content:
|
||||
violations.append(
|
||||
f"DIST-LAYOUT-042: generated Snake Tauri Android tree does not match Tauri 2.11.x {label}; "
|
||||
"remove gen/android and rerun cargo tauri android init under JDK 17"
|
||||
)
|
||||
return violations
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""Validate that every static distribution boundary exists."""
|
||||
|
||||
@@ -223,6 +255,7 @@ def main() -> int:
|
||||
contract_violations.extend(audit_snake_web_shell(root))
|
||||
contract_violations.extend(audit_snake_web_integration(root))
|
||||
contract_violations.extend(audit_snake_tauri_android_integration(root))
|
||||
contract_violations.extend(audit_snake_tauri_generated_android(root))
|
||||
if missing:
|
||||
for relative in missing:
|
||||
print(f"DIST-LAYOUT-001: missing required path: {relative}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user