diff options
author | Mats Wichmann <mats@linux.com> | 2022-01-24 16:40:48 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2022-01-24 19:40:25 (GMT) |
commit | ba5915c606c29d2490ce65782e4db861249a9b78 (patch) | |
tree | d358648cd1ef5d7ff7bdf12e74a984b1537d7a0f /test/Java/Java-fixture/myjar.py | |
parent | 7b3960d9865ead96d5c541be231ec7f62d8b6ab7 (diff) | |
download | SCons-ba5915c606c29d2490ce65782e4db861249a9b78.zip SCons-ba5915c606c29d2490ce65782e4db861249a9b78.tar.gz SCons-ba5915c606c29d2490ce65782e4db861249a9b78.tar.bz2 |
A little java/jar cleanup
* The Jar test is split into requires-jdk and not.
* Move some inline tool definitions to fixture files.
* Reformat some stuff.
* Some linting and commenting in Jar tool.
* Enabled test for a non-java file when Jar source is a directory
(was commented out) - needed to add a Command to copy the file
to the directory where the class files were generated.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/Java/Java-fixture/myjar.py')
-rw-r--r-- | test/Java/Java-fixture/myjar.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Java/Java-fixture/myjar.py b/test/Java/Java-fixture/myjar.py new file mode 100644 index 0000000..a47e3b0 --- /dev/null +++ b/test/Java/Java-fixture/myjar.py @@ -0,0 +1,19 @@ +import fileinput +import sys + +args = sys.argv[1:] +while args: + arg = args[0] + if arg == 'cf': + out = args[1] + args = args[1:] + else: + break + args = args[1:] + +with open(out, 'wb') as ofp, fileinput.input(files=args, mode='rb') as ifp: + for line in ifp: + if not line.startswith(b'/*jar*/'): + ofp.write(line) + +sys.exit(0) |