summaryrefslogtreecommitdiff
path: root/docs/source/xenant.rst
blob: 5bd623551fbe13beb1c4668cc2da7e7f4faed731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Running Xnt
===========

Invoking Xnt from the command line is very simple and very similar to how other
build tools are invoked (this was intentional).

.. _defaultUse:

Default Use
-----------

The most simplistic use of Xnt is as follows::

    $ xnt

This will attempt to invoke the `default` target in the current directory's
`build.py`.

.. _invokeTarget:

Invoke a Target
---------------

To invoke a particular target, use::

    $ xnt {target}

Where the value of `{target}` is dependent on your particular `build.py` file.

Invoke MORE Targets
~~~~~~~~~~~~~~~~~~~

Xnt now supports executing multiple targets in one go. That is, if you want to
chain targets together, you now can *without* separate executions of Xnt. For
example::

    $ xnt {target1} {target2} ... {targetN}

Will execute `target1` through `targetN` in order of listing.

.. _specialTargets:

Special Targets
---------------

"Special" targets (for lack of a better name) are targets that do not exist in
the build script, but rather are a part of Xnt.

Thus far, I have only defined one "special" target, ``list-targets`` (I don't
think this name is going to change again ...).

* ``list-targets`` does exactly what the name should suggest: it prints a list
  of the targets found in the current directory's `build.py` script, along with
  any docstrings that may be defined with them.

Usage::

    $ xnt list-targets

.. _xntOptions:

Options
-------

Xnt also has a few "options" that may be provided along with a regular targets.

Usage::

    $ xnt [options] [target]

Where options can be any and all of the following (unless otherwise specified):

* ``-v``: add verbose output to the execution of Xnt

* ``--version``: Print the version of Xnt and exit

* ``--usage``: Print version, license, usage information and quit. [I've
  debatted between putting this as a special target and leaving it as an
  option.. not sure which is better...]

.. _xntPropertiesParameters:

Properties and Parameter Passing
--------------------------------

Xnt now has the ability to accept command line parameters and forward them to
your `build.py` file. This can be useful for a number of reasons: flipping
debug flags, deployment flags and the like or whatever else you can imagine.

The general semantic for passing the parameters is as follows::

    $ xnt [-D{name}={value}]+ [options] [target]

*Notice:* the `-D` is used to distinguish values to be passed to the `build`
file from regular options. You may specify as many parameters as you like and
there is no other real ordering required to be parsed correctly. Just know,
spaces are used to delimit arguments; if your passed value *must* have a space,
remember to quote it.

Please see :ref:`buildProperties` to see how this works on the `build.py` side.