From 4d4519492f28821f876ca418cf98c355781eb217 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 7 Oct 2017 03:56:53 -0400 Subject: updated the Jar tool to not force sources to .class files allowing for directories to be passed as sources as well. --- src/engine/SCons/Tool/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 6ddb9fc..57090bb 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -914,8 +914,6 @@ def CreateJarBuilder(env): jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR') java_jar = SCons.Builder.Builder(action = jar_com, suffix = '$JARSUFFIX', - src_suffix = '$JAVACLASSSUFFIX', - src_builder = 'JavaClassFile', source_factory = fs.Entry) env['BUILDERS']['Jar'] = java_jar return java_jar -- cgit v0.12 From 3dba3ffbdcef903ad1a8c18ac0da86dcba175ea8 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 7 Oct 2017 04:11:27 -0400 Subject: added changes to CHANGES.txt --- src/CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a7ad6f2..2621da9 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -11,6 +11,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Whatever John Doe did. + From Daniel Moody: + - Updated the Jar Builder tool in Tool/__init.py so that is doesn't force class files as + sources, allowing directories to be passed, which was causing test/Java/JAR.py to fail. + From William Deegan: - Fix issue where code in utility routine to_String_for_subst() had code whose result was never properly returned. -- cgit v0.12 From 9050e8c4f3b345628f4038b572d090bcaee15507 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Mon, 9 Oct 2017 21:34:28 -0400 Subject: added test to JAR to also check the case that java source files are passed directly as a source to the Jar builder. The only other test that did this was multi-setp.py which was reliant on swig being installed. --- test/Java/JAR.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/test/Java/JAR.py b/test/Java/JAR.py index 476bfcd..08b7ab1 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -239,6 +239,68 @@ test.must_exist('bar.jar') test.up_to_date(arguments = '.') +####### +# test java source files as source to Jar builder + +# make some directories to test in +test.subdir('testdir2', + ['testdir2', 'com'], + ['testdir2', 'com', 'javasource']) + +# simple SConstruct which passes the 3 .java as source +test.write(['testdir2', 'SConstruct'], """ +foo = Environment() +foo.Jar(target = 'foo', source = [ + 'com/javasource/JavaFile1.java', + 'com/javasource/JavaFile2.java', + 'com/javasource/JavaFile3.java' +]) +""") + +test.write(['testdir2', 'com', 'javasource', 'JavaFile1.java'], """\ +package com.javasource; + +public class JavaFile1 +{ + public static void main(String[] args) + { + + } +} +""") + +test.write(['testdir2', 'com', 'javasource', 'JavaFile2.java'], """\ +package com.javasource; + +public class JavaFile2 +{ + public static void main(String[] args) + { + + } +} +""") + +test.write(['testdir2', 'com', 'javasource', 'JavaFile3.java'], """\ +package com.javasource; + +public class JavaFile3 +{ + public static void main(String[] args) + { + + } +} +""") + +test.run(chdir='testdir2') + +if("jar cf foo.jar com/javasource/JavaFile1.java com/javasource/JavaFile2.java " + + "com/javasource/JavaFile3.java" not in test.stdout()): + test.fail_test() + +test.must_exist(['testdir2','foo.jar']) + test.pass_test() # Local Variables: -- cgit v0.12