Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79733 - in trunk/tools/build/v2: build kernel test util
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-25 01:15:44


Author: jurko
Date: 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
New Revision: 79733
URL: http://svn.boost.org/trac/boost/changeset/79733

Log:
Boost Build cleanup - minor stylistic changes & comment updates.
Text files modified:
   trunk/tools/build/v2/build/alias.jam | 3
   trunk/tools/build/v2/build/generators.jam | 18 +++---
   trunk/tools/build/v2/build/project.jam | 97 ++++++++++++++++++++-------------------
   trunk/tools/build/v2/build/targets.jam | 15 +++--
   trunk/tools/build/v2/kernel/errors.jam | 3
   trunk/tools/build/v2/test/dll_path.py | 1
   trunk/tools/build/v2/test/generators_test.py | 2
   trunk/tools/build/v2/util/path.jam | 10 ++--
   8 files changed, 77 insertions(+), 72 deletions(-)

Modified: trunk/tools/build/v2/build/alias.jam
==============================================================================
--- trunk/tools/build/v2/build/alias.jam (original)
+++ trunk/tools/build/v2/build/alias.jam 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -1,6 +1,7 @@
 # Copyright 2003, 2004, 2006 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 # This module defines the 'alias' rule and the associated target class.
 #

Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -1,9 +1,9 @@
-# Copyright Vladimir Prus 2002.
-# Copyright Rene Rivera 2006.
+# Copyright 2002. Vladimir Prus
+# Copyright 2006. Rene Rivera
 #
 # Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 # Manages 'generators' --- objects which can do transformation between different
 # target types and contain algorithm for finding transformation from sources to
@@ -446,7 +446,7 @@
     )
     {
         local result ;
- # If this is 1->1 transformation, apply it to all consumed targets in
+ # If this is a 1->1 transformation, apply it to all consumed targets in
         # order.
         if ! $(self.source-types[2]) && ! $(self.composing)
         {
@@ -520,10 +520,10 @@
     # When 'name' is empty, all source targets must have the same 'name'
     # attribute value, which will be used instead of the 'name' argument.
     #
- # The 'name' attribute value for each generated target will be equal to
- # the 'name' parameter if there is no name pattern for this type. Otherwise,
- # the '%' symbol in the name pattern will be replaced with the 'name'
- # parameter to obtain the 'name' attribute.
+ # The 'name' attribute value for each generated target will be equal to the
+ # 'name' parameter if there is no name pattern for this type. Otherwise, the
+ # '%' symbol in the name pattern will be replaced with the 'name' parameter
+ # to obtain the 'name' attribute.
     #
     # For example, if targets types are T1 and T2 (with name pattern "%_x"),
     # suffixes for T1 and T2 are .t1 and .t2, and source is foo.z, then created

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -2,7 +2,8 @@
 # Copyright 2002, 2005, 2006 Rene Rivera
 # Copyright 2002, 2003, 2004, 2005, 2006 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 # Implements project representation and loading. Each project is represented by:
 # - a module where all the Jamfile content live.
@@ -55,18 +56,18 @@
     }
 
     local module-name = [ module-name $(jamfile-location) ] ;
- # If Jamfile is already loaded, don't try again.
+ # If Jamfile is already loaded, do not try again.
     if ! $(module-name) in $(.jamfile-modules)
     {
         load-jamfile $(jamfile-location) : $(module-name) ;
 
         # We want to make sure that child project are loaded only after parent
         # projects. In particular, because parent projects define attributes
- # which are inherited by children, and we don't want children to be
- # loaded before parent has defined everything.
+ # which are then inherited by children, and we do not want children to
+ # be loaded before parent has defined everything.
         #
         # While "build-project" and "use-project" can potentially refer to child
- # projects from parent projects, we don't immediately load child
+ # projects from parent projects, we do not immediately load child
         # projects when seeing those attributes. Instead, we record the minimal
         # information to be used only later.
         load-used-projects $(module-name) ;
@@ -273,10 +274,7 @@
 # the file as indicated by the JAMFILE patterns. Effect of calling this rule
 # twice with the same 'dir' is undefined.
 #
-local rule load-jamfile (
- dir # The directory of the project Jamfile.
- : jamfile-module
- )
+local rule load-jamfile ( dir : jamfile-module )
 {
     # See if the Jamfile is where it should be.
     #
@@ -293,18 +291,16 @@
             "Filenames are: " $(jamfile-to-load:D=) ;
     }
 
- # Now load the Jamfile in it's own context.
- # The call to 'initialize' may load parent Jamfile, which might have
- # 'use-project' statement that causes a second attempt to load the
- # same project we're loading now. Checking inside .jamfile-modules
- # prevents that second attempt from messing up.
+ # Now load the Jamfile in its own context.
+ # The call to 'initialize' may load the parent Jamfile, which might contain
+ # a 'use-project' statement, causing a second attempt to load the same
+ # project we are loading now. Checking inside .jamfile-modules prevents that
+ # second attempt from messing things up.
     if ! $(jamfile-module) in $(.jamfile-modules)
     {
-
         # Initialize the Jamfile module before loading.
- #
- initialize $(jamfile-module) : [ path.parent $(jamfile-to-load) ]
- : $(jamfile-to-load:BS) ;
+ initialize $(jamfile-module) : [ path.parent $(jamfile-to-load) ] :
+ $(jamfile-to-load:BS) ;
 
         if ! $(jamfile-module) in $(.jamfile-modules)
         {
@@ -313,7 +309,8 @@
             local saved-project = $(.current-project) ;
 
             mark-as-user $(jamfile-module) ;
- modules.load $(jamfile-module) : [ path.native $(jamfile-to-load) ] : . ;
+ modules.load $(jamfile-module) : [ path.native $(jamfile-to-load) ]
+ : . ;
             if [ MATCH ($(JAMROOT)) : $(jamfile-to-load:BS) ]
             {
                 jamfile = [ find-jamfile $(dir) : no-errors ] ;
@@ -338,14 +335,12 @@
 
             if $(.global-build-dir)
             {
- local id = [ attribute $(jamfile-module) id ] ;
- local project-root = [ attribute $(jamfile-module) project-root ] ;
- local location = [ attribute $(jamfile-module) location ] ;
-
- if $(location) && $(project-root) = $(dir)
+ if [ attribute $(jamfile-module) location ] && ! [ attribute
+ $(jamfile-module) id ]
                 {
- # This is Jamroot.
- if ! $(id)
+ local project-root = [ attribute $(jamfile-module)
+ project-root ] ;
+ if $(project-root) = $(dir)
                     {
                         ECHO "warning: the --build-dir option was specified" ;
                         ECHO "warning: but Jamroot at '$(dir)'" ;
@@ -432,8 +427,8 @@
         }
         else
         {
- # It's either jamroot or standalone project. If it's jamroot,
- # inherit from user-config.
+ # We have either jamroot or a standalone project. If it is jamroot,
+ # inherit from user-config (or project-config if it exists).
             if $(location)
             {
                 # If project-config module exist, inherit from it.
@@ -451,39 +446,46 @@
     }
 
     # TODO: need to consider if standalone projects can do anything but define
- # prebuilt targets. If so, we need to give it a more sensible "location", so
- # that source paths are correct.
+ # prebuilt targets. If so, we need to give them a more sensible "location",
+ # so that source paths are correct.
     location ?= "" ;
     # Create the module for the Jamfile first.
     module $(module-name)
     {
     }
 
- # load-parent can end up loading this module again.
- # Make sure this isn't duplicated.
- if ! $($(module-name).attributes) {
-
+ # load-parent can end up loading this module again. Make sure this is not
+ # duplicated.
+ if ! $($(module-name).attributes)
+ {
         $(module-name).attributes = [ new project-attributes $(location)
             $(module-name) ] ;
         local attributes = $($(module-name).attributes) ;
 
         if $(location)
         {
- $(attributes).set source-location : [ path.make $(location) ] : exact ;
+ $(attributes).set source-location : [ path.make $(location) ] :
+ exact ;
         }
- else if ! $(module-name) in test-config site-config user-config project-config
+ else
         {
- # This is a standalone project with known location. Set source location
- # so that it can declare targets. This is intended so that you can put
- # a .jam file in your sources and use it via 'using'. Standard modules
- # (in 'tools' subdir) may not assume source dir is set.
- local s = [ modules.binding $(module-name) ] ;
- if ! $(s)
+ local cfgs = test site user project ;
+ if ! $(module-name) in $(cfgs)-config
             {
- import errors ;
- errors.error "Could not determine project location $(module-name)" ;
+ # This is a standalone project with known location. Set its
+ # source location so it can declare targets. This is needed so
+ # you can put a .jam file with your sources and use it via
+ # 'using'. Standard modules (in the 'tools' subdir) may not
+ # assume source dir is set.
+ local s = [ modules.binding $(module-name) ] ;
+ if ! $(s)
+ {
+ import errors ;
+ errors.error Could not determine project location
+ $(module-name) ;
+ }
+ $(attributes).set source-location : $(s:D) : exact ;
             }
- $(attributes).set source-location : $(s:D) : exact ;
         }
 
         $(attributes).set requirements : [ property-set.empty ] : exact ;
@@ -902,8 +904,9 @@
             : $(18) : $(19) ;
         modules.poke : BOOST_BUILD_PATH : $(x) ;
 
- # The above might have clobbered .current-project. Restore the correct
- # value.
+ # The above might have clobbered .current-project (newly created project
+ # instances automatically get set as the 'current' project). Restore the
+ # correct value.
         modules.poke project : .current-project : [ project.target $(caller) ] ;
     }
 

Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam (original)
+++ trunk/tools/build/v2/build/targets.jam 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -620,11 +620,12 @@
         # When selecting alternatives we have to consider defaults, for example:
         # lib l : l.cpp : <variant>debug ;
         # lib l : l_opt.cpp : <variant>release ;
- # won't work unless we add default value <variant>debug.
+ # will not work unless we add default value <variant>debug.
         property-set = [ $(p).add-defaults ] ;
 
- # The algorithm: we keep the current best viable alternative. When we've
- # got a new best viable alternative, we compare it with the current one.
+ # The algorithm: we keep the current best viable alternative. When we
+ # encounter a new best viable alternative, we compare it with the
+ # current one.
 
         local best ;
         local best-properties ;
@@ -694,8 +695,8 @@
     {
         start-building $(__name__) ;
 
- # We want composite properties in build request act as if all the
- # properties it expands too are explicitly specified.
+ # We want composite properties in the build request to act as if all the
+ # properties they expand to have been explicitly specified.
         property-set = [ $(property-set).expand ] ;
 
         local all-property-sets = [ apply-default-build $(property-set) ] ;
@@ -999,8 +1000,8 @@
     while $(count)
     {
         # Evaluate conditionals in context of current properties.
- local e = [ property.evaluate-conditionals-in-context $(conditionals)
- : $(current) ] ;
+ local e = [ property.evaluate-conditionals-in-context $(conditionals) :
+ $(current) ] ;
 
         # Evaluate indirect conditionals.
         for local i in $(indirect)

Modified: trunk/tools/build/v2/kernel/errors.jam
==============================================================================
--- trunk/tools/build/v2/kernel/errors.jam (original)
+++ trunk/tools/build/v2/kernel/errors.jam 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -1,7 +1,8 @@
 # Copyright 2003 Dave Abrahams
 # Copyright 2004 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)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 # Print a stack backtrace leading to this rule's caller. Each argument
 # represents a line of output to be printed after the first line of the

Modified: trunk/tools/build/v2/test/dll_path.py
==============================================================================
--- trunk/tools/build/v2/test/dll_path.py (original)
+++ trunk/tools/build/v2/test/dll_path.py 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -60,7 +60,6 @@
             return [ generator.generated-targets $(sources) :
                 [ $(property-set).add-raw $(dll-paths:G=<dll-path>) ] :
                 $(project) $(name) ] ;
-
         }
     }
     generators.register [ new dll-paths-list-generator ] ;

Modified: trunk/tools/build/v2/test/generators_test.py
==============================================================================
--- trunk/tools/build/v2/test/generators_test.py (original)
+++ trunk/tools/build/v2/test/generators_test.py 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -387,7 +387,7 @@
 # our actions. To achieve this we register a series of actions for all the
 # targets (since they all have the same target list - either all or none of them
 # get run independent of which target actually needs to get built), each
-# building only a single target. Since all out actions use the same targets we
+# building only a single target. Since all our actions use the same targets, we
 # can not use 'on-target' parameters to pass data to a specific action so we
 # pass them using the second 'sources' parameter which our actions then know how
 # to interpret correctly. This works well since Boost Jam does not automatically

Modified: trunk/tools/build/v2/util/path.jam
==============================================================================
--- trunk/tools/build/v2/util/path.jam (original)
+++ trunk/tools/build/v2/util/path.jam 2012-07-25 01:15:42 EDT (Wed, 25 Jul 2012)
@@ -1,10 +1,10 @@
-# Copyright Vladimir Prus 2002-2006.
-# Copyright Dave Abrahams 2003-2004.
-# Copyright Rene Rivera 2003-2006.
+# Copyright 2002-2006. Vladimir Prus
+# Copyright 2003-2004. Dave Abrahams
+# Copyright 2003-2006. Rene Rivera
 #
 # Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 # Performs various path manipulations. Paths are always in a 'normalized'
 # representation. In it, a path may be either:


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