diff options
author | Steven Knight <knight@baldmt.com> | 2004-10-23 18:55:33 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-10-23 18:55:33 (GMT) |
commit | 35a89330d1df50811fc6912df0047148b1d98450 (patch) | |
tree | 683414a1b9cbe71e95504b794a6439142f58f946 | |
parent | 8fc56d4098128552043f581cb50074426a149959 (diff) | |
download | SCons-35a89330d1df50811fc6912df0047148b1d98450.zip SCons-35a89330d1df50811fc6912df0047148b1d98450.tar.gz SCons-35a89330d1df50811fc6912df0047148b1d98450.tar.bz2 |
Allow substitution of (Levi Stephen) and other construction variables used by various Tools.
-rw-r--r-- | src/CHANGES.txt | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/jar.py | 12 | ||||
-rw-r--r-- | test/JAR.py | 3 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 69519f1..1995a0b 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -238,6 +238,10 @@ RELEASE 0.97 - XXX Command() and Scanner test coverage. Improved test infrastructure for -c output. + From Levi Stephen: + + - Allow $JARCHDIR to be expanded to other construction variables. + From Christoph Wiedemann: - Add an Environment.SetDefault() method that only sets values if diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index 5a74a40..3c5e5f5 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -38,17 +38,17 @@ import SCons.Util def jarSources(target, source, env, for_signature): """Only include sources that are not a manifest file.""" - ret = [] + jarchdir = env.subst('$JARCHDIR') + result = [] for src in source: contents = src.get_contents() if contents[:16] != "Manifest-Version": - if env.has_key('JARCHDIR'): + if jarchdir: # If we are changing the dir with -C, then sources should # be relative to that directory. - ret.append(src.get_path(src.fs.Dir(env['JARCHDIR']))) - else: - ret.append(src) - return ret + src = src.get_path(src.fs.Dir(jarchdir)) + result.append(src) + return result def jarManifest(target, source, env, for_signature): """Look in sources for a manifest file, if any.""" diff --git a/test/JAR.py b/test/JAR.py index e0634be..cec6c5b 100644 --- a/test/JAR.py +++ b/test/JAR.py @@ -103,7 +103,8 @@ env = Environment(tools = ['jar'], JARFLAGS='cvf') env.Jar(target = 'classes.jar', source = [ 'testdir/bar.class', 'foo.mf' ], - JARCHDIR='testdir') + TESTDIR='testdir', + JARCHDIR='$TESTDIR') """ % (python)) test.subdir('testdir') |