Allow substitution of (Levi Stephen) and other construction variables used by variou...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 23 Oct 2004 18:55:33 +0000 (18:55 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 23 Oct 2004 18:55:33 +0000 (18:55 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1140 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Tool/jar.py
test/JAR.py

index 69519f1a6261e496f7f1d43fccf2db2069f92510..1995a0be1a4d9c2bc1cc7d0977be67ff0c991c24 100644 (file)
@@ -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
index 5a74a40d6ebf6f9d1850317a2150d75031e5f17e..3c5e5f54f9f8bc1a94777b242242f48ef0e040ff 100644 (file)
@@ -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."""
index e0634be99320367eee1eea3a4a4cadafdadbfef8..cec6c5bd6dc9c5c3612cf2596d56f576bc43c651 100644 (file)
@@ -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')