Skip to content

Commit ef974c7

Browse files
committed
Update docs to include notes on build.json
Add details on how to update `build.json` and generate the build files.
1 parent 4c8334b commit ef974c7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/contributing.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,41 @@ comes from a non-Google open source project needs to have an acceptable license
2929
and be committed to the Emboss repository in a specific location.
3030

3131

32+
### Updating Build Helper Files
33+
34+
The Emboss project provides a set of generated files in the `gen/` directory
35+
that can be used by other build systems (like CMake, GN, etc.) to easily
36+
include the Emboss compiler and C++ runtime sources.
37+
38+
These files are generated from a single source of truth: `build.json`.
39+
40+
- **`build.json`**: This file, located in the project root, contains the
41+
canonical lists of source files required for the compiler and the C++
42+
runtime. It is the only file in this system that should be manually
43+
edited, though it is typically updated via a script.
44+
45+
- **`gen/`**: This directory contains the generated helper files. **Do not
46+
edit these files directly**, as they will be overwritten.
47+
48+
If you change the dependencies of the Emboss compiler or runtime in the Bazel
49+
build system, you will need to update `build.json` and regenerate the helper
50+
files.
51+
52+
- To update `build.json` with the latest sources from Bazel, run:
53+
```bash
54+
./scripts/build_helpers/manage_build_json.py
55+
```
56+
57+
- To regenerate the files in `gen/` after modifying `build.json`, run:
58+
```bash
59+
./scripts/build_helpers/generate_build_files.py
60+
```
61+
62+
A CI check is in place to ensure that `build.json` is always in sync with the
63+
Bazel build. If this check fails, you will need to run the `manage_build_json.py`
64+
script and commit the changes.
65+
66+
3267
### How-To Guides
3368

3469
This document covers the process of getting a change into the main Emboss

0 commit comments

Comments
 (0)