Skip to content

Commit

Permalink
Updated the apidocs and The Waf Book
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Nagy committed Apr 6, 2015
1 parent 47cf5ce commit 8ac4646
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 94 deletions.
45 changes: 14 additions & 31 deletions DEVEL
Original file line number Diff line number Diff line change
@@ -1,45 +1,28 @@
Main repository for waf 1.8 on http://waf.googlecode.com/git/
-------------------------------------------------------------
Waf 1.8 is on https://github.com/waf-project/waf
------------------------------------------------

waflib the core library
waflib/Tools essential waf tools
waflib/extras contributed tools which are not included in the
waf file by default (except "compat15")
build_system_kit examples of build systems that can be created from waf
waflib/extras contributed tools which are not included in the waf file by default
build_system_kit examples of build systems that can be created from Waf
tests various unit tests, most are unused anymore
playground experiments and integration tests for the tools in
the folder waflib/extras
demos integration tests - the folder can be configured
as a standalone project
playground experimental examples and test, most tools lie in the folder waflib/extras
demos integration tests - the folder can be configured as a standalone project
demos/* integration tests and examples used as documentation
docs documentation
docs/sphinx project extracting the docstrings from the source code to
create the apidocs
docs/sphinx project extracting the docstrings from the source code to create the API documentation

Documentation repository on http://docs.waf.googlecode.com/git/
---------------------------------------------------------------
Documentation
-------------------------------------------------

Contains the documentation:
API documentation http://docs.waf.googlecode.com/git/apidocs_17/index.html
The Waf Book http://docs.waf.googlecode.com/git/book_17/single.html
The Waf Book for Waf 1.6 (deprecated) http://docs.waf.googlecode.com/git/book_16/single.html
The Waf Book for Waf 1.5 (deprecated) http://docs.waf.googlecode.com/git/book_15/single.html
API documentation https://waf.io/apidocs/
The Waf Book https://waf.io/book/

Programming details
-------------------
Coding guidelines
-----------------

* We use tabs, no spaces
* Do not use x.split("\n") but x.splitlines()
* Do not catch all exceptions unless you have a good reason to do so (no "except:")
* File handles are too easy to get wrong, use Node.readf/Node.writef/Utils.readf/Utils.writef

Wiki documentation on http://wiki.waf.googlecode.com/git/
---------------------------------------------------------

The wiki documentation is always outdated

Previous branches
-----------------

old svn repository http://waf.googlecode.com/svn/trunk/ (for waf 1.5, read-only and unused)
old branch for waf 1.5 http://waf.googlecode.com/svn/branches/waf-1.5/ (again, read-only and unused)

18 changes: 4 additions & 14 deletions README
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
WHAT YOU WILL FIND HERE
-----------------------

Waf 1.8 - for Waf 1.7 use the branch waf-1.7
Waf 1.8 - Recently moved to https://github.com/waf-project/waf

For the manual: http://docs.waf.googlecode.com/git/book_16/single.html
For the api docs: http://docs.waf.googlecode.com/git/apidocs_16/index.html
For the examples: see the folder demos/
For the manual: https://waf.io/book/
For the API documentation: https://waf.io/apidocs/
For the examples: see the folder demos/ and the folder playground/

HOW TO CREATE THE WAF SCRIPT
----------------------------
Expand Down Expand Up @@ -38,16 +38,6 @@ $ cp waf demos/c/
$ cd demos/c/
$ ./waf configure build

USING GIT
---------

$ git clone https://code.google.com/p/waf/
set $HOME/.netrc to read:
machine code.google.com login user@gmail.com password pass
$ git remote add code https://code.google.com/p/waf.docs/
... make a few changes
$ git push code

---------------------------
Thomas Nagy, 2014-2015 (ita)

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Waf is a Python-based framework for configuring, compiling and installing applic
* *Flexibility*: new commands and tasks can be added very easily through subclassing, bottlenecks for specific builds can be eliminated through dynamic method replacement
* *Extensibility*: though many programming languages and compilers are already supported by default, many others are available as extensions
* *IDE support*: Eclipse, Visual Studio and Xcode project generators (waflib/extras/)
* *Documentation*: the application is based on a robust model documented in [The Waf Book](http://docs.waf.googlecode.com/git/book_18/single.html) and in the [API docs](http://docs.waf.googlecode.com/git/apidocs_17/index.html)
* *Documentation*: the application is based on a robust model documented in [The Waf Book](https://waf.io/book/) and in the [API docs](https://waf.io/apidocs/)
* *Python compatibility*: cPython 2.5 to 3.4, Jython 2.5, IronPython, and Pypy

Waf is used in particular by innovative companies such as [Avalanche Studios](http://www.avalanchestudios.se) and by open-source projects such as [the Samba project](http://www.samba.org/). Learn more about Waf by reading [The Waf Book](http://docs.waf.googlecode.com/git/book_18/single.html).
Waf is used in particular by innovative companies such as [Avalanche Studios](http://www.avalanchestudios.se) and by open-source projects such as [the Samba project](https://www.samba.org/). Learn more about Waf by reading [The Waf Book](https://waf.io/book/).

For researchers and build system writers, Waf also provides a framework for creating [custom build systems](http://code.google.com/p/waf/source/browse/build_system_kit/) and [package distribution systems](http://code.google.com/p/waf/source/browse/playground/distnet/README.rst).

Expand Down
6 changes: 3 additions & 3 deletions docs/book/conclusion.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Due to the amount of features provided by Waf, this book cannot be both complete
[options="header"]
|================
|Link|Description
|http://docs.waf.googlecode.com/git/apidocs_17/index.html|The apidocs
|http://code.google.com/p/waf|The Waf project page
|http://code.google.com/p/waf/w/list|The Waf wiki, including the frequently asked questions (FAQ)
|https://waf.io/apidocs/index.html|The apidocs
|https://waf.io|The Waf project page and downloads
|https://github.com/waf-project/waf|Source code repository
|http://groups.google.com/group/waf-users|The Waf mailing-list
|http://waf-devel.blogspot.com/2011/01/python-32-and-build-system-kit.html|Information on the build system kit
|================
Expand Down
6 changes: 3 additions & 3 deletions docs/book/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ out = 'build'

def configure(ctx):
ctx.find_program('touch', var='TOUCH')
ctx.check_waf_version(mini='1.8.4')
ctx.check_waf_version(mini='1.8.8')
ctx.find_file('fstab', ['/opt', '/etc'])
---------------

Although these methods are provided by the context class _waflib.Configure.ConfigurationContext_, they will not appear on it in http://docs.waf.googlecode.com/git/apidocs_17/index.html[API documentation]. For modularity reasons, they are defined as simple functions and then bound dynamically:
Although these methods are provided by the context class _waflib.Configure.ConfigurationContext_, they will not appear on it in https://waf.io/apidocs/index.html[API documentation]. For modularity reasons, they are defined as simple functions and then bound dynamically:

[source,python]
---------------
Expand Down Expand Up @@ -394,7 +394,7 @@ Checking for program some_app : not found

$ cat build/config.log <2>
# project configured on Tue Jul 13 19:15:04 2010 by
# waf 1.8.4 (abi 98, python 20605f0 on linux2)
# waf 1.8.8 (abi 98, python 20605f0 on linux2)
# using /home/waf/bin/waf configure
#
Checking for program some_app
Expand Down
6 changes: 3 additions & 3 deletions docs/book/cprog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ from waflib import c_preproc
c_preproc.go_absolute = True
---------------

Additional tools such as http://code.google.com/p/waf/source/browse/trunk/waflib/extras/gccdeps.py[gccdeps] or http://code.google.com/p/waf/source/browse/trunk/waflib/extras/dumbpreproc.py[dumbpreproc] provide alternate dependency scanners that can be faster in certain cases (boost).
Additional tools such as https://github.com/waf-project/waf/blob/master/waflib/extras/gccdeps.py[gccdeps] or https://github.com/waf-project/waf/blob/master/waflib/extras//dumbpreproc.py[dumbpreproc] provide alternate dependency scanners that can be faster in certain cases (boost).

NOTE: The Waf engine will detect if tasks generate headers necessary for the compilation and compute the build order accordingly. It may sometimes improve the performance of the scanner if the tasks creating headers provide the hint 'ext_out=[".h"]'.

Expand Down Expand Up @@ -304,7 +304,7 @@ def build(bld):
---------------

<1> A simple shared library
<2> The 'cshlib' flags will be propagated to both the library and the program. footnote:[To prevent the propagation, see http://code.google.com/p/waf/source/browse/trunk/docs/book/examples/cprog_propagation/wscript]
<2> The 'cshlib' flags will be propagated to both the library and the program.
<3> 'lib3' uses both a shared library and a static library
<4> A program using 'lib3'

Expand Down Expand Up @@ -683,7 +683,7 @@ The outputs are written in the build directory into the file 'config.log':
[source,shishell]
------------------
# project configured on Tue Aug 31 17:30:21 2010 by
# waf 1.8.4 (abi 98, python 20605f0 on linux2)
# waf 1.8.8 (abi 98, python 20605f0 on linux2)
# using /home/waf/bin/waf configure
#
---
Expand Down
4 changes: 2 additions & 2 deletions docs/book/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ USELIB_VARS['cprogram'] = USELIB_VARS['cxxprogram'] = \

==== Setting up a Waf directory for development

Waf is hosted on http://code.google.com/p/waf/source[Google code], and uses Subversion for source control. To obtain the development copy, use:
Waf is hosted on https://github.com/waf-project/waf[Github], and uses Git for source control. To obtain the development copy, use:

[source,shishell]
---------------
$ git clone http://code.google.com/p/waf/ wafdir
$ git clone https://github.com/waf-project/waf.git wafdir
$ cd wafdir
$ ./waf-light --make-waf
---------------
Expand Down
30 changes: 15 additions & 15 deletions docs/book/download.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

=== Obtaining the Waf file

The Waf project is located on http://code.google.com/p/waf[Google Code].
The Waf project is located on https://waf.io[waf.io].
The current Waf version requires an interpreter for the Python programming language such as http://www.python.org[cPython] 2.5 to 3.4, http://pypy.org[Pypy] or http://www.jython.org[Jython] >= 2.5.

==== Downloading and using the Waf binary
Expand All @@ -11,18 +11,18 @@ The Waf binary is a python script which does not require any installation whatso

[source,shishell]
---------------
$ wget http://ftp.waf.io/pub/release/waf-1.8.4
$ mv waf-1.8.4 waf
$ wget http://ftp.waf.io/pub/release/waf-1.8.8
$ mv waf-1.8.8 waf
$ python waf --version
waf 1.8.4 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf 1.8.8 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
---------------

The +waf+ file has its own library compressed in a binary stream in the same file. Upon execution, the library is uncompressed in a hidden folder in the current directory. The folder will be re-created if removed. This scheme enables different Waf versions to be executed from the same folders:

[source,shishell]
---------------
$ ls -ld .waf*
.waf-1.8.4-2c924e3f453eb715218b9cc852291170
.waf-1.8.8-2c924e3f453eb715218b9cc852291170
---------------

NOTE: The binary file requires http://docs.python.org/library/bz2.html[bzip2] compression support, which may be unavailable in some self-compiled cPython installations.
Expand All @@ -33,18 +33,18 @@ Building Waf requires a Python interpreter having a version number in the range

[source,shishell]
---------------
$ wget http://ftp.waf.io/pub/release/waf-1.8.4.tar.bz2
$ tar xjvf waf-1.8.4.tar.bz2
$ cd waf-1.8.4
$ wget http://ftp.waf.io/pub/release/waf-1.8.8.tar.bz2
$ tar xjvf waf-1.8.8.tar.bz2
$ cd waf-1.8.8
$ python waf-light
Configuring the project
'build' finished successfully (0.001s)
Checking for program python : /usr/bin/python
Checking for python version : (2, 6, 5, 'final', 0)
'configure' finished successfully (0.176s)
Waf: Entering directory `/waf-1.8.4/build'
Waf: Entering directory `/waf-1.8.8/build'
[1/1] create_waf: -> waf
Waf: Leaving directory `/waf-1.8.4/build'
Waf: Leaving directory `/waf-1.8.8/build'
'build' finished successfully (2.050s)
---------------

Expand Down Expand Up @@ -86,13 +86,13 @@ The following will create a custom waf file which will import and execute 'foo'
$ python waf-light --make-waf --tools=compat15,$PWD/aba.py
--prelude=$'\tfrom waflib.extras import aba\n\taba.foo()'
$ ./waf --help
This is Waf 1.8.4
This is Waf 1.8.8
[...]
---------------

Foreign files to add into the folder 'extras' must be given by absolute paths in the _--tools_ switch.
Such files do not have to be Python files, yet, a typical scenario is to add an initializer to modify existing
functions and classes from the Waf modules. Various from the http://code.google.com/p/waf/source/browse/trunk/build_system_kit/[build system kit] illustrate how to create custom
functions and classes from the Waf modules. Various from the https://github.com/waf-project/waf/tree/master/build_system_kit/[build system kit] illustrate how to create custom
build systems derived from Waf.

=== Using the Waf file
Expand All @@ -112,7 +112,7 @@ On unix-like systems, it is usually much more convenient to set the executable p
---------------
$ chmod 755 waf
$ ./waf --version
waf 1.8.4 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf 1.8.8 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
---------------

If the command-line interpreter supports aliases, it is recommended to set the alias once:
Expand All @@ -121,7 +121,7 @@ If the command-line interpreter supports aliases, it is recommended to set the a
---------------
$ alias waf=$PWD/waf
$ waf --version
waf 1.8.4 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf 1.8.8 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
---------------

Or, the execution path may be modified to point at the location of the waf binary:
Expand All @@ -130,7 +130,7 @@ Or, the execution path may be modified to point at the location of the waf binar
---------------
$ export PATH=$PWD:$PATH
$ waf --version
waf 1.8.4 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf 1.8.8 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
---------------

In the next sections of the book, we assume that either an alias or the execution path have been set in a way that +waf+ may be called directly.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/nodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ some text
['.lock-wafbuild', 'foo.txt', 'build', 'wscript', '.git']
---------------

NOTE: More methods may be found in the http://docs.waf.googlecode.com/git/apidocs_17/index.html[API documentation]
NOTE: More methods may be found in the https://waf.io/apidocs/index.html[API documentation]

WARNING: The Node methods are not meant to be safe for concurrent access. The code executed in parallel (method run() of task objects for example) must avoid modifying the Node object data structure.

Expand Down
2 changes: 1 addition & 1 deletion docs/book/waf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Waf framework is somewhat different from traditional build systems in the se

The objective of this book is to expose the use of the Waf build system though the use of Waf in practice, the description of the Waf extension system, and an overview of the Waf internals. We hope that this book will serve as a reference for both new and advanced users. Although this book does not deal with build systems in general, a secondary objective is to illustrate quite a few new techniques and patterns through numerous examples.

The chapters are ordered by difficulty, starting from the basic use of Waf and Python, and diving gradually into the most difficult topics. It is therefore recommended to read the chapters in order. It is also possible to start by looking at the http://code.google.com/p/waf/source/browse/#git%2Fdemos[examples] from the Waf distribution before starting the reading.
The chapters are ordered by difficulty, starting from the basic use of Waf and Python, and diving gradually into the most difficult topics. It is therefore recommended to read the chapters in order. It is also possible to start by looking at the https://github.com/waf-project/waf/tree/master/demos[examples] from the Waf distribution before starting the reading.

:numbered:

Expand Down
14 changes: 7 additions & 7 deletions docs/book/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ def build(bld):
bld.add_group() # separator, the documents may require any of the pictures from above

bld(rule='${ADOC} -a icons=true -a stylesheet=${SRC[1].abspath()} -a iconsdir=. -a toc -d book -o ${TGT} ${SRC[0].abspath()}',
source='waf.txt waf.css', target='single.html', scan=ascii_doc_scan)
source='waf.txt waf.css', target='index.html', scan=ascii_doc_scan)

#bld(rule='${A2X} -L -a toc --icons-dir=. --icons -D ${gen.path.get_bld().abspath()} \
# -d book -f pdf --dblatex-opts "-s ${SRC[1].abspath()} -p ${SRC[2].abspath()}" ${SRC[0].bldpath()}',
# shell=True,
# source='waf.txt asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='waf.pdf', scan=ascii_doc_scan)
bld(rule='${A2X} -L -a toc --icons-dir=. --icons -D ${gen.path.get_bld().abspath()} \
-d book -f pdf --dblatex-opts "-s ${SRC[1].abspath()} -p ${SRC[2].abspath()}" ${SRC[0].bldpath()}',
shell=True,
source='waf.txt asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='waf.pdf', scan=ascii_doc_scan)

bld(rule='ln -sf single.html index.html', shell=True)
#bld(rule='ln -sf single.html index.html', shell=True)

if bld.options.exe:
def exe(ctx):
bld.exec_command('firefox build/single.html')
bld.exec_command('firefox build/index.html')
bld.add_post_fun(exe)

@TaskGen.feature('sizer')
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/_templates/indexcontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<p class="biglink"><a class="biglink" href="{{ pathto("copyright") }}">Copyright</a><br/>
<span class="linkdescr">Copyright notice</span></p>

<p class="biglink"><a class="biglink" href="http://code.google.com/p/waf/issues/list">Reporting bugs</a><br/>
<span class="linkdescr">Where to report bugs</span></p>
<p class="biglink"><a class="biglink" href="https://github.com/waf-project/waf/issues">Reporting bugs</a><br/>
<span class="linkdescr">Where to report bugs or request new features</span></p>

</td>
<td width="50%" style="vertical-align:top;">
Expand Down
8 changes: 4 additions & 4 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,16 @@ def configure(ctx):

# General information about the project.
project = u'Waf'
copyright = u'2010, Thomas Nagy'
copyright = u'2005-2015, Thomas Nagy'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.7.11'
version = '1.8.8'
# The full version, including alpha/beta/rc tags.
release = '1.7.11'
release = '1.8.8'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -402,7 +402,7 @@ def configure(ctx):
#html_theme_path = []

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# "<project> v<release> API documentation".
#html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
Expand Down
5 changes: 4 additions & 1 deletion docs/sphinx/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ be used directly, for example::

.. toctree::

tools/clang
tools/clangxx
tools/compiler_c
tools/compiler_cxx
tools/ar
Expand Down Expand Up @@ -123,6 +125,7 @@ The next tools provide support for code generators used in C and C++ projects.
tools/vala
tools/glib2
tools/qt4
tools/qt5
tools/kde4
tools/perl
tools/python
Expand All @@ -131,7 +134,7 @@ The next tools provide support for code generators used in C and C++ projects.
Other compilers and tools
-------------------------

.. _extras: http://code.google.com/p/waf/source/browse/trunk/waflib/extras/
.. _extras: https://github.com/waf-project/waf/tree/master/waflib/extras

The following tools provide support for specific compilers or configurations. More tools are present in the extras_ folder, although they are not documented and as stable as the default tools.

Expand Down
Loading

0 comments on commit 8ac4646

Please sign in to comment.