Example index
Groovy
JavaScript
JRuby
Jython
Groovy
- AntTF
- Example 1 – Run an Ant script from a file
- At4JZipTF
- Example 4 – Create a Zip archive with custom metadata for its entries.
- BZip2TF
- Example 1 – Compress a file using the bzip2 algorithm.
- Example 2 – Compress two files using the bzip2 algorithm. Share an executor
service between the tasks.
- ExtJavadocTF
- Example 2 – Create PDF API documentation.
- GZipTF
- Example 2 – Put inline text in a gzip compressed file.
- HtmlLinkValidationTF
- Example 1 – Validate links in all HTML files in the directory
hierarchy under the
doc directory. - JarTF
- Example 3 – Create a Jar archive and use a manually created
manifest.
- Jdk6JavacTF
- Example 2 – Compile all Java projects from a
ProjectRepository.
- RecursiveActionTF
- Example 4 – Compress all document files in a directory hieararchy.
- TarTF
- Example 4 – Create a Tar archive with custom metadata for its entries.
- TreeDeleteTF
- Example 4 – Delete all
.svn directories using an
Iterator. - WarTF
- Example 1 – Create a War archive.
- ZipTF
- Example 3 – Create a Zip archive with sources added in many
different ways.
JavaScript
- AddSystemIdToCatalogTF
- Example 1 – Add system ID-based entities to an XML catalog
- AddUriToCatalogTF
- Example 1 – Add URI-based entities to an XML catalog
- AntTF
- Example 1 – Run an Ant script from a file
- Example 2 – Run an inline Ant script
- Example 3 – Run an inline Ant script using
setSourceBody: - Example 4 – Run an inline Ant script using
setSourceTargetBody. - Example 5 – Run an inline Ant script using
setSourceTargetBody and Ant properties. - ApiLinksTF
- Example 1 – Replace fully qualified class names with API links in
Javadocs.
- Example 2 – Use an explicit package link with the API link insertion task.
- ArgumentInterpreterLinksTF
- Example 1 – Insert links to the argument interpreter documentation in HTML files.
- At4JUnzipTF
- Example 1 – Extract contents from a Zip archive
- Example 2 – Extract text files from a Zip archive.
- At4JZipTF
- Example 1 – Create a Zip archive
- Example 2 – Create a Zip archive, ignoring all
.svn directories. - Example 3 – Create a Zip archive with sources added in many
different ways.
- Example 4 – Create a Zip archive with custom metadata for its entries.
- Example 5 – Create a Zip archive that uses a directory-specific rule.
- BZip2TF
- Example 1 – Compress a file using the bzip2 algorithm.
- Example 2 – Compress two files using the bzip2 algorithm. Share an executor
service between the tasks.
- ChmodTF
- Example 1 – Change the mode of the
schmant.sh
script to executable by everyone. - CopyTF
- Example 1 – Copy the file
f to the directory
d. - Example 2 – Copy the file
f to a future entity.
- Example 3 – Copy the file
f to the directory
d, represented as a FutureDirectory.
- Example 4 – Copy the directory
src to the directory
d. - Example 5 – Copy all files from the directory hierarchy under
d to the directory flat_d. - Example 6 – Copy the contents of an URL.
- Example 7 – Create a property file with build information.
- Example 8 – Copy the files
f1 and f2 to the directory
d. - EarTF
- Example 1 – Create an Ear archive.
- ErrorIgnoringTF
- Example 1 – Copy Java source files from a directory hierarchy to a single
directory and ignore errors from duplicate file names.
- ExtFindbugsTF
- Example 1 – Run Findbugs on a set of Java projects.
- ExtJarSignerTF
- Example 1 – Sign a JAR using a private key in a PKCS#12 file.
- ExtJavacTF
- Example 1 – Compile source files in the directory hierarchy
under
src. - Example 2 – Compile all non-test classes from
src.
- ExtJavadocTF
- Example 1 – Create HTML API documentation.
- Example 2 – Create PDF API documentation.
- Example 3 – Create HTML API documentation with custom tags.
- ExtProcessTF
- Example 1 – Run the
wget command to get the front
page from www.dn.se. - ForEachSourceTF
- Example 1 – Copy every entity matching a glob pattern to another
directory.
- FormatCharacterFileTF
- Example 1 – Emulate the
unix2dos command and
convert the character file foo.txt. - Example 2 – Convert all text files in a directory hierarchy.
- Example 3 – Convert all text files in a directory hierarchy, overwriting
the old files.
- GZipTF
- Example 1 – Compress a file using the gzip algorithm.
- Example 2 – Put inline text in a gzip compressed file.
- HtmlLinkValidationTF
- Example 1 – Validate links in all HTML files in the directory
hierarchy under the
doc directory. - IncludeFilesTF
- Example 1 – Include contents of other files.
- JarTF
- Example 1 – Create a Jar archive from the class files in the
directory hierarchy under
d1. - Example 2 – Create a Jar archive and use a provided manifest
file.
- Example 3 – Create a Jar archive and use a manually created
manifest.
- Example 4 – Create a Jar archive with a
META-INF/services entry. - JavaWorkspaceBuilderTF
- Example 1 – Build all Java projects in a workspace.
- Example 2 – Preprocess source files and build all Java projects in a workspace.
- Example 3 – Build all Java projects in a workspace, giving each project
its own target directory.
- Jdk6JavacTF
- Example 1 – Compile source files in the directory hierarchy
under
src. - Example 2 – Compile all Java projects from a
ProjectRepository.
- JUnit4TF
- Example 1 – Run a JUnit 4 test suite.
- Example 2 – Run two test suites and use a
JUnit4TestSuiteReporter to generate a
report.
- LzmaTF
- Example 1 – Compress a file using the LZMA algorithm.
- MoveTF
- Example 1 – Move all Java files in the directory hierarchy under
d to the jDir directory. - Example 2 – Move all Java files in the directory hierarchy under
d to a directory hierarchy under jDir. - RecursiveActionTF
- Example 1 – Make all script files in a directory hierarchy under
d1 executable. - Example 2 – Replace text in several text files.
- Example 3 – Replace text in several text files and use a
TaskExecutor for running the tasks.
- Example 4 – Compress all document files in a directory hieararchy.
- RecursiveProcessTF
- Example 1 – Implement TreeCopyTF using
RecursiveProcessTF. - Example 2 – Pre-process Java source files from the
src directory hierarchy. - Example 3 – Move Java classes and change their file name
extensions.
- Example 4 – Move text files and change their names to be in upper case.
- RedirectReportTF
- Example 1 – Redirect the report to a file when running a task.
- ScriptTF
- Example 1 – Use a
ScriptTF to delete the file
f. - Example 2 – Change the file name extension of all Java files in
the directory hierarchy under
src to txt. - SvnExportTF
- Example 1 – Export the contents of a Subversion repository.
- SvnUrlToUrlCopyTF
- Example 1 – Copy the contents of the Subversion respository's trunk to
tags/1.0
- TarTF
- Example 1 – Create a Tar archive
- Example 2 – Create a Tar archive, ignoring all
.svn directories. - Example 3 – Create a Tar archive with sources added in many
different ways.
- Example 4 – Create a Tar archive with custom metadata for its entries.
- Example 5 – Create a Tar archive that uses a directory-specific rule.
- TaskFactoryLinksTF
- Example 1 – Insert links to the task factory reference in HTML files.
- TextAppendTF
- Example 1 – Append a short text to all Java files in a directory
hierarchy.
- TextPrependTF
- Example 1 – Prepend a short text to all Java files in a directory
hierarchy.
- TextReplaceTF
- Example 1 – Replace all occurrences of a string in text files in a
directory hierarchy.
- Example 2 – Text replacement using a TextReplacer.
- Example 3 – Replace text, getting the text to insert from an external
file.
- Example 4 – Use capturing groups to insert text in a file
- Example 5 – Use capturing groups to insert text in a file (#2)
- Example 6 – Use a property replacement text strategy to insert values for
placeholders in a text.
- TreeCopyTF
- Example 1 – Copy all files and subdirectories of
d1
to d2. - Example 2 – Copy all XML files in
d1 to
d2. Note that this do not copy the contents of any of d1's
subdirectories since the directories in d1 are made invisible by
the view filter. - Example 3 – Copy all XML files in
d1:s directory
hierarchy to a directory hierarchy under d2. - Example 4 – Copy all XML files in
d1:s directory
hierarchy to a directory hierarchy under d2. - Example 5 – Copy a directory hierarchy using a combination of
RecursiveProcessTF and CopyTF. - TreeDeleteTF
- Example 1 – Delete all files and subdirectories of
d1. - Example 2 – Delete all
.svn directories in
d1's directory hierarchy. - Example 3 – Delete all
.svn directories
using RecursiveActionTF and TreeDeleteTF.
- Example 4 – Delete all
.svn directories using an
Iterator. - UntarTF
- Example 1 – Extract the contents of a Tar archive.
- Example 2 – Extract text files from a Tar archive.
- WarTF
- Example 1 – Create a War archive.
- Example 2 – Create a War archive.
- XsltTF
- Example 1 – Run an XSL transformation of a document.
- Example 2 – Run XSL transformations of all XML files in a directory
hierarchy.
- Example 3 – Run XSL transformations of all XML files in a
directory hierarchy, using a TaskExecutor for running the tasks.
- Example 4 – Run XSL transformations of all XML files in a directory
hierarchy, using an XML catalog for resolving external entities.
- Example 5 – Build a Docbook multi-page HTML manual from an XML file.
- Example 6 – Build a Docbook multi-page HTML manual from an XML file
(recommended solution).
- ZipTF
- Example 1 – Create a Zip archive
- Example 2 – Create a Zip archive, ignoring all
.svn directories. - Example 3 – Create a Zip archive with sources added in many
different ways.
JRuby
- ApiLinksTF
- Example 1 – Replace fully qualified class names with API links in
Javadocs.
- ArgumentInterpreterLinksTF
- Example 1 – Insert links to the argument interpreter documentation in HTML files.
- At4JZipTF
- Example 4 – Create a Zip archive with custom metadata for its entries.
- BZip2TF
- Example 2 – Compress two files using the bzip2 algorithm. Share an executor
service between the tasks.
- ExtFindbugsTF
- Example 1 – Run Findbugs on a set of Java projects.
- ExtJavacTF
- Example 2 – Compile all non-test classes from
src.
- GZipTF
- Example 1 – Compress a file using the gzip algorithm.
- HtmlLinkValidationTF
- Example 1 – Validate links in all HTML files in the directory
hierarchy under the
doc directory. - JarTF
- Example 3 – Create a Jar archive and use a manually created
manifest.
- JavaWorkspaceBuilderTF
- Example 1 – Build all Java projects in a workspace.
- Jdk6JavacTF
- Example 2 – Compile all Java projects from a
ProjectRepository.
- JUnit4TF
- Example 2 – Run two test suites and use a
JUnit4TestSuiteReporter to generate a
report.
- RecursiveActionTF
- Example 4 – Compress all document files in a directory hieararchy.
- RecursiveProcessTF
- Example 4 – Move text files and change their names to be in upper case.
- ScriptTF
- Example 2 – Change the file name extension of all Java files in
the directory hierarchy under
src to txt. - SvnExportTF
- Example 1 – Export the contents of a Subversion repository.
- TarTF
- Example 4 – Create a Tar archive with custom metadata for its entries.
- TextReplaceTF
- Example 3 – Replace text, getting the text to insert from an external
file.
- TreeDeleteTF
- Example 4 – Delete all
.svn directories using an
Iterator. - XsltTF
- Example 6 – Build a Docbook multi-page HTML manual from an XML file
(recommended solution).
- ZipTF
- Example 3 – Create a Zip archive with sources added in many
different ways.
Jython
- AntTF
- Example 1 – Run an Ant script from a file
- ApiLinksTF
- Example 1 – Replace fully qualified class names with API links in
Javadocs.
- ArgumentInterpreterLinksTF
- Example 1 – Insert links to the argument interpreter documentation in HTML files.
- At4JZipTF
- Example 4 – Create a Zip archive with custom metadata for its entries.
- BZip2TF
- Example 2 – Compress two files using the bzip2 algorithm. Share an executor
service between the tasks.
- ExtFindbugsTF
- Example 1 – Run Findbugs on a set of Java projects.
- HtmlLinkValidationTF
- Example 1 – Validate links in all HTML files in the directory
hierarchy under the
doc directory. - JarTF
- Example 3 – Create a Jar archive and use a manually created
manifest.
- JavaWorkspaceBuilderTF
- Example 1 – Build all Java projects in a workspace.
- Jdk6JavacTF
- Example 2 – Compile all Java projects from a
ProjectRepository.
- JUnit4TF
- Example 2 – Run two test suites and use a
JUnit4TestSuiteReporter to generate a
report.
- RecursiveActionTF
- Example 4 – Compress all document files in a directory hieararchy.
- RecursiveProcessTF
- Example 4 – Move text files and change their names to be in upper case.
- ScriptTF
- Example 2 – Change the file name extension of all Java files in
the directory hierarchy under
src to txt. - SvnExportTF
- Example 1 – Export the contents of a Subversion repository.
- TarTF
- Example 4 – Create a Tar archive with custom metadata for its entries.
- TextReplaceTF
- Example 3 – Replace text, getting the text to insert from an external
file.
- TreeDeleteTF
- Example 4 – Delete all
.svn directories using an
Iterator. - XsltTF
- Example 6 – Build a Docbook multi-page HTML manual from an XML file
(recommended solution).
- ZipTF
- Example 3 – Create a Zip archive with sources added in many
different ways.
Building task package documentation
The task package documentation can be built after installing Schmant using
the tools/build_task_reference_docs.js script.
By default, Schmant comes bundled with task reference documentation for only
the task packages that are included in the distribution. By building the task
reference documentation after installing Schmant, it can be made to include the
documentation for all locally installed task packages too.
Unix
To build the task reference documentation on Unix, cd to the
$SCHMANT_HOME directory and execute the following script (on one line):
bin/schmant.sh -cp optlib/xalan.jar:optlib/xalan-serializer.jar \
-j "-Dfile.encoding=utf8" \
build/build_task_reference_docs.js path to additional task packages \
target directory
For example:
bin/schmant.sh -cp optlib/xalan.jar:optlib/xalan-serializer.jar \
-j "-Dfile.encoding=utf8" build/build_task_reference_docs.js \
/home/kalle/java/schmant-task-package-emma-1.0.zip:/home/kalle/java/schmant-task-package-pdfdoclet-1.0.zip \
doc/taskref
Windows
To build the task reference documentation on Windows, cd to the
$SCHMANT_HOME directory and execute the following script (on one line):
bin\schmant -cp "optlib\xalan.jar;optlib\xalan-serializer.jar" \
-j "-Dfile.encoding=utf8"
build\build_task_reference_docs.js path to additional task packages \
target directory
For example:
bin\schmant -cp "optlib\xalan.jar;optlib\xalan-serializer.jar" \
-j "-Dfile.encoding=utf8" build\build_task_reference_docs.js \
"c:\Documents and Settings\kalle\java\schmant-task-package-emma-1.0.zip" \
doc\taskref