diff options
author | Daniel Moody <dmoody256@gmail.com> | 2017-11-14 01:37:51 (GMT) |
---|---|---|
committer | Daniel Moody <dmoody256@gmail.com> | 2017-11-14 01:37:51 (GMT) |
commit | d55fd3cfa0e691c8aecebbcc066e186b1a2ac4aa (patch) | |
tree | 1cd19682913c4915808596a7a8b83d27028def3e /src/engine | |
parent | d6359bea1d2b3bb45a598420d5a19cb37ef425e7 (diff) | |
download | SCons-d55fd3cfa0e691c8aecebbcc066e186b1a2ac4aa.zip SCons-d55fd3cfa0e691c8aecebbcc066e186b1a2ac4aa.tar.gz SCons-d55fd3cfa0e691c8aecebbcc066e186b1a2ac4aa.tar.bz2 |
Added a way to handle multiple targets for the Jar builder and an extra warning message.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/jar.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index 62cd86a..f22e68b 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -95,10 +95,22 @@ def Jar(env, target = None, source = [], *args, **kw): Builders. """ + # mutiple targets pass so build each target the same from the + # same source + #TODO Maybe this should only be done once, and the result copied + # for each target since it should result in the same? + if SCons.Util.is_List(target) and SCons.Util.is_List(source): + jars = [] + for single_target in target: + jars += env.Jar( target = single_target, source = source, *args, **kw) + return jars + # jar target should not be a list so assume they passed # no target and want implicit target to be made and the arg # was actaully the list of sources - if SCons.Util.is_List(target): + if SCons.Util.is_List(target) and source == []: + SCons.Warning.Warning("Making implicit target jar file, " + + "and treating the list as sources") source = target target = None @@ -118,10 +130,6 @@ def Jar(env, target = None, source = [], *args, **kw): if not SCons.Util.is_List(source): source = [source] - # Pad the target list with repetitions of the last element in the - # list so we have a target for every source element. - target = target + ([target[-1]] * (len(source) - len(target))) - # setup for checking through all the sources and handle accordingly java_class_suffix = env.subst('$JAVACLASSSUFFIX') java_suffix = env.subst('$JAVASUFFIX') |