summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Environment.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-09-14 19:29:01 (GMT)
committerSteven Knight <knight@baldmt.com>2003-09-14 19:29:01 (GMT)
commit3ab7670a45179b7a09eabc219842f6c224ad35da (patch)
treeaca25fd119f68b44fa181a90bd535bfdfb01fed5 /src/engine/SCons/Environment.py
parent1c2ac0f2ca0c14d1181add9cc66d9650fece1481 (diff)
downloadSCons-3ab7670a45179b7a09eabc219842f6c224ad35da.zip
SCons-3ab7670a45179b7a09eabc219842f6c224ad35da.tar.gz
SCons-3ab7670a45179b7a09eabc219842f6c224ad35da.tar.bz2
Make more Environment methods from global functions.
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r--src/engine/SCons/Environment.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 3d00837..2e95d81 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -636,6 +636,14 @@ class Environment:
tlist = tlist[0]
return tlist
+ def BuildDir(self, build_dir, src_dir, duplicate=1):
+ build_dir = self.arg2nodes(build_dir, self.fs.Dir)[0]
+ src_dir = self.arg2nodes(src_dir, self.fs.Dir)[0]
+ self.fs.BuildDir(build_dir, src_dir, duplicate)
+
+ def CacheDir(self, path):
+ self.fs.CacheDir(self.subst(path))
+
def Clean(self, target, files):
global CleanTargets
@@ -690,11 +698,27 @@ class Environment:
tlist = tlist[0]
return tlist
+ def Dir(self, name, *args, **kw):
+ """
+ """
+ return apply(self.fs.Dir, (self.subst(name),) + args, kw)
+
+ def File(self, name, *args, **kw):
+ """
+ """
+ return apply(self.fs.File, (self.subst(name),) + args, kw)
+
def FindFile(self, file, dirs):
file = self.subst(file)
nodes = self.arg2nodes(dirs, self.fs.Dir)
return SCons.Node.FS.find_file(file, nodes, self.fs.File)
+ def GetBuildPath(self, files):
+ ret = map(str, self.arg2nodes(files, self.fs.Entry))
+ if len(ret) == 1:
+ return ret[0]
+ return ret
+
def Ignore(self, target, dependency):
"""Ignore a dependency."""
tlist = self.arg2nodes(target, self.fs.File)
@@ -763,6 +787,16 @@ class Environment:
tlist = tlist[0]
return tlist
+ def Repository(self, *dirs, **kw):
+ dirs = self.arg2nodes(list(dirs), self.fs.Dir)
+ apply(self.fs.Repository, dirs, kw)
+
+ def SConsignFile(self, name=".sconsign.dbm"):
+ name = self.subst(name)
+ if not os.path.isabs(name):
+ name = os.path.join(str(self.fs.SConstruct_dir), name)
+ SCons.Sig.SConsignFile(name)
+
def SideEffect(self, side_effect, target):
"""Tell scons that side_effects are built as side
effects of building targets."""