Schmant User's Guide

Revision History
Revision 1.0.12010.02.16

Table of Contents

1. Introduction
This manual
Learning Schmant
Please help!
License
2. Installing Schmant
Requirements
Downloading
Installing
Running unit tests (optional)
Running unit tests on Unix
Running unit tests on Windows
3. Running Schmant
Unix
Arguments
Environment variables
Which Java? (Unix)
Windows
Arguments
Environment variables
Which Java? (Windows)
Running Schmant from Java
4. Build scripts and tasks
A real-world example
Tasks and task factories
Interpreted arguments
Future entities
Producers
Recursive tasks
5. Environment and resources
Reports and logging
Schmant and EntityFS
Properties and arguments
Utility classes
Temporary files and directories
Including other script files
6. Task packages
7. Task executors
Closures
Dependencies for tasks with subtasks
Task executors and future entities
8. Projects
Building with the workspace builder task
Building manually
Eclipse workspaces
IntelliJ IDEA projects
9. Advanced topics
Class loaders
In-memory file systems
10. Best practices
Build scripts are programs
Use EntityFS file systems
Set a temporary directory
11. Troubleshooting
Increase the report level for the failing task
Trace log failing task configuration
Setting the number of build threads to one
Keeping temporary files
Using a remote debugger
A. ArgumentInterpreter
Argument philosophy
Interpretation process
java.io.File (file or directory)
java.io.File (directory)
java.net.URL
FutureEntity
NamedReadableFile
ReadableFile
Existing WritableFile
New WritableFile
RandomlyAccessibleFile
Read only entity holder
Read only Entity (file or directory)
Read only Directory
Read/write Directory
Read/write Entity (file or directory)
Read/write EFile
XML Source
ReadableFile implementations
NamedReadableFile implementations
WritableFile implementations
RandomlyAccessibleFile implementations
EntityView implementations
FutureEntityStrategy implementations
B. EntityFS cookbook
EntityFS overview
Interoperability with java.io classes
File systems
Entities
Directory views
Utility classes
EntityFilter implementations
Best practices
Bibliography

List of Figures

A.1. EntityFS EFile inheritance hierarchy (subset)

List of Tables

4.1. Target strategies
5.1. Report logging levels
8.1. ProjectFilter implementations
9.1. Build times for the Schmant workspace
9.2. Build and preprocess times for the Schmant workspace
A.1. Interpretation of an argument into a file or directory java.io.File
A.2. Interpretation of an argument into a java.net.URL
A.3. Interpretation of an argument into a FutureEntity
A.4. Interpretation of an argument into a NamedReadableFile
A.5. Interpretation of an argument into a ReadableFile
A.6. Interpretation of an argument into an existing WritableFile
A.7. Interpretation of an argument into a new WritableFile
A.8. Interpretation of an argument into a RandomlyAccessibleFile
A.9. Interpretation of an argument into an entity holder
A.10. Interpretation of an argument into a read only EntityView
A.11. Interpretation of an argument into a read only Directory
A.12. Interpretation of an argument into a read/write Directory
A.13. Interpretation of an argument into a read/write Entity
A.14. Interpretation of an argument into a read/write EFile
A.15. Interpretation of an argument into an XML Source
B.1. FileSystemBuilder implementations
B.2. EntityFS utility classes (useful subset)
B.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. Flattening an argument list
4.5. Using a produced file as the source in another task.
4.6. Set version information in all XML files in a directory hierarchy, overwriting the original files, using a recursive iterator.
4.7. Set version information in all XML files in a directory hierarchy, overwriting the original files, using a RecursiveActionTF
4.8. 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.9. Set version information in all XML files in a directory hierarchy, putting the target files in a new directory hierarchy.
4.10. 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. From Java files to EntityFS and back again
5.4. Using EntityFS property methods
5.5. 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. Reusing a task factory
7.3. Running a closure with a task executor
7.4. Using a closure instead of a task factory
7.5. Dependencies for task with subtasks
7.6. Using future files to represent files that do not yet exist
7.7. Computing statistics for an XML file
8.1. Build all projects in an Eclipse workspace using the workspace builder task.
8.2. Build all projects in an Eclipse workspace manually
8.3. Build a Jar file from the projects in an Eclipse workspace
8.4. Build a Jar file from the projects in an Eclipse workspace manually
8.5. Build an Eclipse workspace using a user-defined library
8.6. Preprocess source files in Eclipse projects. Compile. Build Jar
8.7. Preprocess source files in Eclipse projects. Compile manually. Build Jar
8.8. Build an IntelliJ workspace
9.1. Creating an in-memory temporary directory
10.1. Creating file systems for the build script
B.1. Creating source and target file systems
B.2. Using the SchmantReportLogAdapter