From 3ebd1cd7be97f4e763c552b053db193e95262dfd Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Thu, 3 Jun 2010 01:40:26 +0000 Subject: Document GetBuildPath in Users Guide --- doc/scons.mod | 2 ++ doc/user/nodes.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ doc/user/nodes.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) diff --git a/doc/scons.mod b/doc/scons.mod index f8d1fe0..1de2807 100644 --- a/doc/scons.mod +++ b/doc/scons.mod @@ -191,10 +191,12 @@ File"> FindFile"> FindInstalledFiles"> +FindPathDirs"> Finish"> Flatten"> GenerateHelpText"> GetBuildFailures"> +GetBuildPath"> GetLaunchDir"> GetOption"> Glob"> diff --git a/doc/user/nodes.in b/doc/user/nodes.in index d8169df..fb5ce23 100644 --- a/doc/user/nodes.in +++ b/doc/user/nodes.in @@ -332,6 +332,51 @@ +
+ &GetBuildPath;: Getting the Path From a &Node; or String + + + + env.GetBuildPath(file_or_list) + returns the path of a &Node; or a string representing a + path. It can also take a list of &Node;s and/or strings, and + returns the list of paths. If passed a single &Node;, the result + is the same as calling str(node) (see above). + The string(s) can have embedded construction variables, which are + expanded as usual, using the calling environment's set of + variables. The paths can be files or directories, and do not have + to exist. + + + + + + env=Environment(VAR="value") + n=File("foo.c") + print env.GetBuildPath([n, "sub/dir/$VAR"]) + + + + + + Would print the following file names: + + + + + scons -Q + + + + + There is also a function version of &GetBuildPath; which can + be called without an &Environment;; that uses the default SCons + &Environment; to do substitution on any string arguments. + + + +
+