2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00

Bugfix. Allow "project-root" to work in Jamfile, again.

Thanks to Peter Schoen for bugreport.

* new/project.jam (initialize): Set 'project-root-module' attribute.
* new/project_root.py: New test.


[SVN r19899]
This commit is contained in:
Vladimir Prus
2003-09-01 14:00:26 +00:00
parent bb6cc49508
commit b9e4d182de
6 changed files with 52 additions and 2 deletions

View File

@@ -321,6 +321,8 @@ rule initialize (
#
local project-root-module = [ project-roots.load $(location) ] ;
local project-root = [ $(project-root-module).project-root get-location ] ;
$(attributes).set project-root-module : $(project-root-module) : exact ;
local parent = [ find-jamfile $(location) $(project-root) ] ;
local parent-module = ;
@@ -561,7 +563,6 @@ rule use ( id : location )
# This module defines rules common to all projects
module project-rules
{
rule project ( id ? : options * : * )
{
import project ;

23
test/project_root.py Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
# Test that we can access project-root attributes from Jamfiles.
from BoostBuild import Tester, List
# Create a temporary working directory
t = Tester()
t.write("Jamfile", """
local l = [ project-root get-location ] ;
ECHO XXX $(l) ;
""")
t.write("project-root.jam", "")
t.run_build_system(stdout="XXX .\n")
t.cleanup()

View File

@@ -106,6 +106,7 @@ tests = [ "project_test1",
"suffix",
"inherit_toolset",
"skipping",
"project_root",
]
if os.name == 'posix':

View File

@@ -321,6 +321,8 @@ rule initialize (
#
local project-root-module = [ project-roots.load $(location) ] ;
local project-root = [ $(project-root-module).project-root get-location ] ;
$(attributes).set project-root-module : $(project-root-module) : exact ;
local parent = [ find-jamfile $(location) $(project-root) ] ;
local parent-module = ;
@@ -561,7 +563,6 @@ rule use ( id : location )
# This module defines rules common to all projects
module project-rules
{
rule project ( id ? : options * : * )
{
import project ;

23
v2/test/project_root.py Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
# Test that we can access project-root attributes from Jamfiles.
from BoostBuild import Tester, List
# Create a temporary working directory
t = Tester()
t.write("Jamfile", """
local l = [ project-root get-location ] ;
ECHO XXX $(l) ;
""")
t.write("project-root.jam", "")
t.run_build_system(stdout="XXX .\n")
t.cleanup()

View File

@@ -106,6 +106,7 @@ tests = [ "project_test1",
"suffix",
"inherit_toolset",
"skipping",
"project_root",
]
if os.name == 'posix':