West, Zephyr's meta-tool
Go to file
Marti Bolivar ed9f4fe735 Add build command.
This is an optional convenience wrapper around cmake + ninja (or any
other generator supported by Zephyr). It will never be mandatory to
use this wrapper. Raw CMake and Ninja/Make/etc. will always be
supported.

This command attempts to do what you mean when run from a Zephyr
application source or a pre-existing build directory:

- When "west build" is run from a Zephyr build directory, the source
  directory is obtained from the CMake cache, and that build directory
  is re-compiled.

- Otherwise, the source directory defaults to the current working
  directory, so running "west build" from a Zephyr application's
  source directory compiles it.

The source and build directories can be explicitly set with the
--source-dir and --build-dir options. The build directory defaults to
'build' if it is not auto-detected. The build directory is always
created if it does not exist.

This command runs CMake to generate a build system if one is not
present in the build directory, then builds the application.
Subsequent builds try to avoid re-running CMake; you can force it
to run by setting --cmake.

To pass additional options to CMake, give them as extra arguments
after a '--' For example, "west build -- -DOVERLAY_CONFIG=some.conf" sets
an overlay config file. (Doing this forces a CMake run.)

A separate helper library is placed in west.build to make adapting
flash/debug/debugserver workflows play nicer with build in future
patches.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-08-21 16:09:13 -05:00
src Add build command. 2018-08-21 16:09:13 -05:00
tests tests: add nrfjprog runner tests 2018-08-20 09:17:57 -07:00
.gitignore testing: add shippable integration 2018-08-21 14:54:29 -05:00
.shippable.yml testing: add shippable integration 2018-08-21 14:54:29 -05:00
LICENSE Add setuptools integration. 2018-06-06 12:21:14 -04:00
README.rst Add py.test-based test infrastructure 2018-08-20 09:17:57 -07:00
requirements.txt Move install_requires contents to requirements.txt 2018-08-20 09:17:57 -07:00
setup.cfg Add py.test-based test infrastructure 2018-08-20 09:17:57 -07:00
setup.py Add py.test-based test infrastructure 2018-08-20 09:17:57 -07:00
tests_requirements.txt tests_requirements.txt: add pytest-cov 2018-08-21 14:54:29 -05:00

README.rst

This package contains the Zephyr RTOS meta tool, 'west'.

WARNING
-------

DO NOT INSTALL WITH "python3 setup.py install".

Please use pip to install in development mode as documented below.

Important Note
--------------

West is distributed in two pieces:

1. A bootstrap/wrapper script, which is distributed via PyPI.
2. The "main" west package and entry points, which are fetched by the
   bootstrap script.

This somewhat unusual arrangement is because:

- One of West's jobs is to manage interaction with Zephyr's multiple
  Git repositories, including its own.
- West is in its experimental stages and is moving quickly, meaning
  users need to stay on HEAD.

The default setup.py installs the **wrapper script only**.

Installation
------------

To install the West bootstrapping/wrapper script from this package in
development mode, clone this repository and run this from the top
level directory:

$ pip3 install -e .

Then use the wrapper script to initialize a Zephyr installation with::

  $ west init your/zephyr/install-dir
  $ cd your/zephyr/install-dir
  $ west <command>

The ``west init`` call will:

- create your/zephyr/install-dir
- clone the Zephyr manifest repository (whose URL can be overridden
  with the ``-u`` option, and branch with ``--mr`` / ``--manifest-rev``)
- clone the latest West repository (the URL override is ``-w``, and
  revision/branch override is ``--wr`` / ``--west-rev``)

Running ``west <command>`` from :file:`your/zephyr/install-dir` or
underneath it will invoke west in "wrapper" mode: any commands other
than ``init`` will be delegated to the West tree pulled by ``west
init``.

This arrangement may seem familiar to Android (platform, not app)
developers. The source management features of West were indeed
inspired by the Android Repo tool's features, but West makes
significant departures from Repo's behavior.

Alternative Usage
-----------------

If you don't want to change your system outside of cloning this
repository, you can also clone West's Git repository and run the
package as a module:

$ python3 -m west

Only do this if you know what you're doing (and make sure to install
the requirements as specified by the install_requires line in
setup.py).

Test Suite
----------

To run the test suite, use:

```
$ python3 setup.py test
```