INNER CODE UNIT · Python

render_generated_files_bzl

JetBrains/godot-support · godot-rd/godot_cpp_gen_main.py:48

def render_generated_files_bzl(version: str, api_file: Path) -> str:
    if not api_file.is_file():
        raise FileNotFoundError(f"Godot extension API file does not exist: {api_file}")

    generated_files = get_file_list(
        api_filepath=str(api_file),
        output_dir=".",
        headers=True,
        sources=True,
    )
    headers = sorted(path for path in generated_files if path.endswith((".h", ".hpp", ".inc")))
    sources = sorted(path for path in generated_files if path.endswith(".cpp"))
    if len(headers) + len(sources) != len(generated_files):
        raise ValueError("The godot-cpp generator returned a file with an unsupported extension")

    return f'''"""Auto-generated list of files produced by godot-cpp's binding_generator.py.

Do NOT edit by hand. Regenerate with:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…