summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-11-21 21:14:41 (GMT)
committerSteven Knight <knight@baldmt.com>2004-11-21 21:14:41 (GMT)
commit9ee53a60a770d6f5a33624405d35ad4063378367 (patch)
tree361012066ed284ecad1482552d177f86a0cd664d
parent07c75889f874a050aff782d1488d0269fb936744 (diff)
downloadSCons-9ee53a60a770d6f5a33624405d35ad4063378367.zip
SCons-9ee53a60a770d6f5a33624405d35ad4063378367.tar.gz
SCons-9ee53a60a770d6f5a33624405d35ad4063378367.tar.bz2
More command-line output customizability: , , , .
-rw-r--r--doc/man/scons.138
-rw-r--r--src/CHANGES.txt10
-rw-r--r--src/engine/SCons/Tool/jar.py7
-rw-r--r--src/engine/SCons/Tool/javac.py5
-rw-r--r--src/engine/SCons/Tool/javah.py5
-rw-r--r--src/engine/SCons/Tool/rmic.py5
-rw-r--r--test/Java/JAR.py (renamed from test/JAR.py)0
-rw-r--r--test/Java/JARCOM.py65
-rw-r--r--test/Java/JARCOMSTR.py69
-rw-r--r--test/Java/JARFLAGS.py (renamed from test/JARFLAGS.py)0
-rw-r--r--test/Java/JAVAC.py (renamed from test/JAVAC.py)0
-rw-r--r--test/Java/JAVACCOM.py68
-rw-r--r--test/Java/JAVACCOMSTR.py72
-rw-r--r--test/Java/JAVACFLAGS.py (renamed from test/JAVACFLAGS.py)0
-rw-r--r--test/Java/JAVAH.py (renamed from test/JAVAH.py)0
-rw-r--r--test/Java/JAVAHCOM.py69
-rw-r--r--test/Java/JAVAHCOMSTR.py85
-rw-r--r--test/Java/RMIC.py (renamed from test/RMIC.py)0
-rw-r--r--test/Java/RMICCOM.py79
-rw-r--r--test/Java/RMICCOMSTR.py85
20 files changed, 653 insertions, 9 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1
index e73bada..2f504a6 100644
--- a/doc/man/scons.1
+++ b/doc/man/scons.1
@@ -5494,6 +5494,15 @@ option).
.IP JARCOM
The command line used to call the Java archive tool.
+.IP JARCOMSTR
+The string displayed when the Java archive tool
+is called
+If this is not set, then $JARCOM (the command line) is displayed.
+
+.ES
+env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
+.EE
+
.IP JARFLAGS
General options passed to the Java archive tool.
By default this is set to
@@ -5517,6 +5526,16 @@ corresponding Java class files.
Any options specified in the $JAVACFLAGS construction variable
are included on this command line.
+.IP JAVACCOMSTR
+The string displayed when compiling
+a directory tree of Java source files to
+corresponding Java class files.
+If this is not set, then $JAVACCOM (the command line) is displayed.
+
+.ES
+env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES")
+.EE
+
.IP JAVACFLAGS
General options that are passed to the Java compiler.
@@ -5541,6 +5560,15 @@ from Java classes.
Any options specified in the $JAVAHFLAGS construction variable
are included on this command line.
+.IP JAVAHCOMSTR
+The string displayed when C header and stub files
+are generated from Java classes.
+If this is not set, then $JAVAHCOM (the command line) is displayed.
+
+.ES
+env = Environment(JAVAHCOMSTR = "Generating header/stub file(s) $TARGETS from $SOURCES")
+.EE
+
.IP JAVAHFLAGS
General options passed to the C header and stub file generator
for Java classes.
@@ -6258,6 +6286,16 @@ from Java classes that contain RMI implementations.
Any options specified in the $RMICFLAGS construction variable
are included on this command line.
+.IP RMICCOMSTR
+The string displayed when compiling
+stub and skeleton class files
+from Java classes that contain RMI implementations.
+If this is not set, then $RMICCOM (the command line) is displayed.
+
+.ES
+env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES")
+.EE
+
.IP RMICFLAGS
General options passed to the Java RMI stub compiler.
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 326f9cf..62d691a 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -133,10 +133,12 @@ RELEASE 0.97 - XXX
- Support easier customization of what's displayed by various default
actions by adding new construction variables: $ARCOMSTR, $ASCOMSTR,
$ASPPCOMSTR, $BITKEEPERCOMSTR, $CCCOMSTR, $CVSCOMSTR, $CXXCOMSTR,
- $F77COMSTR, $F90COMSTR, $F95COMSTR, $FORTRANCOMSTR, $LEXCOMSTR,
- $LINKCOMSTR, $RCSCOMSTR, $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR,
- $SHF77COMSTR, $SHF90COMSTR, $SHF95COMSTR, $SHFORTRANCOMSTR,
- $SHLINKCOMSTR and $YACCCOMSTR.
+ $F77COMSTR, $F90COMSTR, $F95COMSTR, $FORTRANCOMSTR, $JARCOMSTR,
+ $JAVACCOMSTR, $JAVAHCOMSTR, $LEXCOMSTR, $LINKCOMSTR, $RCSCOMSTR,
+ $RMICCOMSTR, $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR, $SHF77COMSTR,
+ $SHF90COMSTR, $SHF95COMSTR, $SHFORTRANCOMSTR, $SHLINKCOMSTR and
+ $YACCCOMSTR.
+
From Wayne Lee:
diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py
index 3c5e5f5..a721d96 100644
--- a/src/engine/SCons/Tool/jar.py
+++ b/src/engine/SCons/Tool/jar.py
@@ -33,6 +33,7 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import SCons.Action
import SCons.Builder
import SCons.Util
@@ -77,8 +78,10 @@ def jarChdir(target, source, env, for_signature):
if env.has_key('JARCHDIR'):
return [ '-C', '$JARCHDIR' ]
return []
-
-JarBuilder = SCons.Builder.Builder(action = '$JARCOM',
+
+JarAction = SCons.Action.Action('$JARCOM', '$JARCOMSTR')
+
+JarBuilder = SCons.Builder.Builder(action = JarAction,
source_factory = SCons.Node.FS.default_fs.Entry,
suffix = '$JARSUFFIX')
diff --git a/src/engine/SCons/Tool/javac.py b/src/engine/SCons/Tool/javac.py
index e16f6d0..e6a0fc3 100644
--- a/src/engine/SCons/Tool/javac.py
+++ b/src/engine/SCons/Tool/javac.py
@@ -37,6 +37,7 @@ import os
import os.path
import string
+import SCons.Action
import SCons.Builder
from SCons.Node.FS import _my_normcase
from SCons.Tool.JavaCommon import parse_java_file
@@ -91,7 +92,9 @@ def emit_java_classes(target, source, env):
return tlist, slist
-JavaBuilder = SCons.Builder.Builder(action = '$JAVACCOM',
+JavaAction = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')
+
+JavaBuilder = SCons.Builder.Builder(action = JavaAction,
emitter = emit_java_classes,
target_factory = SCons.Node.FS.default_fs.Dir,
source_factory = SCons.Node.FS.default_fs.Dir)
diff --git a/src/engine/SCons/Tool/javah.py b/src/engine/SCons/Tool/javah.py
index 8f69a46..4d5749a 100644
--- a/src/engine/SCons/Tool/javah.py
+++ b/src/engine/SCons/Tool/javah.py
@@ -36,6 +36,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import string
+import SCons.Action
import SCons.Builder
import SCons.Node.FS
import SCons.Tool.javac
@@ -105,7 +106,9 @@ def JavaHOutFlagGenerator(target, source, env, for_signature):
except AttributeError:
return '-o ' + str(t)
-JavaHBuilder = SCons.Builder.Builder(action = '$JAVAHCOM',
+JavaHAction = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR')
+
+JavaHBuilder = SCons.Builder.Builder(action = JavaHAction,
emitter = emit_java_headers,
src_suffix = '$JAVACLASSSUFFIX',
target_factory = SCons.Node.FS.default_fs.Entry,
diff --git a/src/engine/SCons/Tool/rmic.py b/src/engine/SCons/Tool/rmic.py
index 465bd68..c5c4854 100644
--- a/src/engine/SCons/Tool/rmic.py
+++ b/src/engine/SCons/Tool/rmic.py
@@ -36,6 +36,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import string
+import SCons.Action
import SCons.Builder
import SCons.Node.FS
import SCons.Util
@@ -89,7 +90,9 @@ def emit_rmic_classes(target, source, env):
return tlist, source
-RMICBuilder = SCons.Builder.Builder(action = '$RMICCOM',
+RMICAction = SCons.Action.Action('$RMICCOM', '$RMICCOMSTR')
+
+RMICBuilder = SCons.Builder.Builder(action = RMICAction,
emitter = emit_rmic_classes,
src_suffix = '$JAVACLASSSUFFIX',
target_factory = SCons.Node.FS.default_fs.Dir,
diff --git a/test/JAR.py b/test/Java/JAR.py
index ea51213..ea51213 100644
--- a/test/JAR.py
+++ b/test/Java/JAR.py
diff --git a/test/Java/JARCOM.py b/test/Java/JARCOM.py
new file mode 100644
index 0000000..0d7ebba
--- /dev/null
+++ b/test/Java/JARCOM.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $JARCOM construction variable.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myjar.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*jar*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'jar'],
+ JARCOM = r'%(python)s myjar.py $TARGET $SOURCES')
+env.Jar(target = 'test1', source = ['file1.in', 'file2.in', 'file3.in'])
+""" % locals())
+
+test.write('file1.in', "file1.in\n/*jar*/\n")
+test.write('file2.in', "file2.in\n/*jar*/\n")
+test.write('file3.in', "file3.in\n/*jar*/\n")
+
+test.run()
+
+test.must_match('test1.jar', "file1.in\nfile2.in\nfile3.in\n")
+
+
+
+test.pass_test()
diff --git a/test/Java/JARCOMSTR.py b/test/Java/JARCOMSTR.py
new file mode 100644
index 0000000..aa8a6ad
--- /dev/null
+++ b/test/Java/JARCOMSTR.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $JARCOMSTR construction variable allows you to configure
+the jar output.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myjar.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*jar*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'jar'],
+ JARCOM = r'%(python)s myjar.py $TARGET $SOURCES',
+ JARCOMSTR = "Jar'ing up $TARGET from $SOURCES")
+env.Jar(target = 'test1', source = ['file1.in', 'file2.in', 'file3.in'])
+""" % locals())
+
+test.write('file1.in', "file1.in\n/*jar*/\n")
+test.write('file2.in', "file2.in\n/*jar*/\n")
+test.write('file3.in', "file3.in\n/*jar*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+Jar'ing up test1.jar from file1.in file2.in file3.in
+"""))
+
+test.must_match('test1.jar', "file1.in\nfile2.in\nfile3.in\n")
+
+
+
+test.pass_test()
diff --git a/test/JARFLAGS.py b/test/Java/JARFLAGS.py
index 7e3669d..7e3669d 100644
--- a/test/JARFLAGS.py
+++ b/test/Java/JARFLAGS.py
diff --git a/test/JAVAC.py b/test/Java/JAVAC.py
index 779045f..779045f 100644
--- a/test/JAVAC.py
+++ b/test/Java/JAVAC.py
diff --git a/test/Java/JAVACCOM.py b/test/Java/JAVACCOM.py
new file mode 100644
index 0000000..171649c
--- /dev/null
+++ b/test/Java/JAVACCOM.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $JAVACCOM construction variable.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+test.subdir('src')
+
+
+
+test.write('myjavac.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*javac*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'javac'],
+ JAVACCOM = r'%(python)s myjavac.py $TARGET $SOURCES')
+env.Java(target = 'classes', source = 'src')
+""" % locals())
+
+test.write(['src', 'file1.java'], "file1.java\n/*javac*/\n")
+test.write(['src', 'file2.java'], "file2.java\n/*javac*/\n")
+test.write(['src', 'file3.java'], "file3.java\n/*javac*/\n")
+
+test.run()
+
+test.must_match(['classes', 'src', 'file1.class'],
+ "file1.java\nfile2.java\nfile3.java\n")
+
+
+
+test.pass_test()
diff --git a/test/Java/JAVACCOMSTR.py b/test/Java/JAVACCOMSTR.py
new file mode 100644
index 0000000..306ae57
--- /dev/null
+++ b/test/Java/JAVACCOMSTR.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $JAVACCOMSTR construction variable allows you to configure
+the javac output.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+test.subdir('src')
+
+
+
+test.write('myjavac.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*javac*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'javac'],
+ JAVACCOM = r'%(python)s myjavac.py $TARGET $SOURCES',
+ JAVACCOMSTR = "Compiling class(es) $TARGET from $SOURCES")
+env.Java(target = 'classes', source = 'src')
+""" % locals())
+
+test.write(['src', 'file1.java'], "file1.java\n/*javac*/\n")
+test.write(['src', 'file2.java'], "file2.java\n/*javac*/\n")
+test.write(['src', 'file3.java'], "file3.java\n/*javac*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+Compiling class(es) classes/src/file1.class from src/file1.java src/file2.java src/file3.java
+"""))
+
+test.must_match(['classes', 'src', 'file1.class'],
+ "file1.java\nfile2.java\nfile3.java\n")
+
+
+
+test.pass_test()
diff --git a/test/JAVACFLAGS.py b/test/Java/JAVACFLAGS.py
index ef084cd..ef084cd 100644
--- a/test/JAVACFLAGS.py
+++ b/test/Java/JAVACFLAGS.py
diff --git a/test/JAVAH.py b/test/Java/JAVAH.py
index b70fde0..b70fde0 100644
--- a/test/JAVAH.py
+++ b/test/Java/JAVAH.py
diff --git a/test/Java/JAVAHCOM.py b/test/Java/JAVAHCOM.py
new file mode 100644
index 0000000..1cc4208
--- /dev/null
+++ b/test/Java/JAVAHCOM.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $JAVAHCOM construction variable.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myjavah.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*javah*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'javah'],
+ JAVAHCOM = r'%(python)s myjavah.py $TARGET $SOURCES')
+env.JavaH(target = 'out', source = 'file1.class')
+env.JavaH(target = 'out', source = 'file2.class')
+env.JavaH(target = 'out', source = 'file3.class')
+""" % locals())
+
+test.write('file1.class', "file1.class\n/*javah*/\n")
+test.write('file2.class', "file2.class\n/*javah*/\n")
+test.write('file3.class', "file3.class\n/*javah*/\n")
+
+test.run()
+
+test.must_match(['out', 'file1.h'], "file1.class\n")
+test.must_match(['out', 'file2.h'], "file2.class\n")
+test.must_match(['out', 'file3.h'], "file3.class\n")
+
+
+
+test.pass_test()
diff --git a/test/Java/JAVAHCOMSTR.py b/test/Java/JAVAHCOMSTR.py
new file mode 100644
index 0000000..2a14e1c
--- /dev/null
+++ b/test/Java/JAVAHCOMSTR.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $JAVAHCOMSTR construction variable allows you to configure
+the javah output.
+"""
+
+import os.path
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+test.subdir('src')
+
+
+
+out_file1_h = os.path.join('out', 'file1.h')
+out_file2_h = os.path.join('out', 'file2.h')
+out_file3_h = os.path.join('out', 'file3.h')
+
+
+
+test.write('myjavah.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*javah*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'javah'],
+ JAVAHCOM = r'%(python)s myjavah.py $TARGET $SOURCES',
+ JAVAHCOMSTR = 'Building javah $TARGET from $SOURCES')
+env.JavaH(target = 'out', source = 'file1.class')
+env.JavaH(target = 'out', source = 'file2.class')
+env.JavaH(target = 'out', source = 'file3.class')
+""" % locals())
+
+test.write('file1.class', "file1.class\n/*javah*/\n")
+test.write('file2.class', "file2.class\n/*javah*/\n")
+test.write('file3.class', "file3.class\n/*javah*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+Building javah %(out_file1_h)s from file1.class
+Building javah %(out_file2_h)s from file2.class
+Building javah %(out_file3_h)s from file3.class
+""" % locals()))
+
+test.must_match(['out', 'file1.h'], "file1.class\n")
+test.must_match(['out', 'file2.h'], "file2.class\n")
+test.must_match(['out', 'file3.h'], "file3.class\n")
+
+
+
+test.pass_test()
diff --git a/test/RMIC.py b/test/Java/RMIC.py
index 8f3623c..8f3623c 100644
--- a/test/RMIC.py
+++ b/test/Java/RMIC.py
diff --git a/test/Java/RMICCOM.py b/test/Java/RMICCOM.py
new file mode 100644
index 0000000..109c22e
--- /dev/null
+++ b/test/Java/RMICCOM.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $RMICCOM construction variable.
+"""
+
+import os.path
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+test.subdir('src')
+
+
+
+out_file1 = os.path.join('out', 'file1', 'class_Skel.class')
+out_file2 = os.path.join('out', 'file2', 'class_Skel.class')
+out_file3 = os.path.join('out', 'file3', 'class_Skel.class')
+
+
+
+test.write('myrmic.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*rmic*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'rmic'],
+ RMICCOM = r'%(python)s myrmic.py $TARGET $SOURCES')
+env.RMIC(target = 'out', source = 'file1.class')
+env.RMIC(target = 'out', source = 'file2.class')
+env.RMIC(target = 'out', source = 'file3.class')
+""" % locals())
+
+test.write('file1.class', "file1.class\n/*rmic*/\n")
+test.write('file2.class', "file2.class\n/*rmic*/\n")
+test.write('file3.class', "file3.class\n/*rmic*/\n")
+
+test.run()
+
+test.must_match(out_file1, "file1.class\n")
+test.must_match(out_file2, "file2.class\n")
+test.must_match(out_file3, "file3.class\n")
+
+
+
+test.pass_test()
diff --git a/test/Java/RMICCOMSTR.py b/test/Java/RMICCOMSTR.py
new file mode 100644
index 0000000..1bcf300
--- /dev/null
+++ b/test/Java/RMICCOMSTR.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $RMICCOMSTR construction variable allows you to configure
+the rmic output.
+"""
+
+import os.path
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+test.subdir('src')
+
+
+
+out_file1 = os.path.join('out', 'file1', 'class_Skel.class')
+out_file2 = os.path.join('out', 'file2', 'class_Skel.class')
+out_file3 = os.path.join('out', 'file3', 'class_Skel.class')
+
+
+
+test.write('myrmic.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*rmic*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['default', 'rmic'],
+ RMICCOM = r'%(python)s myrmic.py $TARGET $SOURCES',
+ RMICCOMSTR = 'Building rmic $TARGET from $SOURCES')
+env.RMIC(target = 'out', source = 'file1.class')
+env.RMIC(target = 'out', source = 'file2.class')
+env.RMIC(target = 'out', source = 'file3.class')
+""" % locals())
+
+test.write('file1.class', "file1.class\n/*rmic*/\n")
+test.write('file2.class', "file2.class\n/*rmic*/\n")
+test.write('file3.class', "file3.class\n/*rmic*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+Building rmic %(out_file1)s from file1.class
+Building rmic %(out_file2)s from file2.class
+Building rmic %(out_file3)s from file3.class
+""" % locals()))
+
+test.must_match(out_file1, "file1.class\n")
+test.must_match(out_file2, "file2.class\n")
+test.must_match(out_file3, "file3.class\n")
+
+
+
+test.pass_test()