.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
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.
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.
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.
- 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:
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import SCons.Action
import SCons.Builder
import SCons.Util
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')
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
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)
import os.path
import string
+import SCons.Action
import SCons.Builder
import SCons.Node.FS
import SCons.Tool.javac
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,
import os.path
import string
+import SCons.Action
import SCons.Builder
import SCons.Node.FS
import SCons.Util
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,
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()
--- /dev/null
+#!/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()