diff --git a/build-system.jam b/build-system.jam index 04e1cc978..cbe9e49dd 100755 --- a/build-system.jam +++ b/build-system.jam @@ -20,7 +20,7 @@ import feature ; import property-set ; import build-request ; import errors : error ; -import class : new ; +import class : xnew ; import builtin ; import make ; @@ -143,7 +143,7 @@ virtual-targets = ; if $(expanded) { - local dr-adjuster = [ new directly-requested-properties-adjuster ] ; + local dr-adjuster = [ xnew directly-requested-properties-adjuster ] ; for local p in $(expanded) { $(dr-adjuster).add-requested-property-set $(p) ; diff --git a/new/build-request.jam b/new/build-request.jam index 8eb26c683..8c0cdc10e 100644 --- a/new/build-request.jam +++ b/new/build-request.jam @@ -249,11 +249,17 @@ local rule convert-command-line-element ( e ) # # will cause a release version of 'b' to be compiled and linked into 'a'. The # release version will be compiled without "define=MACROS". -rule directly-requested-properties-adjuster -{ +xclass directly-requested-properties-adjuster +{ import property-set ; - self.empty-request-requirements = ; - self.all-requests = [ new property-map ] ; + import class : xnew ; + + rule __init__ ( ) + { + self.empty-request-requirements = ; + self.all-requests = [ xnew property-map ] ; + } + rule add-requested-property-set ( property-set ) { local base = [ $(property-set).base ] ; @@ -294,9 +300,6 @@ rule directly-requested-properties-adjuster } } -class directly-requested-properties-adjuster ; - - rule __test__ ( ) { import assert feature ; diff --git a/new/builtin.jam b/new/builtin.jam index d0884d215..363237b6c 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -317,12 +317,16 @@ actions quietly piecemeal response-file-2 } ##### -rule c-scanner ( includes * ) +xclass c-scanner : scanner { - scanner.__init__ ; + import regex virtual-target path scanner ; - import regex virtual-target path scanner ; - self.includes = $(includes) ; + rule __init__ ( includes * ) + { + scanner.__init__ ; + + self.includes = $(includes) ; + } rule pattern ( ) { @@ -370,7 +374,6 @@ rule c-scanner ( includes * ) } } -class c-scanner : scanner ; scanner.register c-scanner : include ; type.set-scanner CPP : c-scanner ; @@ -484,7 +487,6 @@ xclass searched-lib-generator : generator generators.register [ xnew searched-lib-generator ] ; - xclass compile-action : action { import sequence ; diff --git a/new/generators.jam b/new/generators.jam index daad224a5..6d3ae035d 100644 --- a/new/generators.jam +++ b/new/generators.jam @@ -252,7 +252,7 @@ xclass generator # - value to feature in properties rule clone ( new-id : new-toolset-name ) { - return [ new $(__class__) $(new-id) + return [ xnew $(__class__) $(new-id) : $(self.source-types) : $(self.target-types-and-names) : [ property.change $(self.requirements) diff --git a/new/project-root.jam b/new/project-root.jam index 026dd632b..dfbaa290c 100644 --- a/new/project-root.jam +++ b/new/project-root.jam @@ -88,25 +88,29 @@ rule print ( ) # Class encapsulating settings for a single project root. # -rule project-root-object ( - location # The root location. - ) +xclass project-root-object { import path ; - import set ; + import set ; + import sequence : insertion-sort ; - # The module name of the project-root. - self.module = project-root<$(location)> ; + rule __init__ ( + location # The root location. + ) + { + # The module name of the project-root. + self.module = project-root<$(location)> ; - # The location of the project-root, as a path. - self.location = $(location) ; + # The location of the project-root, as a path. + self.location = $(location) ; - # The set of projects registered in this project-root. - self.projects = ; - - # The set of interned constants for this project-root. - self.constants = ; + # The set of projects registered in this project-root. + self.projects = ; + # The set of interned constants for this project-root. + self.constants = ; + } + # Accessor, the module of the project root. rule get-module ( ) { @@ -204,6 +208,24 @@ rule project-root-object ( } } + # Needed to get deterministic order of output, which makes testing simpler + rule compare-projects ( p1 p2 ) + { + local id1 = [ project.attribute $(p1) id ] ; + local id2 = [ project.attribute $(p2) id ] ; + if $(id1) < $(id2) + { + return true ; + } + else + { + if $(id1) = $(id2) && $(p1) < $(p2) + { + return true ; + } + } + } + # Print out info about this project root. Calls print on the # individual projects in this project-root. # @@ -213,23 +235,6 @@ rule project-root-object ( import print ; import project ; - # Needed to get deterministic order of output, which makes testing simpler - local rule compare-projects ( p1 p2 ) - { - local id1 = [ project.attribute $(p1) id ] ; - local id2 = [ project.attribute $(p2) id ] ; - if $(id1) < $(id2) - { - return true ; - } - else - { - if $(id1) = $(id2) && $(p1) < $(p2) - { - return true ; - } - } - } print.section "'"$(self.location)"'" Module for project-root is "'"$(self.module)"'" ; if $(self.constants) @@ -246,7 +251,7 @@ rule project-root-object ( if $(self.projects) { print.section Projects ; - local projects = [ sequence.insertion-sort $(self.projects) : compare-projects ] ; + local projects = [ insertion-sort $(self.projects) : compare-projects ] ; for local p in $(projects) { local attributes = [ project.attributes $(p) ] ; @@ -255,7 +260,6 @@ rule project-root-object ( } } } -class.class project-root-object ; # Rules callable by the user in the context of the project-root.jam of a project. # diff --git a/new/project-roots.jam b/new/project-roots.jam index 2180404f3..6aa7379ed 100755 --- a/new/project-roots.jam +++ b/new/project-roots.jam @@ -43,7 +43,7 @@ rule load ( { # Create the project-root, and remember it. # - local root = [ class.new project-root-object $(location) ] ; + local root = [ class.xnew project-root-object $(location) ] ; modules.poke $(module-name) : .project-root : $(root) ; .roots += $(root) ; @@ -97,24 +97,30 @@ rule print ( ) # Class encapsulating settings for a single project root. # -rule project-root-object ( - location # The root location. - ) +xclass project-root-object { import path ; - import set ; + import set ; + import sequence ; + import print ; + import project ; + + rule __init__ ( + location # The root location. + ) + { + # The module name of the project-root. + self.module = project-root<$(location)> ; - # The module name of the project-root. - self.module = project-root<$(location)> ; + # The location of the project-root, as a path. + self.location = $(location) ; - # The location of the project-root, as a path. - self.location = $(location) ; + # The set of projects registered in this project-root. + self.projects = ; - # The set of projects registered in this project-root. - self.projects = ; - - # The set of interned constants for this project-root. - self.constants = ; + # The set of interned constants for this project-root. + self.constants = ; + } # Accessor, the module of the project root. rule get-module ( ) @@ -213,33 +219,30 @@ rule project-root-object ( } } + # Needed to get deterministic order of output, which makes testing simpler + local rule compare-projects ( p1 p2 ) + { + local id1 = [ project.attribute $(p1) id ] ; + local id2 = [ project.attribute $(p2) id ] ; + if $(id1) < $(id2) + { + return true ; + } + else + { + if $(id1) = $(id2) && $(p1) < $(p2) + { + return true ; + } + } + } + + # Print out info about this project root. Calls print on the # individual projects in this project-root. # rule print ( ) - { - import sequence ; - import print ; - import project ; - - # Needed to get deterministic order of output, which makes testing simpler - local rule compare-projects ( p1 p2 ) - { - local id1 = [ project.attribute $(p1) id ] ; - local id2 = [ project.attribute $(p2) id ] ; - if $(id1) < $(id2) - { - return true ; - } - else - { - if $(id1) = $(id2) && $(p1) < $(p2) - { - return true ; - } - } - } - + { print.section "'"$(self.location)"'" Module for project-root is "'"$(self.module)"'" ; if $(self.constants) { @@ -264,7 +267,6 @@ rule project-root-object ( } } } -class.class project-root-object ; # Rules callable by the user in the context of the project-root.jam of a project. # diff --git a/new/project.jam b/new/project.jam index 74af9a763..4fe4ba6d4 100644 --- a/new/project.jam +++ b/new/project.jam @@ -301,7 +301,7 @@ rule initialize ( module $(module-name) { } - $(module-name).attributes = [ new project-attributes $(location) ] ; + $(module-name).attributes = [ xnew project-attributes $(location) ] ; local attributes = $($(module-name).attributes) ; $(attributes).set source-location : $(location) : exact ; @@ -381,20 +381,25 @@ rule register-id ( id : module ) # # The standard attributes are "id", "location", "project-root", "parent" # "requirements", "default-build", "source-location" and "projects-to-build". -rule project-attributes ( location ) +xclass project-attributes { import property ; import property-set ; import errors ; import path ; - - self.location = $(location) ; - + import print ; + import sequence ; + + rule __init__ ( location ) + { + self.location = $(location) ; + } + # Set the named attribute from the specification given by the user. # The value actually set may be different. rule set ( attribute : specification * - : exact ? # Sets value from 'specification' without any processing - ) + : exact ? # Sets value from 'specification' without any processing + ) { if $(exact) { @@ -487,9 +492,6 @@ rule project-attributes ( location ) # Prints the project attributes. rule print ( ) { - import sequence ; - import print ; - local id = $(self.id) ; id ?= (none) ; local parent = $(self.parent) ; parent ?= (none) ; print.section "'"$(id)"'" ; @@ -505,8 +507,6 @@ rule project-attributes ( location ) } -class project-attributes ; - # Returns the project-attribute instance for the specified jamfile module. rule attributes ( project ) { diff --git a/new/property-set.jam b/new/property-set.jam index 4f85c049b..91495a122 100644 --- a/new/property-set.jam +++ b/new/property-set.jam @@ -3,7 +3,7 @@ # all copies. This software is provided "as is" without express or implied # warranty, and with no claim as to its suitability for any purpose. -import class : class new ; +import class : class xnew ; import feature ; import property ; import sequence ; @@ -20,43 +20,47 @@ import sequence ; # - several operations, like and refine and as-path are provided. They all use # caching whenever possible. # -local rule property-set ( raw-properties * ) +xclass property-set { import feature ; import property-set ; import property ; - - self.raw = $(raw-properties) ; - - for local p in $(raw-properties) - { - local att = [ feature.attributes $(p:G) ] ; - if incidental in $(att) - { - self.incidental += $(p) ; - } - else if free in $(att) - { - if dependency in $(att) - { - self.dependency += $(p) ; - } - else - { - self.free += $(p) ; - } - } - else - { - self.base += $(p) ; - } + + rule __init__ ( raw-properties * ) + { + self.raw = $(raw-properties) ; - if propagated in $(att) + for local p in $(raw-properties) { - self.propagated += $(p) ; - } + local att = [ feature.attributes $(p:G) ] ; + if incidental in $(att) + { + self.incidental += $(p) ; + } + else if free in $(att) + { + if dependency in $(att) + { + self.dependency += $(p) ; + } + else + { + self.free += $(p) ; + } + } + else + { + self.base += $(p) ; + } + + if propagated in $(att) + { + self.propagated += $(p) ; + } + } } + # Returns Jam list of stored properties rule raw ( ) { @@ -187,8 +191,6 @@ local rule property-set ( raw-properties * ) } -class property-set ; - # Creates new 'property-set' instance for the given raw properties, # or returns an already existing ones. rule create ( raw-properties * ) @@ -200,7 +202,7 @@ rule create ( raw-properties * ) if ! $(.ps.$(key)) { - .ps.$(key) = [ new property-set $(raw-properties) ] ; + .ps.$(key) = [ xnew property-set $(raw-properties) ] ; } return $(.ps.$(key)) ; } diff --git a/new/property.jam b/new/property.jam index 602218888..7c2f04869 100644 --- a/new/property.jam +++ b/new/property.jam @@ -386,14 +386,17 @@ rule translate-paths ( properties * : path ) # Class which maintains a property set -> string # mapping -rule property-map ( ) +xclass property-map { import numbers ; import sequence ; import errors : error ; - self.next-flag = 1 ; - + rule __init__ ( ) + { + self.next-flag = 1 ; + } + # Associate 'value' with 'properties' rule insert ( properties + : value ) { @@ -445,9 +448,6 @@ rule property-map ( ) } } -class property-map ; - - local rule __test__ ( ) { import errors : try catch ; @@ -472,7 +472,7 @@ local rule __test__ ( ) compose release : NDEBUG on ; import assert ; - import class : new ; + import class : xnew ; validate gcc gcc-3.0.1 : $(test-space) ; validate gcc gcc-3.0.1 : $(test-space) ; @@ -559,7 +559,7 @@ local rule __test__ ( ) assert.result kylix a : change gcc a : toolset kylix ; - pm = [ new property-map ] ; + pm = [ xnew property-map ] ; $(pm).insert gcc : o ; $(pm).insert gcc NT : obj ; $(pm).insert gcc CYGWIN : obj ; diff --git a/new/scanner.jam b/new/scanner.jam index ea04c17d7..6f8cc006b 100644 --- a/new/scanner.jam +++ b/new/scanner.jam @@ -26,12 +26,16 @@ # actual targets. However, actions can also create scanners in a special # way, instead of relying on just target type. -import class : class new ; +import class : class xnew ; import property virtual-target ; # Base scanner class. -rule scanner ( ) +xclass scanner { + rule __init__ ( ) + { + } + # Returns a pattern to use for scanning rule pattern ( ) { @@ -47,8 +51,6 @@ rule scanner ( ) } } -class scanner ; - # Registers a new generator class, specifying a set of # properties relevant to this scanner. Ctor for that class # should have one parameter: list of properties. @@ -74,7 +76,7 @@ rule get ( scanner-class : properties * ) } if ! $(scanner.$(scanner-class).$(r:J=-)) { - scanner.$(scanner-class).$(r:J=-) = [ new $(scanner-class) $(r) ] ; + scanner.$(scanner-class).$(r:J=-) = [ xnew $(scanner-class) $(r) ] ; } return $(scanner.$(scanner-class).$(r:J=-)) ; } diff --git a/new/targets.jam b/new/targets.jam index c591d695d..b083d41f0 100644 --- a/new/targets.jam +++ b/new/targets.jam @@ -983,7 +983,7 @@ xclass basic-target : abstract-target # is created. local all-targets = [ sequence.transform virtual-target.traverse : $(targets) ] ; - local dg = [ new subvariant-dg $(__name__) : $(build-request) + local dg = [ xnew subvariant-dg $(__name__) : $(build-request) : $(rproperties) : $(all-targets) ] ; for local v in $(all-targets) { diff --git a/new/testing.jam b/new/testing.jam index fcb83e4db..b72ecdd2b 100644 --- a/new/testing.jam +++ b/new/testing.jam @@ -15,8 +15,8 @@ import toolset ; # lanch test programs. feature.feature testing.launcher : : optional free ; -xclass unit-test-target-class : basic-target -{ +xclass unit-test-target-class : typed-target +{ rule __init__ ( name : project : sources * : requirements * : default-build * ) { @@ -40,8 +40,6 @@ xclass unit-test-target-class : basic-target } } -class unit-test-target-class : typed-target ; - toolset.flags testing.run LAUNCHER ; diff --git a/new/type.jam b/new/type.jam index 1c54cc665..721cef837 100644 --- a/new/type.jam +++ b/new/type.jam @@ -28,7 +28,7 @@ feature.feature base-target-type : : composite optional free ; # feature.feature main-target-type : : composite optional incidental ; # Store suffixes for generated targets -.suffixes = [ new property-map ] ; +.suffixes = [ xnew property-map ] ; # Registers a target type, possible derived from a 'base-type'. # If 'suffixes' are provided, they given all the suffixes that mean a file is of 'type'. diff --git a/new/utility.jam b/new/utility.jam index 0fd45e847..f50abecf5 100644 --- a/new/utility.jam +++ b/new/utility.jam @@ -99,13 +99,17 @@ rule apply-default-suffix ( suffix : list * ) local rule __test__ ( ) { import assert ; - import class : class new ; + import class : xnew ; assert.result foo bar : ungrist ; assert.result 123 : str 123 ; - local rule test-class__ ( ) + xclass test-class__ { + rule __init__ ( ) + { + } + rule str ( ) { return "str-test-class" ; @@ -121,15 +125,14 @@ local rule __test__ ( ) return "not sure" ; } } - class test-class__ ; - assert.result "str-test-class" : str [ new test-class__ ] ; + assert.result "str-test-class" : str [ xnew test-class__ ] ; assert.true less 1 2 ; assert.false less 2 1 ; - assert.result "yes, of course!" : less [ new test-class__ ] 1 ; + assert.result "yes, of course!" : less [ xnew test-class__ ] 1 ; assert.true equal 1 1 ; assert.false equal 1 2 ; - assert.result "not sure" : equal [ new test-class__ ] 1 ; + assert.result "not sure" : equal [ xnew test-class__ ] 1 ; assert.result foo.lib foo.a : apply-default-suffix .lib : foo foo.a ; } diff --git a/new/virtual-target.jam b/new/virtual-target.jam index fe54c9b32..3085b5f8d 100644 --- a/new/virtual-target.jam +++ b/new/virtual-target.jam @@ -921,42 +921,46 @@ local rule clone-action-template ( action from cloned-from : new-source ) return $(cloned) ; } -local rule subvariant-dg ( main-target # The instance of main-target class - : property-set # Properties requested for this target - : actual-properties # Actual used properties - : virtual-targets * ) +xclass subvariant-dg { - import sequence ; + import sequence ; - self.main-target = $(main-target) ; - self.properties = $(property-set) ; - self.actual-properties = $(actual-properties) ; - self.virtual-targets = $(virtual-targets) ; + rule __init__ ( main-target # The instance of main-target class + : property-set # Properties requested for this target + : actual-properties # Actual used properties + : virtual-targets * ) + { + self.main-target = $(main-target) ; + self.properties = $(property-set) ; + self.actual-properties = $(actual-properties) ; + self.virtual-targets = $(virtual-targets) ; - # Pre-compose the list of other dependency graphs, on which this one - # depends - local deps = [ $(actual-properties).dependency ] ; - for local d in $(deps) - { - self.other-dg += [ $(d:G=).dg ] ; - } - - for local t in $(virtual-targets) - { - local a = [ $(t).action ] ; - if $(a) + # Pre-compose the list of other dependency graphs, on which this one + # depends + local deps = [ $(actual-properties).dependency ] ; + for local d in $(deps) { - for local s in [ $(a).sources ] + self.other-dg += [ $(d:G=).dg ] ; + } + + for local t in $(virtual-targets) + { + local a = [ $(t).action ] ; + if $(a) { - if [ $(s).root ] + for local s in [ $(a).sources ] { - self.other-dg += [ $(s).dg ] ; + if [ $(s).root ] + { + self.other-dg += [ $(s).dg ] ; + } } } } - } - self.other-dg = [ sequence.unique $(self.other-dg) ] ; + self.other-dg = [ sequence.unique $(self.other-dg) ] ; + } + rule main-target ( ) { @@ -992,5 +996,3 @@ local rule subvariant-dg ( main-target # The instance of main-target class } } -class subvariant-dg ; - diff --git a/tools/boostbook.jam b/tools/boostbook.jam index 430d26192..4417e11d3 100644 --- a/tools/boostbook.jam +++ b/tools/boostbook.jam @@ -165,13 +165,16 @@ rule docbook-to-fo ( target : source : properties * ) xslt $(target) : $(source) $(stylesheet) : $(properties) ; } -rule xml-catalog-action ( target : property-set ? : catalog-entries * ) +xclass xml-catalog-action : action { - import boostbook ; - import print ; - - action.__init__ $(target) : : generate-xml-catalog : $(property-set) ; + import boostbook ; + import print ; + rule __init__ ( target : property-set ? : catalog-entries * ) + { + action.__init__ $(target) : : generate-xml-catalog : $(property-set) ; + } + rule actualize ( ) { if ! $(self.actualized) @@ -230,24 +233,26 @@ rule xml-catalog-action ( target : property-set ? : catalog-entries * ) } } -class xml-catalog-action : action ; - -rule boostbook-target-class ( name : project : sources * : requirements * - : default-build * : catalog-entries * ) +xclass boostbook-target-class : basic-target { - import feature ; - import virtual-target ; - import generators ; - - basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) - : $(default-build) ; - self.catalog-entries = $(catalog-entries) ; + import feature ; + import virtual-target ; + import generators ; + + rule __init__ ( name : project : sources * : requirements * + : default-build * : catalog-entries * ) + { + basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) + : $(default-build) ; + self.catalog-entries = $(catalog-entries) ; + } + rule construct ( source-targets * : property-set ) { local path = [ project.attribute $(self.project) location ] ; - local catalog = [ new file-target catalog : XML : $(self.project) ] ; - $(catalog).action [ new xml-catalog-action $(catalog) : $(property-set) + local catalog = [ xnew file-target catalog : XML : $(self.project) ] ; + $(catalog).action [ xnew xml-catalog-action $(catalog) : $(property-set) : $(self.catalog-entries) ] ; $(catalog).set-path $(path) ; @@ -313,14 +318,12 @@ rule boostbook-target-class ( name : project : sources * : requirements * } } -class boostbook-target-class : basic-target ; - rule boostbook ( target-name : sources * : requirements * : default-build * ) { local project = [ CALLER_MODULE ] ; targets.main-target-alternative - [ new boostbook-target-class $(target-name) : $(project) + [ xnew boostbook-target-class $(target-name) : $(project) : [ targets.main-target-sources $(sources) : $(target-name) ] : [ targets.main-target-requirements $(requirements) : $(project) ] : [ targets.main-target-default-build $(default-build) : $(project) ] diff --git a/tools/doxygen.jam b/tools/doxygen.jam index 5c22d579b..d16ffc2b9 100644 --- a/tools/doxygen.jam +++ b/tools/doxygen.jam @@ -9,7 +9,7 @@ # version of Doxygen that can output a single XML file instead of a # set of XML files. -import class : class new ; +import class : xnew ; import targets ; import feature ; import property ; @@ -90,17 +90,21 @@ rule xml-to-boostbook ( target : source : properties * ) ; } -rule doxygen-xml-target-class ( name : project : sources * : requirements * - : default-build * ) +xclass doxygen-xml-target-class : basic-target { - basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) - : $(default-build) ; + rule __init__ ( name : project : sources * : requirements * + : default-build * ) + { + basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) + : $(default-build) ; + } + rule construct ( source-targets * : property-set ) { local target = - [ new file-target $(self.name) : DOXYGEN_XML : $(self.project) ] ; - local a = [ new action $(target) : $(source-targets) : doxygen.extract-xml + [ xnew file-target $(self.name) : DOXYGEN_XML : $(self.project) ] ; + local a = [ xnew action $(target) : $(source-targets) : doxygen.extract-xml : $(property-set) ] ; $(target).action $(a) ; @@ -108,13 +112,11 @@ rule doxygen-xml-target-class ( name : project : sources * : requirements * } } -class doxygen-xml-target-class : basic-target ; - rule doxygen ( target-name : sources * : requirements * : default-build * ) { local project = [ CALLER_MODULE ] ; targets.main-target-alternative - [ new doxygen-xml-target-class $(target-name) : $(project) : $(sources) + [ xnew doxygen-xml-target-class $(target-name) : $(project) : $(sources) : [ targets.main-target-requirements $(requirements) : $(project) ] : [ targets.main-target-default-build $(default-build) : $(project) ] ] ; diff --git a/tools/gettext.jam b/tools/gettext.jam index f730ba555..3a13555b4 100644 --- a/tools/gettext.jam +++ b/tools/gettext.jam @@ -47,7 +47,7 @@ import targets ; import property-set ; import virtual-target ; -import class : class new ; +import class : class xnew ; import project ; import type ; import generators ; @@ -89,7 +89,7 @@ rule update ( name : existing-translation sources + : requirements * ) local project = [ CALLER_MODULE ] ; targets.main-target-alternative - [ new update-translations-class $(name) : $(project) : + [ xnew update-translations-class $(name) : $(project) : $(existing-translation) $(sources) : [ targets.main-target-requirements $(requirements) : $(project) ] ] ; @@ -115,13 +115,16 @@ feature gettext.types : : free ; generators.register-standard gettext.compile : gettext.PO : gettext.catalog ; -rule update-translations-class ( name : project : sources * : requirements ) +xclass update-translations-class : basic-target { - basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) - : $(default-build) ; - - IMPORT gettext : regex.split : $(__name__) : regex.split ; - + import regex : split ; + + rule __init__ ( name : project : sources * : requirements ) + { + basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) + : $(default-build) ; + } + rule construct ( source-targets * : property-set ) { local types = [ $(property-set).get ] ; @@ -149,13 +152,13 @@ rule update-translations-class ( name : project : sources * : requirements ) if $(right-sources) { - local new-messages = [ new file-target $(self.name) : gettext.POT : $(self.project) ] ; + local new-messages = [ xnew file-target $(self.name) : gettext.POT : $(self.project) ] ; local extract = - [ new action $(new-messages) : $(right-sources) : gettext.extract ] ; + [ xnew action $(new-messages) : $(right-sources) : gettext.extract ] ; $(new-messages).action $(extract) ; - local r = [ new notfile-target $(self.name) : $(self.project) ] ; - local a = [ new action $(r) : $(source-targets[1]) $(new-messages) + local r = [ xnew notfile-target $(self.name) : $(self.project) ] ; + local a = [ xnew action $(r) : $(source-targets[1]) $(new-messages) : gettext.update-po-dispatch ] ; $(r).action $(a) ; .constructed = [ virtual-target.register $(r) ] ; @@ -172,7 +175,6 @@ rule update-translations-class ( name : project : sources * : requirements ) { } } -class update-translations-class : basic-target ; flags gettext.extract KEYWORD ; actions extract diff --git a/v2/build-system.jam b/v2/build-system.jam index 04e1cc978..cbe9e49dd 100755 --- a/v2/build-system.jam +++ b/v2/build-system.jam @@ -20,7 +20,7 @@ import feature ; import property-set ; import build-request ; import errors : error ; -import class : new ; +import class : xnew ; import builtin ; import make ; @@ -143,7 +143,7 @@ virtual-targets = ; if $(expanded) { - local dr-adjuster = [ new directly-requested-properties-adjuster ] ; + local dr-adjuster = [ xnew directly-requested-properties-adjuster ] ; for local p in $(expanded) { $(dr-adjuster).add-requested-property-set $(p) ; diff --git a/v2/build/build-request.jam b/v2/build/build-request.jam index 8eb26c683..8c0cdc10e 100644 --- a/v2/build/build-request.jam +++ b/v2/build/build-request.jam @@ -249,11 +249,17 @@ local rule convert-command-line-element ( e ) # # will cause a release version of 'b' to be compiled and linked into 'a'. The # release version will be compiled without "define=MACROS". -rule directly-requested-properties-adjuster -{ +xclass directly-requested-properties-adjuster +{ import property-set ; - self.empty-request-requirements = ; - self.all-requests = [ new property-map ] ; + import class : xnew ; + + rule __init__ ( ) + { + self.empty-request-requirements = ; + self.all-requests = [ xnew property-map ] ; + } + rule add-requested-property-set ( property-set ) { local base = [ $(property-set).base ] ; @@ -294,9 +300,6 @@ rule directly-requested-properties-adjuster } } -class directly-requested-properties-adjuster ; - - rule __test__ ( ) { import assert feature ; diff --git a/v2/build/generators.jam b/v2/build/generators.jam index daad224a5..6d3ae035d 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -252,7 +252,7 @@ xclass generator # - value to feature in properties rule clone ( new-id : new-toolset-name ) { - return [ new $(__class__) $(new-id) + return [ xnew $(__class__) $(new-id) : $(self.source-types) : $(self.target-types-and-names) : [ property.change $(self.requirements) diff --git a/v2/build/project-roots.jam b/v2/build/project-roots.jam index 2180404f3..6aa7379ed 100755 --- a/v2/build/project-roots.jam +++ b/v2/build/project-roots.jam @@ -43,7 +43,7 @@ rule load ( { # Create the project-root, and remember it. # - local root = [ class.new project-root-object $(location) ] ; + local root = [ class.xnew project-root-object $(location) ] ; modules.poke $(module-name) : .project-root : $(root) ; .roots += $(root) ; @@ -97,24 +97,30 @@ rule print ( ) # Class encapsulating settings for a single project root. # -rule project-root-object ( - location # The root location. - ) +xclass project-root-object { import path ; - import set ; + import set ; + import sequence ; + import print ; + import project ; + + rule __init__ ( + location # The root location. + ) + { + # The module name of the project-root. + self.module = project-root<$(location)> ; - # The module name of the project-root. - self.module = project-root<$(location)> ; + # The location of the project-root, as a path. + self.location = $(location) ; - # The location of the project-root, as a path. - self.location = $(location) ; + # The set of projects registered in this project-root. + self.projects = ; - # The set of projects registered in this project-root. - self.projects = ; - - # The set of interned constants for this project-root. - self.constants = ; + # The set of interned constants for this project-root. + self.constants = ; + } # Accessor, the module of the project root. rule get-module ( ) @@ -213,33 +219,30 @@ rule project-root-object ( } } + # Needed to get deterministic order of output, which makes testing simpler + local rule compare-projects ( p1 p2 ) + { + local id1 = [ project.attribute $(p1) id ] ; + local id2 = [ project.attribute $(p2) id ] ; + if $(id1) < $(id2) + { + return true ; + } + else + { + if $(id1) = $(id2) && $(p1) < $(p2) + { + return true ; + } + } + } + + # Print out info about this project root. Calls print on the # individual projects in this project-root. # rule print ( ) - { - import sequence ; - import print ; - import project ; - - # Needed to get deterministic order of output, which makes testing simpler - local rule compare-projects ( p1 p2 ) - { - local id1 = [ project.attribute $(p1) id ] ; - local id2 = [ project.attribute $(p2) id ] ; - if $(id1) < $(id2) - { - return true ; - } - else - { - if $(id1) = $(id2) && $(p1) < $(p2) - { - return true ; - } - } - } - + { print.section "'"$(self.location)"'" Module for project-root is "'"$(self.module)"'" ; if $(self.constants) { @@ -264,7 +267,6 @@ rule project-root-object ( } } } -class.class project-root-object ; # Rules callable by the user in the context of the project-root.jam of a project. # diff --git a/v2/build/project.jam b/v2/build/project.jam index 74af9a763..4fe4ba6d4 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -301,7 +301,7 @@ rule initialize ( module $(module-name) { } - $(module-name).attributes = [ new project-attributes $(location) ] ; + $(module-name).attributes = [ xnew project-attributes $(location) ] ; local attributes = $($(module-name).attributes) ; $(attributes).set source-location : $(location) : exact ; @@ -381,20 +381,25 @@ rule register-id ( id : module ) # # The standard attributes are "id", "location", "project-root", "parent" # "requirements", "default-build", "source-location" and "projects-to-build". -rule project-attributes ( location ) +xclass project-attributes { import property ; import property-set ; import errors ; import path ; - - self.location = $(location) ; - + import print ; + import sequence ; + + rule __init__ ( location ) + { + self.location = $(location) ; + } + # Set the named attribute from the specification given by the user. # The value actually set may be different. rule set ( attribute : specification * - : exact ? # Sets value from 'specification' without any processing - ) + : exact ? # Sets value from 'specification' without any processing + ) { if $(exact) { @@ -487,9 +492,6 @@ rule project-attributes ( location ) # Prints the project attributes. rule print ( ) { - import sequence ; - import print ; - local id = $(self.id) ; id ?= (none) ; local parent = $(self.parent) ; parent ?= (none) ; print.section "'"$(id)"'" ; @@ -505,8 +507,6 @@ rule project-attributes ( location ) } -class project-attributes ; - # Returns the project-attribute instance for the specified jamfile module. rule attributes ( project ) { diff --git a/v2/build/property-set.jam b/v2/build/property-set.jam index 4f85c049b..91495a122 100644 --- a/v2/build/property-set.jam +++ b/v2/build/property-set.jam @@ -3,7 +3,7 @@ # all copies. This software is provided "as is" without express or implied # warranty, and with no claim as to its suitability for any purpose. -import class : class new ; +import class : class xnew ; import feature ; import property ; import sequence ; @@ -20,43 +20,47 @@ import sequence ; # - several operations, like and refine and as-path are provided. They all use # caching whenever possible. # -local rule property-set ( raw-properties * ) +xclass property-set { import feature ; import property-set ; import property ; - - self.raw = $(raw-properties) ; - - for local p in $(raw-properties) - { - local att = [ feature.attributes $(p:G) ] ; - if incidental in $(att) - { - self.incidental += $(p) ; - } - else if free in $(att) - { - if dependency in $(att) - { - self.dependency += $(p) ; - } - else - { - self.free += $(p) ; - } - } - else - { - self.base += $(p) ; - } + + rule __init__ ( raw-properties * ) + { + self.raw = $(raw-properties) ; - if propagated in $(att) + for local p in $(raw-properties) { - self.propagated += $(p) ; - } + local att = [ feature.attributes $(p:G) ] ; + if incidental in $(att) + { + self.incidental += $(p) ; + } + else if free in $(att) + { + if dependency in $(att) + { + self.dependency += $(p) ; + } + else + { + self.free += $(p) ; + } + } + else + { + self.base += $(p) ; + } + + if propagated in $(att) + { + self.propagated += $(p) ; + } + } } + # Returns Jam list of stored properties rule raw ( ) { @@ -187,8 +191,6 @@ local rule property-set ( raw-properties * ) } -class property-set ; - # Creates new 'property-set' instance for the given raw properties, # or returns an already existing ones. rule create ( raw-properties * ) @@ -200,7 +202,7 @@ rule create ( raw-properties * ) if ! $(.ps.$(key)) { - .ps.$(key) = [ new property-set $(raw-properties) ] ; + .ps.$(key) = [ xnew property-set $(raw-properties) ] ; } return $(.ps.$(key)) ; } diff --git a/v2/build/property.jam b/v2/build/property.jam index 602218888..7c2f04869 100644 --- a/v2/build/property.jam +++ b/v2/build/property.jam @@ -386,14 +386,17 @@ rule translate-paths ( properties * : path ) # Class which maintains a property set -> string # mapping -rule property-map ( ) +xclass property-map { import numbers ; import sequence ; import errors : error ; - self.next-flag = 1 ; - + rule __init__ ( ) + { + self.next-flag = 1 ; + } + # Associate 'value' with 'properties' rule insert ( properties + : value ) { @@ -445,9 +448,6 @@ rule property-map ( ) } } -class property-map ; - - local rule __test__ ( ) { import errors : try catch ; @@ -472,7 +472,7 @@ local rule __test__ ( ) compose release : NDEBUG on ; import assert ; - import class : new ; + import class : xnew ; validate gcc gcc-3.0.1 : $(test-space) ; validate gcc gcc-3.0.1 : $(test-space) ; @@ -559,7 +559,7 @@ local rule __test__ ( ) assert.result kylix a : change gcc a : toolset kylix ; - pm = [ new property-map ] ; + pm = [ xnew property-map ] ; $(pm).insert gcc : o ; $(pm).insert gcc NT : obj ; $(pm).insert gcc CYGWIN : obj ; diff --git a/v2/build/scanner.jam b/v2/build/scanner.jam index ea04c17d7..6f8cc006b 100644 --- a/v2/build/scanner.jam +++ b/v2/build/scanner.jam @@ -26,12 +26,16 @@ # actual targets. However, actions can also create scanners in a special # way, instead of relying on just target type. -import class : class new ; +import class : class xnew ; import property virtual-target ; # Base scanner class. -rule scanner ( ) +xclass scanner { + rule __init__ ( ) + { + } + # Returns a pattern to use for scanning rule pattern ( ) { @@ -47,8 +51,6 @@ rule scanner ( ) } } -class scanner ; - # Registers a new generator class, specifying a set of # properties relevant to this scanner. Ctor for that class # should have one parameter: list of properties. @@ -74,7 +76,7 @@ rule get ( scanner-class : properties * ) } if ! $(scanner.$(scanner-class).$(r:J=-)) { - scanner.$(scanner-class).$(r:J=-) = [ new $(scanner-class) $(r) ] ; + scanner.$(scanner-class).$(r:J=-) = [ xnew $(scanner-class) $(r) ] ; } return $(scanner.$(scanner-class).$(r:J=-)) ; } diff --git a/v2/build/targets.jam b/v2/build/targets.jam index c591d695d..b083d41f0 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -983,7 +983,7 @@ xclass basic-target : abstract-target # is created. local all-targets = [ sequence.transform virtual-target.traverse : $(targets) ] ; - local dg = [ new subvariant-dg $(__name__) : $(build-request) + local dg = [ xnew subvariant-dg $(__name__) : $(build-request) : $(rproperties) : $(all-targets) ] ; for local v in $(all-targets) { diff --git a/v2/build/type.jam b/v2/build/type.jam index 1c54cc665..721cef837 100644 --- a/v2/build/type.jam +++ b/v2/build/type.jam @@ -28,7 +28,7 @@ feature.feature base-target-type : : composite optional free ; # feature.feature main-target-type : : composite optional incidental ; # Store suffixes for generated targets -.suffixes = [ new property-map ] ; +.suffixes = [ xnew property-map ] ; # Registers a target type, possible derived from a 'base-type'. # If 'suffixes' are provided, they given all the suffixes that mean a file is of 'type'. diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index fe54c9b32..3085b5f8d 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -921,42 +921,46 @@ local rule clone-action-template ( action from cloned-from : new-source ) return $(cloned) ; } -local rule subvariant-dg ( main-target # The instance of main-target class - : property-set # Properties requested for this target - : actual-properties # Actual used properties - : virtual-targets * ) +xclass subvariant-dg { - import sequence ; + import sequence ; - self.main-target = $(main-target) ; - self.properties = $(property-set) ; - self.actual-properties = $(actual-properties) ; - self.virtual-targets = $(virtual-targets) ; + rule __init__ ( main-target # The instance of main-target class + : property-set # Properties requested for this target + : actual-properties # Actual used properties + : virtual-targets * ) + { + self.main-target = $(main-target) ; + self.properties = $(property-set) ; + self.actual-properties = $(actual-properties) ; + self.virtual-targets = $(virtual-targets) ; - # Pre-compose the list of other dependency graphs, on which this one - # depends - local deps = [ $(actual-properties).dependency ] ; - for local d in $(deps) - { - self.other-dg += [ $(d:G=).dg ] ; - } - - for local t in $(virtual-targets) - { - local a = [ $(t).action ] ; - if $(a) + # Pre-compose the list of other dependency graphs, on which this one + # depends + local deps = [ $(actual-properties).dependency ] ; + for local d in $(deps) { - for local s in [ $(a).sources ] + self.other-dg += [ $(d:G=).dg ] ; + } + + for local t in $(virtual-targets) + { + local a = [ $(t).action ] ; + if $(a) { - if [ $(s).root ] + for local s in [ $(a).sources ] { - self.other-dg += [ $(s).dg ] ; + if [ $(s).root ] + { + self.other-dg += [ $(s).dg ] ; + } } } } - } - self.other-dg = [ sequence.unique $(self.other-dg) ] ; + self.other-dg = [ sequence.unique $(self.other-dg) ] ; + } + rule main-target ( ) { @@ -992,5 +996,3 @@ local rule subvariant-dg ( main-target # The instance of main-target class } } -class subvariant-dg ; - diff --git a/v2/project-root.jam b/v2/project-root.jam index 026dd632b..dfbaa290c 100644 --- a/v2/project-root.jam +++ b/v2/project-root.jam @@ -88,25 +88,29 @@ rule print ( ) # Class encapsulating settings for a single project root. # -rule project-root-object ( - location # The root location. - ) +xclass project-root-object { import path ; - import set ; + import set ; + import sequence : insertion-sort ; - # The module name of the project-root. - self.module = project-root<$(location)> ; + rule __init__ ( + location # The root location. + ) + { + # The module name of the project-root. + self.module = project-root<$(location)> ; - # The location of the project-root, as a path. - self.location = $(location) ; + # The location of the project-root, as a path. + self.location = $(location) ; - # The set of projects registered in this project-root. - self.projects = ; - - # The set of interned constants for this project-root. - self.constants = ; + # The set of projects registered in this project-root. + self.projects = ; + # The set of interned constants for this project-root. + self.constants = ; + } + # Accessor, the module of the project root. rule get-module ( ) { @@ -204,6 +208,24 @@ rule project-root-object ( } } + # Needed to get deterministic order of output, which makes testing simpler + rule compare-projects ( p1 p2 ) + { + local id1 = [ project.attribute $(p1) id ] ; + local id2 = [ project.attribute $(p2) id ] ; + if $(id1) < $(id2) + { + return true ; + } + else + { + if $(id1) = $(id2) && $(p1) < $(p2) + { + return true ; + } + } + } + # Print out info about this project root. Calls print on the # individual projects in this project-root. # @@ -213,23 +235,6 @@ rule project-root-object ( import print ; import project ; - # Needed to get deterministic order of output, which makes testing simpler - local rule compare-projects ( p1 p2 ) - { - local id1 = [ project.attribute $(p1) id ] ; - local id2 = [ project.attribute $(p2) id ] ; - if $(id1) < $(id2) - { - return true ; - } - else - { - if $(id1) = $(id2) && $(p1) < $(p2) - { - return true ; - } - } - } print.section "'"$(self.location)"'" Module for project-root is "'"$(self.module)"'" ; if $(self.constants) @@ -246,7 +251,7 @@ rule project-root-object ( if $(self.projects) { print.section Projects ; - local projects = [ sequence.insertion-sort $(self.projects) : compare-projects ] ; + local projects = [ insertion-sort $(self.projects) : compare-projects ] ; for local p in $(projects) { local attributes = [ project.attributes $(p) ] ; @@ -255,7 +260,6 @@ rule project-root-object ( } } } -class.class project-root-object ; # Rules callable by the user in the context of the project-root.jam of a project. # diff --git a/v2/tools/boostbook.jam b/v2/tools/boostbook.jam index 430d26192..4417e11d3 100644 --- a/v2/tools/boostbook.jam +++ b/v2/tools/boostbook.jam @@ -165,13 +165,16 @@ rule docbook-to-fo ( target : source : properties * ) xslt $(target) : $(source) $(stylesheet) : $(properties) ; } -rule xml-catalog-action ( target : property-set ? : catalog-entries * ) +xclass xml-catalog-action : action { - import boostbook ; - import print ; - - action.__init__ $(target) : : generate-xml-catalog : $(property-set) ; + import boostbook ; + import print ; + rule __init__ ( target : property-set ? : catalog-entries * ) + { + action.__init__ $(target) : : generate-xml-catalog : $(property-set) ; + } + rule actualize ( ) { if ! $(self.actualized) @@ -230,24 +233,26 @@ rule xml-catalog-action ( target : property-set ? : catalog-entries * ) } } -class xml-catalog-action : action ; - -rule boostbook-target-class ( name : project : sources * : requirements * - : default-build * : catalog-entries * ) +xclass boostbook-target-class : basic-target { - import feature ; - import virtual-target ; - import generators ; - - basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) - : $(default-build) ; - self.catalog-entries = $(catalog-entries) ; + import feature ; + import virtual-target ; + import generators ; + + rule __init__ ( name : project : sources * : requirements * + : default-build * : catalog-entries * ) + { + basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) + : $(default-build) ; + self.catalog-entries = $(catalog-entries) ; + } + rule construct ( source-targets * : property-set ) { local path = [ project.attribute $(self.project) location ] ; - local catalog = [ new file-target catalog : XML : $(self.project) ] ; - $(catalog).action [ new xml-catalog-action $(catalog) : $(property-set) + local catalog = [ xnew file-target catalog : XML : $(self.project) ] ; + $(catalog).action [ xnew xml-catalog-action $(catalog) : $(property-set) : $(self.catalog-entries) ] ; $(catalog).set-path $(path) ; @@ -313,14 +318,12 @@ rule boostbook-target-class ( name : project : sources * : requirements * } } -class boostbook-target-class : basic-target ; - rule boostbook ( target-name : sources * : requirements * : default-build * ) { local project = [ CALLER_MODULE ] ; targets.main-target-alternative - [ new boostbook-target-class $(target-name) : $(project) + [ xnew boostbook-target-class $(target-name) : $(project) : [ targets.main-target-sources $(sources) : $(target-name) ] : [ targets.main-target-requirements $(requirements) : $(project) ] : [ targets.main-target-default-build $(default-build) : $(project) ] diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index d0884d215..363237b6c 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -317,12 +317,16 @@ actions quietly piecemeal response-file-2 } ##### -rule c-scanner ( includes * ) +xclass c-scanner : scanner { - scanner.__init__ ; + import regex virtual-target path scanner ; - import regex virtual-target path scanner ; - self.includes = $(includes) ; + rule __init__ ( includes * ) + { + scanner.__init__ ; + + self.includes = $(includes) ; + } rule pattern ( ) { @@ -370,7 +374,6 @@ rule c-scanner ( includes * ) } } -class c-scanner : scanner ; scanner.register c-scanner : include ; type.set-scanner CPP : c-scanner ; @@ -484,7 +487,6 @@ xclass searched-lib-generator : generator generators.register [ xnew searched-lib-generator ] ; - xclass compile-action : action { import sequence ; diff --git a/v2/tools/doxygen.jam b/v2/tools/doxygen.jam index 5c22d579b..d16ffc2b9 100644 --- a/v2/tools/doxygen.jam +++ b/v2/tools/doxygen.jam @@ -9,7 +9,7 @@ # version of Doxygen that can output a single XML file instead of a # set of XML files. -import class : class new ; +import class : xnew ; import targets ; import feature ; import property ; @@ -90,17 +90,21 @@ rule xml-to-boostbook ( target : source : properties * ) ; } -rule doxygen-xml-target-class ( name : project : sources * : requirements * - : default-build * ) +xclass doxygen-xml-target-class : basic-target { - basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) - : $(default-build) ; + rule __init__ ( name : project : sources * : requirements * + : default-build * ) + { + basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) + : $(default-build) ; + } + rule construct ( source-targets * : property-set ) { local target = - [ new file-target $(self.name) : DOXYGEN_XML : $(self.project) ] ; - local a = [ new action $(target) : $(source-targets) : doxygen.extract-xml + [ xnew file-target $(self.name) : DOXYGEN_XML : $(self.project) ] ; + local a = [ xnew action $(target) : $(source-targets) : doxygen.extract-xml : $(property-set) ] ; $(target).action $(a) ; @@ -108,13 +112,11 @@ rule doxygen-xml-target-class ( name : project : sources * : requirements * } } -class doxygen-xml-target-class : basic-target ; - rule doxygen ( target-name : sources * : requirements * : default-build * ) { local project = [ CALLER_MODULE ] ; targets.main-target-alternative - [ new doxygen-xml-target-class $(target-name) : $(project) : $(sources) + [ xnew doxygen-xml-target-class $(target-name) : $(project) : $(sources) : [ targets.main-target-requirements $(requirements) : $(project) ] : [ targets.main-target-default-build $(default-build) : $(project) ] ] ; diff --git a/v2/tools/gettext.jam b/v2/tools/gettext.jam index f730ba555..3a13555b4 100644 --- a/v2/tools/gettext.jam +++ b/v2/tools/gettext.jam @@ -47,7 +47,7 @@ import targets ; import property-set ; import virtual-target ; -import class : class new ; +import class : class xnew ; import project ; import type ; import generators ; @@ -89,7 +89,7 @@ rule update ( name : existing-translation sources + : requirements * ) local project = [ CALLER_MODULE ] ; targets.main-target-alternative - [ new update-translations-class $(name) : $(project) : + [ xnew update-translations-class $(name) : $(project) : $(existing-translation) $(sources) : [ targets.main-target-requirements $(requirements) : $(project) ] ] ; @@ -115,13 +115,16 @@ feature gettext.types : : free ; generators.register-standard gettext.compile : gettext.PO : gettext.catalog ; -rule update-translations-class ( name : project : sources * : requirements ) +xclass update-translations-class : basic-target { - basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) - : $(default-build) ; - - IMPORT gettext : regex.split : $(__name__) : regex.split ; - + import regex : split ; + + rule __init__ ( name : project : sources * : requirements ) + { + basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements) + : $(default-build) ; + } + rule construct ( source-targets * : property-set ) { local types = [ $(property-set).get ] ; @@ -149,13 +152,13 @@ rule update-translations-class ( name : project : sources * : requirements ) if $(right-sources) { - local new-messages = [ new file-target $(self.name) : gettext.POT : $(self.project) ] ; + local new-messages = [ xnew file-target $(self.name) : gettext.POT : $(self.project) ] ; local extract = - [ new action $(new-messages) : $(right-sources) : gettext.extract ] ; + [ xnew action $(new-messages) : $(right-sources) : gettext.extract ] ; $(new-messages).action $(extract) ; - local r = [ new notfile-target $(self.name) : $(self.project) ] ; - local a = [ new action $(r) : $(source-targets[1]) $(new-messages) + local r = [ xnew notfile-target $(self.name) : $(self.project) ] ; + local a = [ xnew action $(r) : $(source-targets[1]) $(new-messages) : gettext.update-po-dispatch ] ; $(r).action $(a) ; .constructed = [ virtual-target.register $(r) ] ; @@ -172,7 +175,6 @@ rule update-translations-class ( name : project : sources * : requirements ) { } } -class update-translations-class : basic-target ; flags gettext.extract KEYWORD ; actions extract diff --git a/v2/tools/testing.jam b/v2/tools/testing.jam index fcb83e4db..b72ecdd2b 100644 --- a/v2/tools/testing.jam +++ b/v2/tools/testing.jam @@ -15,8 +15,8 @@ import toolset ; # lanch test programs. feature.feature testing.launcher : : optional free ; -xclass unit-test-target-class : basic-target -{ +xclass unit-test-target-class : typed-target +{ rule __init__ ( name : project : sources * : requirements * : default-build * ) { @@ -40,8 +40,6 @@ xclass unit-test-target-class : basic-target } } -class unit-test-target-class : typed-target ; - toolset.flags testing.run LAUNCHER ; diff --git a/v2/util/utility.jam b/v2/util/utility.jam index 0fd45e847..f50abecf5 100644 --- a/v2/util/utility.jam +++ b/v2/util/utility.jam @@ -99,13 +99,17 @@ rule apply-default-suffix ( suffix : list * ) local rule __test__ ( ) { import assert ; - import class : class new ; + import class : xnew ; assert.result foo bar : ungrist ; assert.result 123 : str 123 ; - local rule test-class__ ( ) + xclass test-class__ { + rule __init__ ( ) + { + } + rule str ( ) { return "str-test-class" ; @@ -121,15 +125,14 @@ local rule __test__ ( ) return "not sure" ; } } - class test-class__ ; - assert.result "str-test-class" : str [ new test-class__ ] ; + assert.result "str-test-class" : str [ xnew test-class__ ] ; assert.true less 1 2 ; assert.false less 2 1 ; - assert.result "yes, of course!" : less [ new test-class__ ] 1 ; + assert.result "yes, of course!" : less [ xnew test-class__ ] 1 ; assert.true equal 1 1 ; assert.false equal 1 2 ; - assert.result "not sure" : equal [ new test-class__ ] 1 ; + assert.result "not sure" : equal [ xnew test-class__ ] 1 ; assert.result foo.lib foo.a : apply-default-suffix .lib : foo foo.a ; }