summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-10-12 01:35:48 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-10-12 01:35:48 (GMT)
commit5bebdedc5967b9b3fdee9772f72e0e52e8fa7f1d (patch)
tree06661191389289ffec5f0c8be18aab2afa560cd5
parentdcddd56ac238f641db90390fc510a787f93150fd (diff)
parent9050e8c4f3b345628f4038b572d090bcaee15507 (diff)
downloadSCons-5bebdedc5967b9b3fdee9772f72e0e52e8fa7f1d.zip
SCons-5bebdedc5967b9b3fdee9772f72e0e52e8fa7f1d.tar.gz
SCons-5bebdedc5967b9b3fdee9772f72e0e52e8fa7f1d.tar.bz2
Merge branch 'master' of https://github.com/dmoody256/scons into dmoody256-master
-rw-r--r--src/CHANGES.txt4
-rw-r--r--src/engine/SCons/Tool/__init__.py2
-rw-r--r--test/Java/JAR.py62
3 files changed, 66 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 7d0f8d8..cbb9cff 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.
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
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: