summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Moody <dmoody256@gmail.com>2017-11-19 16:43:22 (GMT)
committerDaniel Moody <dmoody256@gmail.com>2017-12-03 21:19:53 (GMT)
commit2027e87723bb184026d01e6963205031b2521d02 (patch)
tree96305b3afe41d8081e5520b8de7135ccb3a39d03 /test
parent835122bf918d813f0b67969f73cd285ce92b3e98 (diff)
downloadSCons-2027e87723bb184026d01e6963205031b2521d02.zip
SCons-2027e87723bb184026d01e6963205031b2521d02.tar.gz
SCons-2027e87723bb184026d01e6963205031b2521d02.tar.bz2
updated jar.py to handle nodes and varanit dirs better, added test for nodes and varient dir.
Diffstat (limited to 'test')
-rw-r--r--test/Java/JAR.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index 2353c10..051e051 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -342,14 +342,18 @@ test.subdir('listOfLists',
['listOfLists', 'src', 'com', 'javasource'],
['listOfLists', 'src', 'com', 'resource'])
-# simple SConstruct which passes the 3 .java as source
-# and extracts the jars back to classes
+# test varient dir and lists of lists
test.write(['listOfLists', 'SConstruct'], """
foo = Environment()
-list_of_class_files = foo.Java('src', source=['src'])
-resources = ['src/com/resource/resource1.txt', 'src/com/resource/resource2.txt']
+foo.VariantDir('build', 'src', duplicate=0)
+sourceFiles = ["src/com/javasource/JavaFile1.java", "src/com/javasource/JavaFile2.java", "src/com/javasource/JavaFile3.java",]
+list_of_class_files = foo.Java('build', source=sourceFiles)
+resources = ['build/com/resource/resource1.txt', 'build/com/resource/resource2.txt']
+for resource in resources:
+ foo.Command(resource, list_of_class_files, Copy(resource, resource.replace('build','src')))
+foo.Command('build/MANIFEST.mf', list_of_class_files, Copy('build/MANIFEST.mf', 'MANIFEST.mf'))
contents = [list_of_class_files, resources]
-foo.Jar(target = 'lists', source = contents + ['MANIFEST.mf'], JARCHDIR='src')
+foo.Jar(target = 'lists', source = contents + ['build/MANIFEST.mf'], JARCHDIR='build')
foo.Command("listsTest", [], Mkdir("listsTest") )
foo.Command('listsTest/src/com/javasource/JavaFile3.java', 'lists.jar', foo['JAR'] + ' xvf ../lists.jar', chdir='listsTest')
""")