- Allow construction variable substitutions in $LIBS specifications.
+ From Charles Crain:
+
+ - Restore the ability to do construction variable substitutions in all
+ kinds of *PATH variables, even when the substitution returns a Node
+ or other object.
+
From Tom Epperly:
- Allow the Java() Builder to take more than one source directory.
if SCons.Util.is_String(p):
p = self.subst(p, conv=s)
if SCons.Util.is_List(p):
- p = p[0]
+ if len(p) == 1:
+ p = p[0]
+ else:
+ # We have an object plus a string, or multiple
+ # objects that we need to smush together. No choice
+ # but to make them into a string.
+ p = string.join(map(SCons.Util.to_String, p), '')
else:
p = s(p)
r.append(p)
r = env.subst_path(['$PROXY', MyProxy('my2'), n])
assert r == ['my1-proxy', 'my2-proxy', n], r
+ class StringableObj:
+ def __init__(self, s):
+ self.s = s
+ def __str__(self):
+ return self.s
+
+ env = Environment(FOO=StringableObj("foo"),
+ BAR=StringableObj("bar"))
+
+ r = env.subst_path([ "${FOO}/bar", "${BAR}/baz" ])
+ assert r == [ "foo/bar", "bar/baz" ]
+
+ r = env.subst_path([ "bar/${FOO}", "baz/${BAR}" ])
+ assert r == [ "bar/foo", "baz/bar" ]
+
+ r = env.subst_path([ "bar/${FOO}/bar", "baz/${BAR}/baz" ])
+ assert r == [ "bar/foo/bar", "baz/bar/baz" ]
+
def test_Builder_calls(self):
"""Test Builder calls through different environments
"""