|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79901 - trunk/tools/build/v2/build
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-07 06:38:41
Author: jurko
Date: 2012-08-07 06:38:38 EDT (Tue, 07 Aug 2012)
New Revision: 79901
URL: http://svn.boost.org/trac/boost/changeset/79901
Log:
Boost Build cleanup - minor stylistic changes.
Text files modified:
trunk/tools/build/v2/build/build-request.jam | 8 +++---
trunk/tools/build/v2/build/feature.jam | 51 +++++++++++++++++++++++++--------------
trunk/tools/build/v2/build/property.jam | 22 +++++++++-------
trunk/tools/build/v2/build/targets.jam | 13 +++++----
trunk/tools/build/v2/build/virtual-target.jam | 30 ++++++++++------------
5 files changed, 70 insertions(+), 54 deletions(-)
Modified: trunk/tools/build/v2/build/build-request.jam
==============================================================================
--- trunk/tools/build/v2/build/build-request.jam (original)
+++ trunk/tools/build/v2/build/build-request.jam 2012-08-07 06:38:38 EDT (Tue, 07 Aug 2012)
@@ -193,7 +193,7 @@
{
lresult = [ regex.split $(p) "," ] ;
}
-
+
if $(feature) && free in [ feature.attributes $(feature) ]
{
# If we have free feature, then the value is everything
@@ -206,7 +206,7 @@
lresult = <$(feature)>$(values) ;
parts = ;
}
-
+
if ! [ MATCH (.*-.*) : $(p) ]
{
# property.validate cannot handle subfeatures, so we avoid the check
@@ -225,7 +225,7 @@
{
result = $(result)/$(lresult) ;
}
-
+
parts = $(parts[2-]) ;
}
@@ -294,7 +294,7 @@
{
build-request.from-command-line bjam gcc/debug runtime-link=dynamic/static ;
}
- catch \"static\" is not a value of an implicit feature ;
+ catch \"static\" is not an implicit feature value ;
r = [ build-request.from-command-line bjam -d2 --debug debug target runtime-link=dynamic ] ;
assert.equal [ $(r).get-at 1 ] : target ;
Modified: trunk/tools/build/v2/build/feature.jam
==============================================================================
--- trunk/tools/build/v2/build/feature.jam (original)
+++ trunk/tools/build/v2/build/feature.jam 2012-08-07 06:38:38 EDT (Tue, 07 Aug 2012)
@@ -7,7 +7,6 @@
import assert : * ;
import "class" : * ;
-import errors : lol->list ;
import indirect ;
import modules ;
import regex ;
@@ -134,9 +133,10 @@
if $(error)
{
+ import errors ;
errors.error $(error)
: "in" feature declaration:
- : feature [ lol->list $(1) : $(2) : $(3) ] ;
+ : feature [ errors.lol->list $(1) : $(2) : $(3) ] ;
}
$(name).values ?= ;
@@ -174,12 +174,14 @@
}
if $(bad-attribute)
{
- errors.error "$(bad-attribute) property $(f) cannot have a default." ;
+ import errors ;
+ errors.error $(bad-attribute) property $(f) cannot have a default. ;
}
if ! $(value) in $($(f).values)
{
- errors.error "The specified default value, '$(value)' is invalid"
- : "allowed values are: " $($(f).values) ;
+ import errors ;
+ errors.error The specified default value, '$(value)' is invalid :
+ allowed values are: $($(f).values) ;
}
$(f).default = $(value) ;
}
@@ -267,11 +269,11 @@
rule implied-feature ( implicit-value )
{
local components = [ regex.split $(implicit-value) "-" ] ;
-
local feature = $($(components[1]).implicit-feature) ;
if ! $(feature)
{
- errors.error \"$(implicit-value)\" is not a value of an implicit feature ;
+ import errors ;
+ errors.error \"$(implicit-value)\" is not an implicit feature value ;
feature = "" ; # Keep testing happy; it expects a result.
}
return $(feature) ;
@@ -283,9 +285,9 @@
# Feature should be of the form <feature-name>.
if $(feature) != $(feature:G)
{
+ import errors ;
errors.error invalid feature $(feature) ;
}
-
return $($(feature)$(value-string:E="")<>$(subvalue).subfeature) ;
}
@@ -305,6 +307,7 @@
if ! $(subfeature)
{
value-string ?= "" ;
+ import errors ;
errors.error \"$(subvalue)\" is not a known subfeature value of
$(feature)$(value-string) ;
}
@@ -318,6 +321,7 @@
{
if ! $(feature) in $(.all-features)
{
+ import errors ;
errors.error unknown feature \"$(feature)\" ;
}
}
@@ -440,7 +444,9 @@
{
if $($(v).implicit-feature)
{
- errors.error $(v) is already associated with the \"$($(v).implicit-feature)\" feature ;
+ import errors ;
+ errors.error $(v) is already associated with the
+ \"$($(v).implicit-feature)\" feature ;
}
$(v).implicit-feature = $(feature) ;
}
@@ -470,8 +476,8 @@
if $($(feature).subfeatures)
{
- if ! ( $(value-string) in $($(feature).values) )
- && ! ( $(value-string) in $($(feature).subfeatures) )
+ if ! $(value-string) in $($(feature).values)
+ $($(feature).subfeatures)
{
values = [ regex.split $(value-string) - ] ;
}
@@ -482,8 +488,9 @@
# An empty value is allowed for optional features.
( $(values[1]) || ! ( optional in $($(feature).attributes) ) )
{
- errors.error \"$(values[1])\" is not a known value of feature $(feature)
- : legal values: \"$($(feature).values)\" ;
+ import errors ;
+ errors.error \"$(values[1])\" is not a known value of feature
+ $(feature) : legal values: \"$($(feature).values)\" ;
}
for local v in $(values[2-])
@@ -608,12 +615,12 @@
# value-string.
if $(value-string)
{
+ import errors ;
errors.error can only specify a property as the first argument when
extending a subfeature
: usage:
: " extend" feature ":" values...
- : " | extend" <feature>value-string subfeature ":" values...
- ;
+ : " | extend" <feature>value-string subfeature ":" values... ;
}
extend-feature $(feature) : $(values) ;
@@ -647,8 +654,9 @@
if $(subfeature-name) in $($(feature).subfeatures)
{
- errors.error \"$(subfeature)\" already declared as a subfeature of \"$(feature)\"
- "specific to "$(value-string) ;
+ import errors ;
+ errors.error \"$(subfeature)\" already declared as a subfeature of
+ \"$(feature)\" "specific to "$(value-string) ;
}
$(feature).subfeatures += $(subfeature-name) ;
@@ -668,18 +676,21 @@
local feature = $(composite-property:G) ;
if ! ( composite in [ attributes $(feature) ] )
{
+ import errors ;
errors.error "$(feature)" is not a composite feature ;
}
$(composite-property).components ?= ;
if $($(composite-property).components)
{
+ import errors ;
errors.error components of "$(composite-property)" already set:
$($(composite-property).components) ;
}
if $(composite-property) in $(component-properties)
{
+ import errors ;
errors.error composite property "$(composite-property)" cannot have itself as a component ;
}
$(composite-property).components = $(component-properties) ;
@@ -749,6 +760,7 @@
{
if $(f) in $(result:G)
{
+ import errors ;
errors.error expansions of composite features result
in conflicting values for $(f)
: values: [ get-values $(f) : $(result) ] $(x:G=)
@@ -762,6 +774,7 @@
}
else if $(f) in $(result:G)
{
+ import errors ;
errors.error explicitly-specified values of non-free feature
$(f) conflict :
"existing values:" [ get-values $(f) : $(properties) ] :
@@ -901,6 +914,7 @@
local implicits = [ set.intersection $(p:G=) : $(p:G) ] ;
if $(implicits)
{
+ import errors ;
errors.error minimize requires an expanded property set, but
\"$(implicits[1])\" appears to be the value of an un-expanded
implicit feature ;
@@ -1049,6 +1063,7 @@
{
if $(v) in $(properties)
{
+ import errors ;
errors.error add-defaults requires explicitly specified features,
but \"$(v)\" appears to be the value of an un-expanded implicit
feature ;
@@ -1317,7 +1332,7 @@
{
implied-feature lackluster ;
}
- catch \"lackluster\" is not a value of an implicit feature ;
+ catch \"lackluster\" is not an implicit feature value ;
try ;
{
Modified: trunk/tools/build/v2/build/property.jam
==============================================================================
--- trunk/tools/build/v2/build/property.jam (original)
+++ trunk/tools/build/v2/build/property.jam 2012-08-07 06:38:38 EDT (Tue, 07 Aug 2012)
@@ -2,9 +2,9 @@
# Copyright 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)
-import errors ;
import feature ;
import indirect ;
import path ;
@@ -137,23 +137,23 @@
{
fail = true ;
c = ;
- }
- }
+ }
+ }
else
{
if ! $(c) in $(context)
{
fail = true ;
c = ;
- }
+ }
}
condition = $(condition[2-]) ;
}
if ! $(fail)
{
result += $(s[2]) ;
- }
- }
+ }
+ }
}
return $(result) ;
}
@@ -325,6 +325,7 @@
}
if $(msg)
{
+ import errors ;
errors.error "Invalid property "'$(property:J=" ")'": "$(msg:J=" "). ;
}
}
@@ -367,6 +368,7 @@
}
else
{
+ import errors ;
errors.error "'$(e)' is not a valid property specification" ;
}
}
@@ -597,7 +599,6 @@
#
class property-map
{
- import errors ;
import numbers ;
import sequence ;
@@ -645,7 +646,8 @@
local best = [ sequence.select-highest-ranked $(matches)
: $(match-ranks) ] ;
if $(best[2])
- {
+ {
+ import errors : error : errors.error ;
errors.error "Ambiguous key $(properties:J= :E=)" ;
}
local original = $(self.value.$(best)) ;
@@ -744,7 +746,7 @@
try ;
validate value : $(test-space) ;
- catch "value" is not a value of an implicit feature ;
+ catch \"value\" is not an implicit feature value ;
assert.result-set-equal <rtti>on
: remove free implicit : <toolset>gcc <define>foo <rtti>on : $(test-space) ;
Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam (original)
+++ trunk/tools/build/v2/build/targets.jam 2012-08-07 06:38:38 EDT (Tue, 07 Aug 2012)
@@ -1,9 +1,8 @@
# Copyright Vladimir Prus 2002.
# Copyright Rene Rivera 2006.
-#
# 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)
# Supports 'abstract' targets, which are targets explicitly defined in a
# Jamfile.
@@ -1059,15 +1058,17 @@
# do.
#
build-request = [ $(build-request).add-defaults ] ;
- # Features added by 'add-default' can be composite and expand to features
- # without default values -- so they are not added yet. It could be clearer/
- # /faster to expand only newly added properties but that is not critical.
+ # Features added by 'add-defaults' can be composite and expand to features
+ # without default values -- which therefore have not been added yet. It
+ # could be clearer/faster to expand only newly added properties but that is
+ # not critical.
build-request = [ $(build-request).expand ] ;
return [ evaluate-requirements $(requirements) : $(build-request) :
refined ] ;
}
+
rule push-target ( target )
{
.targets = $(target) $(.targets) ;
Modified: trunk/tools/build/v2/build/virtual-target.jam
==============================================================================
--- trunk/tools/build/v2/build/virtual-target.jam (original)
+++ trunk/tools/build/v2/build/virtual-target.jam 2012-08-07 06:38:38 EDT (Tue, 07 Aug 2012)
@@ -2,7 +2,8 @@
# Copyright 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 virtual targets, which correspond to actual files created during a
# build, but are not yet targets in Jam sense. They are needed, for example,
@@ -977,22 +978,19 @@
{
result = $(t) ;
}
- else
- {
- if $(a1) && $(a2) &&
- ( [ $(a1).action-name ] = [ $(a2).action-name ] ) &&
- ( [ $(a1).sources ] = [ $(a2).sources ] )
+ else if $(a1) && $(a2) &&
+ ( [ $(a1).action-name ] = [ $(a2).action-name ] ) &&
+ ( [ $(a1).sources ] = [ $(a2).sources ] )
+ {
+ local ps1 = [ $(a1).properties ] ;
+ local ps2 = [ $(a2).properties ] ;
+ local p1 = [ $(ps1).base ] [ $(ps1).free ] [ set.difference
+ [ $(ps1).dependency ] : [ $(ps1).incidental ] ] ;
+ local p2 = [ $(ps2).base ] [ $(ps2).free ] [ set.difference
+ [ $(ps2).dependency ] : [ $(ps2).incidental ] ] ;
+ if $(p1) = $(p2)
{
- local ps1 = [ $(a1).properties ] ;
- local ps2 = [ $(a2).properties ] ;
- local p1 = [ $(ps1).base ] [ $(ps1).free ] [ set.difference
- [ $(ps1).dependency ] : [ $(ps1).incidental ] ] ;
- local p2 = [ $(ps2).base ] [ $(ps2).free ] [ set.difference
- [ $(ps2).dependency ] : [ $(ps2).incidental ] ] ;
- if $(p1) = $(p2)
- {
- result = $(t) ;
- }
+ result = $(t) ;
}
}
}
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