Commit Graph

5 Commits

Author SHA1 Message Date
Armando Montanez
fb3d3fba79 Don't declare pigweed variables as globals
Require targets to explicitly import pigweed variable definitions. This
moves out some necessary logic from the BUILDCONFIG.gn file.

Change-Id: If9c9fe5a680cc9d897a0e8a55889873be618ed84
2020-06-16 09:50:59 -07:00
Keir Mierle
fa2fbe609d pw_build: Show subcommand output only on failure
This changes the behaviour of pw_python_script to hide subcommand output
by default, only showing the output if the command exits with a non-zero
(error) return code. This makes the watcher easier to follow, since only
failed command output is displayed.

Bug: 34
Change-Id: I51956c1bffc950bba69bb08a0f7ad397373171e5
2019-12-23 20:43:01 +00:00
Alexei Frolov
baaa2d62a6
Add pw_docgen module
This change adds a module which builds documentation using Sphinx.
Documentation files and assets are defined using a pw_doc_group GN
template which lists out all of the sources as metadata. Another GN
template, pw_doc_gen, collects the metadata from pw_doc_group targets
into a JSON file and defines an action that runs a script to build the
HTML docs.

A docgen script is provided by the pw_docgen module. This script reads
the JSON metadata file collected by a pw_doc_gen template, copies all of
the source and resource files into a documentation tree, and runs Sphinx
on the tree to render the docs as HTML.

Change-Id: I97890f05d850d5119cbd3bbf48138cd82f22d56c
2019-11-13 13:28:28 -08:00
Alexei Frolov
917756d925
Add a stamp option to pw_python_script
GN requires all actions to have at least one output file. However, many
Python scripts are run to process data without generating a file. Such
scripts would previously have to specify a dummy output file and touch
it on completion.

This change adds this stamp functionality to the script-runner script.
The pw_python_script template accepts a boolean "stamp" argument. If
set, the runner will touch a dummy file after it runs its sub-command.

Change-Id: Iff0408ea0d93007418a1766f1eb7ed7b30ec6913
2019-11-12 15:07:43 -08:00
Alexei Frolov
d1f98fadeb Script-runner script and pw_python_script template
This change adds a pw_python_script GN template which defines an action
to run a Python script through a script-runner script. This runner is
responsible for resolving any GN paths to filesystem paths, and finding
output binaries for compiled targets. This allows writing Python scripts
which are ignorant of the GN build system and work only with filesystem
paths.

The unit test runner script is updated to use the new runner template.

Change-Id: I132bb620af2bb1e57e9278fac57b676f8ab5a415
2019-11-12 18:40:24 +00:00