Table of Contents
Schmant is started with the startup script schmant.sh
or schmant.bat
, depending on the operating
system on which it is run.
The startup script searches for a java
command using the algorithm described
in the section called “Which Java? (Unix)” or the section called “Which Java? (Windows)”, then
it uses that java
command to launch
the Launcher class. Launcher prepares the scripting
environment (see the scripting language guides) and invokes the
build script.
Most script languages require that the script language implementation JARs
are on the classpath. Either put them on the classpath manually, or put them in
the Schmant installation's libengine
directory.
A large number of different arguments can be given to the startup script. However, except for the script file, none of them are mandatory. The default settings of the startup script should work fine in many cases.
On Unix (Linux, Solaris, Mac OS X, etc.), Schmant is run with the bin/schmant.sh
command.
schmant.sh
[-a scripts
] [-c
{ isolated | shared }
] [-cp path
] [-i fqn
] [-k] [-j arg
...] [--java path
] [-p key
=value
...] [-r fqn
] [-rlf fqn
] [--script-executor-implementation fqn
] [-t path
] [--trace] [ -v... | -q... ] { -h | -l | file
} [arg
...]
scripts
| --prepare-scripts scripts
]A list of custom environment preparation script files. The
scripts are run in the order that they are listed. The default, script environment-specific
preparation script can be included in the list by inserting a capital
X
in any
position. If this argument is omitted, only the default environment preparation
script is run.
See the scripting language guides for more information on the different environment preparation scripts.
Different path entries are separated by colons (:). Path entries are either absolute or relative to the directory of the build script.
Choose the class loading strategy for task packages. The default strategy is shared. See the section called “Class loaders”.
path
| --classpath path
]Insert this classpath first in the script classpath. Different path entries are separated by colons (:). Path entries are either absolute or relative to the directory of the build script.
Print usage instructions and exit.
fqn
| --argument-interpreter fqn
]The fully qualified class name of the ArgumentInterpreter implementation to use.
arg
| --jvmarg arg
...]Give an argument to the JVM used to run Schmant (for instance
-j -Xmx512m
to set the maximum available memory
size to 512MB). Use several times to give several arguments.
If the argument contains spaces, =
characters or other characters that the shell interpreter has special treatment
for, it has to be quoted in double ("
) or single
('
) quotes.
path
]Use the specified Java installation to run Schmant. The path
should be the path to the root directory of the Java installation, for instance
--java /opt/jdk1.6.0_12
.
Keep all temporary files and directories created with TempFileUtil. If this flag is not given, all temporary files and directories that the build script has not explicitly told TempFileUtil to keep are deleted when Schmant exits.
List all available org.schmant.ScriptExecutorFactory implementations and exit.
key
=value
| --property key
=value
...]Set a script property. The property will be available for the
build script in the props
Properties
variable. Give the argument several times to set several properties. See
the section called “Properties and arguments”.
Decrease the level of verbosity. (Make Schmant print less information about what it is doing.) Use the flag several times to make Schmant even more quiet. See the section called “Reports and logging”.
fqn
| --report-factory fqn
]The fully qualified class name of the ReportFactory to be used for creating the build reports. Default is the StdoutReportFactory. See the section called “Reports and logging”.
fqn
| --report-line-formatter fqn
]The fully qualified class name of the ReportLineFormatter to be used for formatting text lines that are logged to a Report. Default is the SimpleReportLineFormatter. See the section called “Reports and logging”.
fqn
]The fully qualified class name for the ScriptExecutor implementation to use for running the build script. If this argument is not given, a ScriptExecutor is looked up using the script file extension.
path
| --taskpath path
]Set the path to additional task packages, in addition to the task packages bundled with Schmant. Task packages may be either task package Zip files, or the root directory of an unpacked Zip file, just like Jar files and class directories are used in the Java classpath.
Different path entries are separated by colons (:). Path entries are either absolute or relative to the directory of the build script.
Extra task package path entries are prepended to the task package path string, and thus
take precedence over task directories in the standard task package
path. (The $SCHMANT_HOME/task
directory.) See
Chapter 6, Task packages.
Enable trace mode from the start. Trace mode means that a task's configuration always is logged before it is run.
Increase the level of verbosity. (Make Schmant print more information about what it is doing.) Use the flag several times to make Schmant even more verbose. See the section called “Reports and logging”.
file
The path to the script file to run. To run a script stored in a
Zip, Jar, War or Ear file, use the format
path_to_archive
#path_to_script_in_archive
.
arg
... A list of script arguments. All arguments given here are bound
to the List<String> args
in
the script.
JAVA_HOME
If set, the JDK installation referenced will be used to run Schmant.
JVM_ARGS
Can be used instead of or together with the -j argument to set JVM options.
PROG_ARGS
Arguments that are fed directly to the Launcher class, the class used to launch Schmant.
TASK_PACKAGE_PATH
Task package path that is prepended to the default task package
path. The default task package path contains all task packages that are bundled
with Schmant. This is ignored if the -t
argument is used.
Some tasks use other environment variables in addition to those listed above.
The schmant.sh
script uses the following strategy for locating the
java
command that it will use to launch Schmant:
If the JAVA_HOME
environment variable is set, look for an
executable $JAVA_HOME/bin/java
file.
Look for an executable java
file in the directories referenced by the PATH
environment variable.
If no java
command is found, the start script exits with an error message.
If the script exits with an UnsupportedClassVersionError
,
the Java installation found by the script is older than 6.0.
On Windows, Schmant is run with the bin\schmant.bat
command.
schmant.bat
[-a scripts
] [-c
{ isolated | shared }
] [-cp path
] [-i fqn
] [-j arg
...] [--java path
] [-k] [-p "key
=value
"...] [-r fqn
] [-rlf fqn
] [--script-executor-implementation fqn
] [-t dirs
] [--trace] [ -v... | -q... ] { -h | -l | file
} [arg
...]
scripts
| --prepare-scripts scripts
]A list of custom environment preparation script files. The
scripts are run in the order that they are listed. The default, script environment-specific
preparation script can be included in the list by inserting a capital
X
in any
position. If this argument is omitted, only the default environment preparation
script is run.
See the scripting language guides for more information on environment preparation scripts.
Different path entries are separated by semi colons (;). Path entries are either absolute or relative to the directory of the build script.
Choose the class loading strategy for task packages. The default strategy is shared. See the section called “Class loaders”.
path
| --classpath path
]Insert this classpath first in the script classpath. Different path entries are separated by semi colons (;). Path entries are either absolute or relative to the directory of the build script.
If there are several entries on the classpath, or if the entry on the classpath contains spaces, the classpath argument (only the path part) has to be quoted in ":s
Print usage instructions and exit.
fqn
| --argument-interpreter fqn
]The fully qualified class name of the ArgumentInterpreter implementation to use.
arg
| --jvmarg arg
...]Give an argument to the JVM used to run Schmant (for instance
-j -Xmx512m
to set the maximum available memory
size to 512MB).
If the argument contains spaces or equals signs (for instance when
assigning a Java system property), enclose the argument in quotes
("
).
Use several times to give several arguments.
path
]Use the specified Java installation to run Schmant. The path
should be the path to the root directory of the Java installation. If it contains
spaces, it must be quoted in citation marks, for instance
--java "c:\Program Files\Java\jdk1.6.0_12"
.
Keep all temporary files and directories created with TempFileUtil. If this flag is not given, all temporary files and directories that the build script has not explicitly told TempFileUtil to keep are deleted when Schmant exits.
List all available org.schmant.ScriptExecutorFactory implementations and exit.
key
=value
" | --property "key
=value
" ...]Set a script property. The property will be available for the
build script in the props
Properties
variable. The property assignment must be enclosed in quotes. Give the
argument several times to set several properties. See
the section called “Properties and arguments”.
Decrease the level of verbosity. (Make Schmant print less information about what it is doing.) Use the flag several times to make Schmant even more quiet. See the section called “Reports and logging”.
fqn
| --report-factory fqn
]The fully qualified class name of the ReportFactory to use for creating the build reports. Default is the StdoutReportFactory. See the section called “Reports and logging”.
fqn
| --report-line-formatter fqn
]The fully qualified class name of the ReportLineFormatter to be used for formatting text lines that are logged to a Report. Default is the SimpleReportLineFormatter. See the section called “Reports and logging”.
fqn
]The fully qualified class name for the ScriptExecutor implementation to use for running the build script. If this argument is not given, a ScriptExecutor is looked up using the script file extension.
path
| --taskpath path
]Set the path to additional task packages, in addition to the task packages bundled with Schmant. Task packages may be either task package Zip files, or the root directory of an unpacked Zip file, just like Jar files and class directories are used in the Java classpath.
Different path entries are separated by semicolons (;). Path entries are either absolute or relative to the directory of the build script.
Extra task package path entries are prepended to the task package path string, and thus
take precedence over task directories in the standard task package
path. (The $SCHMANT_HOME/task
directory.) See
Chapter 6, Task packages.
Enable trace mode from the start. Trace mode means that a task's configuration always is logged before it is run.
Increase the level of verbosity. (Make Schmant print more information about what it is doing.) Use the flag several times to make Schmant even more verbose. See the section called “Reports and logging”.
file
The path to the script file to run. To run a script stored in a
Zip, Jar, War or Ear file, use the format
path_to_archive
#path_to_script_in_archive
.
arg
... A list of script arguments. All arguments given here are bound
to the List<String> args
in
the script.
JAVA_HOME
If set, the JDK installation referenced will be used to run Schmant.
JVM_ARGS
Can be used instead of or together with the -j argument to set JVM options.
PROG_ARGS
Arguments that are fed directly to the Launcher class, the class used to launch Schmant.
TASK_PACKAGE_PATH
Task package path that is prepended to the default task package
path. The default task package path contains all task packages that are bundled
with Schmant. This is ignored if the -t
argument is used.
Some tasks use other environment variables in addition to those listed above.
The script uses the following strategy for locating the
java.exe
command that it will use to launch Schmant:
If the JAVA_HOME
environment variable is set, look for an
executable $JAVA_HOME\bin\java.exe
file. The
JAVA_HOME
environment variable must not contain any quotes.
Look for an executable java.exe
file in the directories referenced by the PATH
environment variable.
If no java.exe
command is found, the start script exits with an error message.
If the script exits with an UnsupportedClassVersionError
,
the Java installation found by the script is older than 6.0.