Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-10-10 04:27:09


Author: vladimir_prus
Date: 2007-10-10 04:27:08 EDT (Wed, 10 Oct 2007)
New Revision: 39877
URL: http://svn.boost.org/trac/boost/changeset/39877

Log:
More project.jam porting. Grab ARGV from bjam.

Text files modified:
   branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/DESIGN.txt | 5 ++++
   branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/project.py | 49 ++++++++++++++++++++-------------------
   branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/property_set.py | 5 +++
   branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/manager.py | 5 ++++
   4 files changed, 39 insertions(+), 25 deletions(-)

Modified: branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/DESIGN.txt
==============================================================================
--- branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/DESIGN.txt (original)
+++ branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/DESIGN.txt 2007-10-10 04:27:08 EDT (Wed, 10 Oct 2007)
@@ -125,3 +125,8 @@
 
 Defines new action with specified name, body, list if bound
 variables and flags. The action is created in the global module.
+
+4. variable name
+
+Obtains the value of a variable 'name' in Jam's global module.
+

Modified: branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/project.py
==============================================================================
--- branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/project.py (original)
+++ branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/project.py 2007-10-10 04:27:08 EDT (Wed, 10 Oct 2007)
@@ -109,8 +109,8 @@
         If the jamfile at that location is loaded already, does nothing.
         Returns the project module for the Jamfile."""
 
- if "--debug-loading" in sys.argv:
- print "Loading Jamfile at" '$(jamfile-location)'
+ if "--debug-loading" in self.manager.argv():
+ print "Loading Jamfile at '%s'" % jamfile_location
 
             
         mname = self.module_name(jamfile_location)
@@ -273,9 +273,7 @@
         """Load a Jamfile at the given directory. Returns nothing.
         Will attempt to load the file as indicated by the JAMFILE patterns.
         Effect of calling this rule twice with the same 'dir' is underfined."""
-
- print "Loading jamfile for", dir
-
+
         # See if the Jamfile is where it should be.
         
         jamfile_to_load = boost.build.util.path.glob(dir, self.JAMROOT)
@@ -283,8 +281,6 @@
             jamfile_to_load = self.find_jamfile(dir)
         else:
             jamfile_to_load = jamfile_to_load[0]
-
- print "Jamfile found at", jamfile_to_load
             
         # The module of the jamfile.
         dir = os.path.realpath(os.path.dirname(jamfile_to_load))
@@ -350,7 +346,7 @@
                  If not specified, stanalone project will be initialized
         """
 
- if "--debug-loading" in sys.argv:
+ if "--debug-loading" in self.manager.argv():
             print "Initializing project '%s'" % module_name
 
         # TODO: need to consider if standalone projects can do anything but defining
@@ -669,6 +665,7 @@
                                "source-location", "parent",
                                "projects-to-build", "project-root"]:
             pass
+ # FIXME
             #errors.error "Invalid project attribute '$(attribute)' specified "
             # "for project at '$(self.location)'" ;
         else:
@@ -677,22 +674,26 @@
     def get(self, attribute):
         return self.__dict__.get(attribute, [])
 
- # FIXME
- # Prints the project attributes.
- #rule print ( )
- #{
- # local id = $(self.id) ; id ?= (none) ;
- # local parent = $(self.parent) ; parent ?= (none) ;
- # print.section "'"$(id)"'" ;
- # print.list-start ;
- # print.list-item "Parent project:" $(parent) ;
- # print.list-item "Requirements:" [ $(self.requirements).raw ] ;
- # print.list-item "Default build:" $(self.default-build) ;
- # print.list-item "Source location:" $(self.source-location) ;
- # print.list-item "Projects to build:"
- # [ sequence.insertion-sort $(self.projects-to-build) ] ;
- # print.list-end ;
- #}
+ def dump(self):
+ """Prints the project attributes."""
+ id = self.get("id")
+ if not id:
+ id = "(none)"
+ else:
+ id = id[0]
+
+ parent = self.get("parent")
+ if not parent:
+ parent = "(none)"
+ else:
+ parent = parent[0]
+
+ print "'%s'" % id
+ print "Parent project:%s", parent
+ print "Requirements:%s", self.get("requirements")
+ print "Default build:%s", string.join(self.get("debuild-build"))
+ print "Source location:%s", string.join(self.get("source-location"))
+ print "Projects to build:%s", string.join(self.get("projects-to-build").sort());
 
 class ProjectRules:
     """Class keeping all rules that are made available to Jamfile."""

Modified: branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/property_set.py
==============================================================================
--- branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/property_set.py (original)
+++ branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/build/property_set.py 2007-10-10 04:27:08 EDT (Wed, 10 Oct 2007)
@@ -4,7 +4,7 @@
 # warranty, and with no claim as to its suitability for any purpose.
 
 from boost.build.util.utility import *
-import property, feature
+import property, feature, string
 from boost.build.exceptions import *
 from boost.build.util.sequence import unique
 
@@ -144,6 +144,9 @@
         """ Returns the list of stored properties.
         """
         return self.raw_
+
+ def __str__(self):
+ return string.join(self.raw_)
     
     def base (self):
         """ Returns properties that are neither incidental nor free.

Modified: branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/manager.py
==============================================================================
--- branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/manager.py (original)
+++ branches/BOOST_BUILD_PYTHON/boost/tools/build/v2/python/boost/build/manager.py 2007-10-10 04:27:08 EDT (Wed, 10 Oct 2007)
@@ -8,6 +8,7 @@
 from build.scanner import ScannerRegistry
 from boost.build.util.logger import NullLogger
 from build import build_request, property_set, feature
+import bjam
 
 # To simplify implementation of tools level, we'll
 # have a global variable keeping the current manager.
@@ -30,6 +31,7 @@
         self.targets_ = TargetRegistry ()
         self.logger_ = NullLogger ()
         self.scanners_ = ScannerRegistry (self)
+ self.argv_ = bjam.variable("ARGV")
         
         # Object Map.
         # TODO: This is a kludge: maps object names to the actual instances.
@@ -54,6 +56,9 @@
 
     def projects (self):
         return self.projects_
+
+ def argv (self):
+ return self.argv_
     
     def logger (self):
         return self.logger_


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