Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64708 - trunk/tools/build/v2/tools
From: ghost_at_[hidden]
Date: 2010-08-09 16:54:31


Author: vladimir_prus
Date: 2010-08-09 16:54:29 EDT (Mon, 09 Aug 2010)
New Revision: 64708
URL: http://svn.boost.org/trac/boost/changeset/64708

Log:
Port tools/message.jam.

Added:
   trunk/tools/build/v2/tools/message.py (contents, props changed)
Text files modified:
   trunk/tools/build/v2/tools/builtin.py | 1 +
   1 files changed, 1 insertions(+), 0 deletions(-)

Modified: trunk/tools/build/v2/tools/builtin.py
==============================================================================
--- trunk/tools/build/v2/tools/builtin.py (original)
+++ trunk/tools/build/v2/tools/builtin.py 2010-08-09 16:54:29 EDT (Mon, 09 Aug 2010)
@@ -715,3 +715,4 @@
 
 import stage
 import symlink
+import message

Added: trunk/tools/build/v2/tools/message.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/tools/message.py 2010-08-09 16:54:29 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,46 @@
+# Status: ported.
+# Base revision: 64488.
+#
+# Copyright 2008, 2010 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+# Defines main target type 'message', that prints a message when built for the
+# first time.
+
+import b2.build.targets as targets
+import b2.build.property_set as property_set
+
+from b2.manager import get_manager
+
+class MessageTargetClass(targets.BasicTarget):
+
+ def __init__(self, name, project, *args):
+
+ targets.BasicTarget.__init__(self, name, project, [])
+ self.args = args
+ self.built = False
+
+ def construct(self, name, sources, ps):
+
+ if not self.built:
+ for arg in self.args:
+ if type(arg) == type([]):
+ arg = " ".join(arg)
+ print arg
+ self.built = True
+
+ return (property_set.empty(), [])
+
+def message(name, *args):
+
+ if type(name) == type([]):
+ name = name[0]
+
+ t = get_manager().targets()
+
+ project = get_manager().projects().current()
+
+ return t.main_target_alternative(MessageTargetClass(*((name, project) + args)))
+
+get_manager().projects().add_rule("message", message)


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