Buildj file(s)
- From: Nagy Thomas <tnagy256 yahoo fr>
- To: buildj-list gnome org
- Subject: Buildj file(s)
- Date: Mon, 4 Oct 2010 12:20:31 +0000 (GMT)
To ease the use of buildj (however you call it), it may be interesting to provide a single file. It is not necessary to wrap 'waf' by another program, for a few command-lines are provided (rev: 9744) to ease the creation of a custom executable (you do not have to call the resulting script 'waf').
For example, having the file aba.py containing:
"""
def foo():
print("hi there")
"""
The waf file created by the following command-line:
$ ./waf-light --make-waf --tools=compat15,/comp/waf/aba.py --prelude=$'\tfrom waflib.extras import aba\n\taba.foo()'
will include waflib/extras/aba.py (absolute paths are added to the folder 'extras'). It will be imported before any other waf module, and the function "foo" will be executed first. You may want to replace (monkey patching) waflib.Context.load_tool to enable waf to read code from yaml files, or waflib.Scripting.waf_entry_point to change the initialization system.
Regarding the yaml files, I never heard of pyyaml before, and I do not think its use is widespread. Using different python versions can be a problem too. In my view writing a custom parser to remove the dependency sounds reasonable (python provides shlex and a python parser, building upon them should not be too difficult).
I would be interested to see a specification of those yaml files too (not just an example or two). Forward compatibility is a very difficult problem with description files, and it is one of the main reasons why waf files are still plain python scripts.
Thomas
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]