tree: d57a7a3ebc0b656909137b0b91327c9488c17779 [path history] [tgz]
  1. README.md
  2. common.py
  3. package_schema.json
  4. product_schema.json
  5. verify_layer.py
  6. visualize_hierarchy.py
scripts/packages/README.md

Build package and products tools

This folder contains a set of utilities to manage products and build packages, i.e. files defined under //<layer>/{packages,products}.

verify_layer

This tool verifies that a given layer's packages/ and products/ directories are properly organized. It checks that:

  • all files in the directories are JSON files;
  • all package files are valid according to the package schema;
  • all product files are valid according to the product schema;
  • all package subdirectories (except a few canonical ones for which it does not make sense) have a file named all which contains all files in that subdirectory;
  • all packages files listed as import are valid files;
  • the root directories contain a set of canonical files.

The tool relies on a JSON validator commonly built as part of the Fuchsia build. The validator can be found at:

out/<build_type>/<host_toolchain>/json_validator

visualize_hierarchy

This tool generates a visualization of the package hierarchy for a given package file. The resulting graph file uses the DOT format.

python packages/visualize_hierarchy.py --package <topaz/packages/file> --output <graph.dot>

In order to generate an image file from the graph file, use the following command:

dot -Tpng <graph.dot> -o graph.png