INNER CODE UNIT · Python

ios_build_text

joreilly/Confetti · .github/scripts/ios-changes.py:129

def ios_build_text() -> str:
    inputs = [Path("build.gradle.kts"), Path("settings.gradle.kts"), Path("shared/build.gradle.kts")]
    inputs.extend(Path("build-logic").rglob("*.gradle.kts"))
    inputs.extend(Path("build-logic").rglob("*.kt"))
    return "\n".join(path.read_text(errors="replace") for path in inputs if path.is_file())


def catalog_affects_ios(base_revision: str, head_revision: str) -> tuple[bool, str]:
    try:
        accessors = relevant_catalog_accessors(catalog_at(base_revision), catalog_at(head_revision))
    except (subprocess.CalledProcessError, tomllib.TOMLDecodeError, UnicodeDecodeError) as error:
        return True, f"could not classify the version catalog safely ({error})"

    used = sorted(item for item in accessors if item in ios_build_text())
    if used:
        return True, f"version catalog changes affect iOS build inputs: {', '.join(used)}"
    return False, "version catalog changes are not referenced by iOS build inputs"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…