docs: update the version number automatically

This commit is contained in:
Thomas Nagy 2015-04-26 17:09:01 +02:00
parent ffd6c60113
commit 6c7eb129af
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
5 changed files with 44 additions and 36 deletions

View File

@ -178,7 +178,7 @@ out = 'build'
def configure(ctx):
ctx.find_program('touch', var='TOUCH')
ctx.check_waf_version(mini='1.8.9')
ctx.check_waf_version(mini='{version}')
ctx.find_file('fstab', ['/opt', '/etc'])
---------------
@ -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.9 (abi 98, python 20605f0 on linux2)
# waf {version} (abi 98, python 20605f0 on linux2)
# using /home/waf/bin/waf configure
#
Checking for program some_app

View File

@ -685,7 +685,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.9 (abi 98, python 20605f0 on linux2)
# waf {version} (abi 98, python 20605f0 on linux2)
# using /home/waf/bin/waf configure
#
---

View File

@ -11,10 +11,10 @@ The Waf binary is a python script which does not require any installation whatso
[source,shishell]
---------------
$ wget https://waf.io/waf-1.8.9
$ mv waf-1.8.9 waf
$ wget https://waf.io/waf-{version}
$ mv waf-{version} waf
$ python waf --version
waf 1.8.9 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf {version} (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:
@ -22,7 +22,7 @@ The +waf+ file has its own library compressed in a binary stream in the same fil
[source,shishell]
---------------
$ ls -ld .waf*
.waf-1.8.9-2c924e3f453eb715218b9cc852291170
.waf-{version}-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.
@ -33,18 +33,18 @@ Building Waf requires a Python interpreter having a version number in the range
[source,shishell]
---------------
$ wget https://waf.io/waf-1.8.9.tar.bz2
$ tar xjvf waf-1.8.9.tar.bz2
$ cd waf-1.8.9
$ wget https://waf.io/waf-{version}.tar.bz2
$ tar xjvf waf-{version}.tar.bz2
$ cd waf-{version}
$ 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.9/build'
Waf: Entering directory `/waf-{version}/build'
[1/1] create_waf: -> waf
Waf: Leaving directory `/waf-1.8.9/build'
Waf: Leaving directory `/waf-{version}/build'
'build' finished successfully (2.050s)
---------------
@ -86,7 +86,7 @@ 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.9
This is Waf {version}
[...]
---------------
@ -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.9 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf {version} (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
---------------
If the command-line interpreter supports aliases, it is recommended to set the alias once:
@ -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.9 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf {version} (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
---------------
Or, the execution path may be modified to point at the location of the waf binary:
@ -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.9 (54dc13ba5f51bfe2ae277451ec5ac1d0a91c7aaf)
waf {version} (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.

View File

@ -35,20 +35,20 @@ The chapters are ordered by difficulty, starting from the basic use of Waf and P
:numbered:
include::download.txt[]
include::execution.txt[]
include::configuration.txt[]
include::build.txt[]
include::nodes.txt[]
include::advbuild.txt[]
include::tasks.txt[]
include::make_like_rules.txt[]
include::chains.txt[]
include::task_generators.txt[]
include::cprog.txt[]
include::scenarios.txt[]
include::development.txt[]
include::architecture.txt[]
include::conclusion.txt[]
include::glossary.txt[]
include::download_.txt[]
include::execution_.txt[]
include::configuration_.txt[]
include::build_.txt[]
include::nodes_.txt[]
include::advbuild_.txt[]
include::tasks_.txt[]
include::make_like_rules_.txt[]
include::chains_.txt[]
include::task_generators_.txt[]
include::cprog_.txt[]
include::scenarios_.txt[]
include::development_.txt[]
include::architecture_.txt[]
include::conclusion_.txt[]
include::glossary_.txt[]

View File

@ -132,15 +132,23 @@ def build(bld):
for x in 'shishell.lang symbols.lang default.style lang.map waf.css'.split():
bld(features='subst', source=x, target=x, is_copy=True)
with open('../../waflib/Context.py', 'r') as f:
version = re.compile('WAFVERSION=[\'"]([^\'"]+)', re.M).search(f.read()).group(1)
def sfun(tsk, text):
return text.replace('{version}', version)
for x in bld.path.ant_glob('*.txt'):
bld(features='subst', source=x, target=x.change_ext('_.txt'), subst_fun=sfun)
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='index.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()}',
bld(rule='${A2X} -L -a toc --icons-dir=. --icons -d book -f pdf --dblatex-opts "-s ${SRC[1].abspath()} -p ${SRC[2].abspath()} -o ${TGT}" ${SRC[0].bldpath()}',
shell=True,
source='waf.txt asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='waf.pdf', scan=ascii_doc_scan)
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)