mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 13:22:11 +00:00
Refactorings.
* build/project-roots.jam (load): Return object, not project root module * build/project.jam (initialize): Renamed 'project-root-modue' attribute to 'project-root'. [SVN r23017]
This commit is contained in:
@@ -37,13 +37,14 @@ rule load (
|
||||
|
||||
local module-name = project-root<$(location)> ;
|
||||
|
||||
local root ;
|
||||
# Only bother with the rest if the project-root isn't loaded yet.
|
||||
#
|
||||
if ! [ modules.peek $(module-name) : .project-root ]
|
||||
{
|
||||
# Create the project-root, and remember it.
|
||||
#
|
||||
local root = [ class.new project-root-object $(location) ] ;
|
||||
root = [ class.new project-root-object $(location) ] ;
|
||||
modules.poke $(module-name) : .project-root : $(root) ;
|
||||
.roots += $(root) ;
|
||||
|
||||
@@ -51,10 +52,15 @@ rule load (
|
||||
#
|
||||
$(root).initialize ;
|
||||
}
|
||||
else
|
||||
{
|
||||
root = [ modules.peek $(module-name) : .project-root ] ;
|
||||
}
|
||||
|
||||
|
||||
# Return the module for the project.
|
||||
#
|
||||
return $(module-name) ;
|
||||
return $(root) ;
|
||||
}
|
||||
|
||||
# Finds the location of project root for a directory.
|
||||
@@ -357,8 +363,8 @@ module project-context
|
||||
{
|
||||
import project ;
|
||||
local attributes = [ project.attributes $(__name__) ] ;
|
||||
local project-root-module = [ $(attributes).get project-root-module ] ;
|
||||
return [ $(project-root-module).project-root
|
||||
$(method) $(args) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ] ;
|
||||
local project-root = [ $(attributes).get project-root ] ;
|
||||
return [ $(project-root).$(method)
|
||||
$(args) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ] ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,10 +290,10 @@ rule initialize (
|
||||
# Make sure we've loaded the project-root corresponding to this
|
||||
# Jamfile.
|
||||
#
|
||||
local project-root-module = [ project-roots.load $(location) ] ;
|
||||
local project-root = [ $(project-root-module).project-root get-location ] ;
|
||||
local project-root-object = [ project-roots.load $(location) ] ;
|
||||
local project-root = [ $(project-root-object).get-location ] ;
|
||||
|
||||
$(attributes).set project-root-module : $(project-root-module) : exact ;
|
||||
$(attributes).set project-root : $(project-root-object) : exact ;
|
||||
|
||||
local parent = [ find-jamfile $(location) $(project-root) ] ;
|
||||
local parent-module = ;
|
||||
@@ -302,18 +302,18 @@ rule initialize (
|
||||
parent-module = [ load [ path.parent $(parent[1]) ] ] ;
|
||||
}
|
||||
|
||||
inherit-attributes $(module-name) : $(project-root-module) : $(parent-module) ;
|
||||
inherit-attributes $(module-name) : $(project-root-object) : $(parent-module) ;
|
||||
}
|
||||
|
||||
.current-project = [ target $(module-name) ] ;
|
||||
}
|
||||
|
||||
# Make 'project-module' inherit attributes of project root and parent module.
|
||||
rule inherit-attributes ( project-module : project-root-module : parent-module ? )
|
||||
rule inherit-attributes ( project-module : project-root : parent-module ? )
|
||||
{
|
||||
# Register with the project root. This will inject project-root
|
||||
# constants and do some other initialization.
|
||||
$(project-root-module).project-root register-project $(project-module) ;
|
||||
$(project-root).register-project $(project-module) ;
|
||||
|
||||
if $(parent-module)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user