Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64549 - in trunk/tools/build/v2: build test util
From: ghost_at_[hidden]
Date: 2010-08-02 13:30:48


Author: vladimir_prus
Date: 2010-08-02 13:30:46 EDT (Mon, 02 Aug 2010)
New Revision: 64549
URL: http://svn.boost.org/trac/boost/changeset/64549

Log:
Make test/standalone.py pass.

Text files modified:
   trunk/tools/build/v2/build/alias.py | 5 ++++-
   trunk/tools/build/v2/test/standalone.py | 17 +++++++++++++++++
   trunk/tools/build/v2/util/__init__.py | 6 ++++++
   3 files changed, 27 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/build/alias.py
==============================================================================
--- trunk/tools/build/v2/build/alias.py (original)
+++ trunk/tools/build/v2/build/alias.py 2010-08-02 13:30:46 EDT (Mon, 02 Aug 2010)
@@ -29,6 +29,8 @@
 import property_set
 from b2.manager import get_manager
 
+from b2.util import metatarget
+
 class AliasTarget(targets.BasicTarget):
 
     def __init__(self, *args):
@@ -43,6 +45,7 @@
         # look like 100% alias.
         return base.add(subvariant.sources_usage_requirements())
 
+@metatarget
 def alias(name, sources, requirements=None, default_build=None, usage_requirements=None):
     project = get_manager().projects().current()
     targets = get_manager().targets()
@@ -51,7 +54,7 @@
         default_build = default_build[0]
 
     targets.main_target_alternative(AliasTarget(
- name[0], project,
+ name, project,
         targets.main_target_sources(sources, name),
         targets.main_target_requirements(requirements or [], project),
         targets.main_target_default_build(default_build, project),

Modified: trunk/tools/build/v2/test/standalone.py
==============================================================================
--- trunk/tools/build/v2/test/standalone.py (original)
+++ trunk/tools/build/v2/test/standalone.py 2010-08-02 13:30:46 EDT (Mon, 02 Aug 2010)
@@ -32,6 +32,23 @@
 alias runtime : x ;
 """)
 
+t.write("standalone.py", """
+from b2.manager import get_manager
+
+# FIXME: this is ugly as death
+get_manager().projects().initialize(__name__)
+
+import os ;
+
+# This use of list as parameter is also ugly.
+project(['standalone'])
+
+pwd = os.getcwd()
+alias('x', [os.path.join(pwd, '../a.cpp')])
+alias('runtime', ['x'])
+""")
+
+
 t.write("sub/jamfile.jam", """
 stage bin : /standalone//runtime ;
 """)

Modified: trunk/tools/build/v2/util/__init__.py
==============================================================================
--- trunk/tools/build/v2/util/__init__.py (original)
+++ trunk/tools/build/v2/util/__init__.py 2010-08-02 13:30:46 EDT (Mon, 02 Aug 2010)
@@ -11,6 +11,12 @@
 
     return wrap
 
+def metatarget(f):
+
+ f.bjam_signature = (["name"], ["sources", "*"], ["requirements", "*"],
+ ["default_build", "*"], ["usage_requirements", "*"])
+ return f
+
 class cached(object):
 
     def __init__(self, function):


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