|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64460 - in trunk/tools/build/v2: build test util
From: ghost_at_[hidden]
Date: 2010-07-30 04:46:22
Author: vladimir_prus
Date: 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
New Revision: 64460
URL: http://svn.boost.org/trac/boost/changeset/64460
Log:
Fix the 'chain' and 'inherited_dependency' tests.
Text files modified:
trunk/tools/build/v2/build/project.py | 2 +-
trunk/tools/build/v2/build/property.py | 31 ++++++++++++++-----------------
trunk/tools/build/v2/build/property_set.py | 7 +++++++
trunk/tools/build/v2/build/targets.py | 6 ++----
trunk/tools/build/v2/test/chain.py | 4 ++--
trunk/tools/build/v2/util/path.py | 5 +++++
6 files changed, 31 insertions(+), 24 deletions(-)
Modified: trunk/tools/build/v2/build/project.py
==============================================================================
--- trunk/tools/build/v2/build/project.py (original)
+++ trunk/tools/build/v2/build/project.py 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
@@ -750,7 +750,7 @@
elif attribute == "source-location":
source_location = []
for path in specification:
- source_location += os.path.join(self.location, path)
+ source_location.append(os.path.join(self.location, path))
self.__dict__["source-location"] = source_location
elif attribute == "build-dir":
Modified: trunk/tools/build/v2/build/property.py
==============================================================================
--- trunk/tools/build/v2/build/property.py (original)
+++ trunk/tools/build/v2/build/property.py 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
@@ -405,19 +405,16 @@
result.append(e)
return result
-def translate_dependencies(specification, project_id, location):
+def translate_dependencies(properties, project_id, location):
result = []
- for p in specification:
- split = split_conditional(p)
- condition = ""
- if split:
- condition = split[0]
- p = split[1]
-
- f = get_grist(p)
- v = get_value(p)
- if "dependency" in feature.attributes(f):
+ for p in properties:
+
+ if not p.feature().dependency():
+ result.append(p)
+ else:
+ v = p.value()
+ print "value", v, "id", project_id
m = re.match("(.*)//(.*)", v)
if m:
rooted = m.group(1)
@@ -426,13 +423,13 @@
pass
else:
rooted = os.path.join(os.getcwd(), location, rooted[0])
- result.append(condition + f + rooted + "//" + m.group(2))
- elif os.path.isabs(m.group(v)):
- result.append(condition + p)
+
+ result.append(Property(p.feature(), rooted + "//" + m.group(2), p.condition()))
+
+ elif os.path.isabs(v):
+ result.append(p)
else:
- result.append(condition + f + project_id + "//" + v)
- else:
- result.append(condition + p)
+ result.append(Property(p.feature(), project_id + "//" + v, p.condition()))
return result
Modified: trunk/tools/build/v2/build/property_set.py
==============================================================================
--- trunk/tools/build/v2/build/property_set.py (original)
+++ trunk/tools/build/v2/build/property_set.py 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
@@ -13,6 +13,8 @@
from b2.util.sequence import unique
from b2.util.set import difference
+from b2.manager import get_manager
+
def reset ():
""" Clear the module state. This is mainly for testing purposes.
"""
@@ -68,6 +70,11 @@
properties = property.create_from_strings(raw_properties, True)
properties = property.translate_paths(properties, location)
properties = property.translate_indirect(properties, jamfile_module)
+
+ project_id = get_manager().projects().attributeDefault(jamfile_module, 'id', None)
+ if not project_id:
+ project_id = os.path.abspath(location)
+ properties = property.translate_dependencies(properties, project_id, location)
properties = property.expand_subfeatures_in_conditions(properties)
return create(properties)
Modified: trunk/tools/build/v2/build/targets.py
==============================================================================
--- trunk/tools/build/v2/build/targets.py (original)
+++ trunk/tools/build/v2/build/targets.py 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
@@ -776,7 +776,7 @@
def location (self):
# Returns the location of target. Needed by 'testing.jam'
if not self.file_location_:
- source_location = self.project_.get ('source-location')
+ source_location = self.project_.get('source-location')
for src_dir in source_location:
location = os.path.join(src_dir, self.name())
@@ -1114,9 +1114,7 @@
self.manager_.targets().log(
"Build properties: '%s'" % str(rproperties))
- extra = rproperties.get ('<source>')
- source_targets += replace_grist (extra, '')
- source_targets = replace_references_by_objects (self.manager (), source_targets)
+ source_targets += rproperties.get('<source>')
# We might get duplicate sources, for example if
# we link to two library which have the same <library> in
Modified: trunk/tools/build/v2/test/chain.py
==============================================================================
--- trunk/tools/build/v2/test/chain.py (original)
+++ trunk/tools/build/v2/test/chain.py 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
@@ -19,8 +19,8 @@
t.write("jamroot.jam", "import gcc ;")
t.write("jamfile.jam", r'''
-import modules ;
-if [ modules.peek : NT ]
+import os ;
+if [ os.name ] = NT
{
actions create
{
Modified: trunk/tools/build/v2/util/path.py
==============================================================================
--- trunk/tools/build/v2/util/path.py (original)
+++ trunk/tools/build/v2/util/path.py 2010-07-30 04:46:20 EDT (Fri, 30 Jul 2010)
@@ -22,6 +22,9 @@
from utility import to_seq
from glob import glob as builtin_glob
+from b2.util import bjam_signature
+
+@bjam_signature((["path", "root"],))
def root (path, root):
""" If 'path' is relative, it is rooted at 'root'. Otherwise, it's unchanged.
"""
@@ -30,6 +33,7 @@
else:
return os.path.join (root, path)
+@bjam_signature((["native"],))
def make (native):
""" Converts the native path into normalized form.
"""
@@ -43,6 +47,7 @@
return os.path.normpath (native)
+@bjam_signature((["path"],))
def native (path):
""" Builds a native representation of the path.
"""
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk