INNER CODE UNIT · Python
resolve_module_suffix
keiyoushi/extensions-source · .github/scripts/generate-build-matrices.py:26
def resolve_module_suffix(ref: str, lang: str, extension: str) -> str:
"""
returns the effective applicationId suffix of a module: the DSL override
(pkgName) if set, else the directory-derived default
"""
build_file = Path("src", lang, extension, "build.gradle.kts")
content = None
if build_file.is_file():
content = build_file.read_text("utf-8")
elif ref:
# the module was deleted; read its build file from the base ref
result = subprocess.run(
f"git show {ref}:src/{lang}/{extension}/build.gradle.kts",
capture_output=True,
text=True,
shell=True,
check=False,
)