summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorkennyballou <kballou@onyx.boisestate.edu>2013-02-21 10:07:59 -0700
committerkennyballou <kballou@onyx.boisestate.edu>2013-02-21 10:07:59 -0700
commit082e85051d5f5c877090cbaf3ef9c011e952a8de (patch)
treed1d48f862c9b22f72418609d35204550775e455f /docs
parent0df5ff747ece16fe8dd74f0174c55cad96b7b131 (diff)
downloadxnt-082e85051d5f5c877090cbaf3ef9c011e952a8de.tar.gz
xnt-082e85051d5f5c877090cbaf3ef9c011e952a8de.tar.xz
Update build file documentation
Documentation should reflect (and promote) use of new `xnt.task` import scheme
Diffstat (limited to 'docs')
-rw-r--r--docs/source/buildfile.rst22
1 files changed, 13 insertions, 9 deletions
diff --git a/docs/source/buildfile.rst b/docs/source/buildfile.rst
index 58e226a..a2fbf99 100644
--- a/docs/source/buildfile.rst
+++ b/docs/source/buildfile.rst
@@ -25,14 +25,14 @@ Let's start to add some of the features provided by Xnt::
#!/usr/bin/env python
from xnt import target #For describing targets
- import xnt.tasks #For built-in tasks
+ import xnt #For built-in tasks
@target
def init():
"""
Initialize Project Build Directories
"""
- xnt.tasks.mkdir("build")
+ xnt.mkdir("build")
That may be a lot to take in initially. Let's step through it.
@@ -41,12 +41,15 @@ In the first section::
#!/usr/bin/env python
from xnt import target #For describing targets
- import xnt.tasks #For built-in tasks
+ import xnt #For built-in tasks
If you're familiar with Python, you will notice there is nothing special
happening with this file yet. We are simply defining the file as a Python file,
including the ``target`` attribute from the ``xnt`` module, and importing the
-``xnt.tasks`` module.
+``xnt`` module.
+
+A change from previous versions: importing ``xnt`` will now implicitly import
+``xnt.tasks``.
Next, we will look at a new target::
@@ -55,19 +58,20 @@ Next, we will look at a new target::
"""
Initialize Project Build Directories
"""
- xnt.tasks.mkdir("build")
+ xnt.mkdir("build")
This is a standard definition of a Python function with a decorator.
First, the ``target`` decorator marks the function definition as a target (to
be used by the ``list-targets`` command, see :ref:`specialTargets`). Next, we
define the function; this function name *is* the name of the target. That is,
-the name given to the function will be name given to the command to invoke this
-target. Further, we have the docstring; (this is also used by the
+the name given to the function will be the name given to the command to invoke
+this target. Further, we have the docstring; (this is also used by the
``list-targets`` command) the docstring provides a quick description of the
purpose of the target, or what the target accomplishes when ran. Finally, we
-call ``mkdir`` of the ``xnt.tasks`` module. This function, if not obvious by
-the name, creates a directory named 'build' (see :doc:`taskreference`).
+call ``mkdir`` of the ``xnt`` (internally of the ``xnt.tasks``) module. This
+function, if not obvious by the name, creates a directory named 'build' (see
+:doc:`taskreference`).
Return Values
=============