Schmant User's Guide

Revision History
Revision 1.0-pre12007.03.15
Revision 1.0-pre22007.06.24
Revision 1.0-pre32007.07.30
Revision 1.0-pre42007.10.23
Revision 1.0-pre52008.02.05

Table of Contents

1. Introduction
This manual
Please help!
License
2. Installing Schmant
Requirements
Downloading
Installing
Installing JSR 223 script engines
Running unit tests (optional)
Running unit tests on Unix
Running unit tests on Windows
3. Running Schmant
Unix
Arguments
Environment variables
Which Java?
Windows
Arguments
Environment variables
Which Java?
Running Schmant from Java
4. Build scripts and tasks
A real-world example
Tasks and task factories
Interpreted properties
Future entities
Recursive tasks
5. Environment and resources
Reports and logging
Schmant and EntityFS
Using properties
Utility classes
Including other script files
6. Task packages
7. Task executors
Task executors and future entities
Configurators
8. Projects
Eclipse workspaces
IntelliJ IDEA projects
9. Writing your own tasks
Building a task package
10. Advanced topics
Class loaders
In-memory file systems
11. Best practices
Build scripts are programs
Use EntityFS file systems
Set a temporary directory
A. Script language support
JavaScript
Gotchas
BeanShell
B. ArgumentInterpreter
Argument philosophy
java.io.File (file or directory)
java.io.File (directory)
java.net.URL
FutureEntity
NamedReadableFile
ReadableFile
Read only Directory
Read only Entity (file or directory)
Read only EFile
Read/write Directory
Read/write Entity (file or directory)
Read/write EFile
ReadableFile implementations
NamedReadableFile implementations
EntityView implementations
FutureEntityStrategy implementations
C. EntityFS cookbook
EntityFS overview
File systems
Entities
Directory views
Utility classes
EntityFilter implementations
Best practices
Bibliography

List of Figures

B.1. EntityFS EFile inheritance hierarchy (subset)

List of Tables

4.1. Task types
4.2. Target strategies
5.1. Report logging levels
7.1. Configurator implementations
8.1. ProjectFilter implementations
10.1. Build times for the Schmant workspace
10.2. Build and preprocess times for the Schmant workspace
B.1. Interpretation of an argument into a file or directory java.io.File
B.2. Interpretation of an argument into a java.net.URL
B.3. Interpretation of an argument into a FutureEntity
B.4. Interpretation of an argument into a NamedReadableFile
B.5. Interpretation of an argument into a ReadableFile
B.6. Interpretation of an argument into a read only Directory
B.7. Interpretation of an argument into a read only Entity
B.8. Interpretation of an argument into a read only EFile
B.9. Interpretation of an argument into a read/write Directory
B.10. Interpretation of an argument into a read/write Entity
B.11. Interpretation of an argument into a read/write EFile
C.1. FileSystemBuilder implementations
C.2. EntityFS utility classes (useful subset)
C.3. EntityFilter implementations

List of Examples

4.1. A Hello World script
4.2. Compile Java files and build a Jar file
4.3. Using different source types with CopyTF
4.4. Set version information in all XML files in a directory hierarchy, overwriting the original files, using a recursive iterator.
4.5. Set version information in all XML files in a directory hierarchy, overwriting the original files, using a RecursiveActionTF
4.6. Set version information in all XML files in a directory hierarchy, putting the target files in a new directory hierarchy, using a recursive iterator.
4.7. Set version information in all XML files in a directory hierarchy, putting the target files in a new directory hierarchy.
4.8. Set version information in all XML files in a directory hierarchy, putting the target files in a two new directory hierarchies.
5.1. Iterating over files and directories
5.2. Hiding .svn directories when creating an EclipseWorkspace
5.3. Using EntityFS property methods
5.4. Using JdkUtil
6.1. Enabling the Findbugs task package and running Findbugs.
7.1. Compile Java files and build a Jar file, using a task executor
7.2. Creating preconfigured task factories
7.3. Using future entities to represent entities that do not yet exist
7.4. Computing statistics for an XML file
8.1. Build all projects in an Eclipse workspace
8.2. Build a Jar file from the projects in an Eclipse workspace
8.3. Build an Eclipse workspace using a user-defined library
8.4. Preprocess source files in Eclipse projects. Compile. Build Jar
8.5. Build an IntelliJ workspace
9.1. Implementation of MoveTask and MoveTF
9.2. Findbugs task package descriptor
10.1. Creating an in-memory temporary directory
11.1. Creating file systems for the build script
A.1. Including script files in a Zip archive
A.2. Reporting an error in a script
C.1. Creating source and target file systems
C.2. Using the SchmantReportLogAdapter