Force files into the build directory by default

This commit is contained in:
Thomas Nagy 2016-11-20 13:43:00 +01:00
parent f10c195319
commit a892d8725a
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
3 changed files with 10 additions and 19 deletions

View File

@ -2,4 +2,5 @@ NEW IN WAF 2.0.0
----------------
* Keep sorted lists in TaskGen.prec[]
* Removed ut_fun from waf_unit_test.py
* Force files into the build directory by default

2
TODO
View File

@ -3,6 +3,6 @@ Waf 2.0
Merge mem_reducer.py in the mainline
Improve the sorting in TaskGen.post()
Default to force files into the build directory
Remove ut_exec, ut_cmd from waf_unit_test.py
Better logging?

View File

@ -779,29 +779,19 @@ class Node(object):
def find_or_declare(self, lst):
"""
Use this method in the build phase to declare output files.
Use this method in the build phase to declare output files which
are meant to be written in the build directory.
If 'self' is in build directory, it first tries to return an existing node object.
If no Node is found, it tries to find one in the source directory.
If no Node is found, a new Node object is created in the build directory, and the
intermediate folders are added.
This method creates the Node object and its parent folder
as needed.
:param lst: relative path
:type lst: string or list of string
"""
if isinstance(lst, str):
lst = [x for x in Utils.split_path(lst) if x and x != '.']
node = self.get_bld().search_node(lst)
if node:
if not os.path.isfile(node.abspath()):
node.parent.mkdir()
return node
self = self.get_src()
node = self.find_node(lst)
if node:
return node
node = self.get_bld().make_node(lst)
if os.path.isabs(lst):
node = self.ctx.root.make_node(lst)
else:
node = self.get_bld().make_node(lst)
node.parent.mkdir()
return node