The Software Defined Vehicle (SDV) platform contains numerous VSIDL catalogs
across the codebase. The CATALOG_UPDATE file provides a centralized
configuration for each catalog, enabling both automated updates and IDE
integration.
Role of the CATALOG_UPDATE file
The CATALOG_UPDATE file serves two primary purposes:
- Automated updates: The file allows the
regeneratortool to find and recompile all catalogs in the system when the compiler or dependencies change. - Language Server Protocol (LSP) Support: The VSIDL Language Server uses this file to discover the catalog root and resolve dependencies. This enables features like "Go to Definition," autocompletion, and real-time validation for types defined in other catalogs.
Configure a catalog
To enable automatic updates and LSP support for a VSIDL catalog, create a
CATALOG_UPDATE file in the root directory of the catalog. This file is a
text protobuf file.
Catalog configuration fields
output_path(string, optional): The relative path from the catalog root to the directory where the generated middleware code should be placed.dependency_catalog_paths(repeated string): A list of relative paths to other catalog directories. The LSP server uses these paths to resolve external types.vsidlc_gen_args(string, optional): Arguments passed tovsidlc. The LSP server inspects these to apply the correct validation rules (for example,"--apex").prebuilts_output_path(string, optional): Path for generated runtime configuration prebuilts.prebuilts_filegroup(string, optional): The Soongfilegroupname for prebuilts.
Example configuration
# proto-file: //system/software_defined_vehicle/tools/regenerator/proto/catalog.proto
# proto-message: Catalog
output_path: ".."
dependency_catalog_paths: "../../../../../automotive_services/diagnostics/vsidl/v1"
vsidlc_gen_args: "--apex"
Why automatic updates are needed
Manually maintaining generated code for every catalog is problematic for several reasons:
- Compiler updates: When the compiler is updated with bug fixes or new
features, all generated code and files that aren't covered by a
genrulein anAndroid.bpfile should be refreshed to maintain consistency. - Dependency management: Changes in a base catalog often require downstream catalogs to be regenerated.
- Accuracy: Automated updates reduce the risk of human error when specifying paths and dependencies.
Run the regenerator tool
The regenerator tool walks the directory tree starting from the SDV root and
looks for files named exactly CATALOG_UPDATE.
To update all configured catalogs:
Build the tool:
m regeneratorRun the tool:
regeneratorOptionally, run it recursively for a specific directory:
console regenerator --root /path/to/directory
The tool updates the generated files and performs a full build (m droid) to
verify that the changes are compatible with the rest of the system.