|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.enunciate.main.Enunciate
public class Enunciate
Main enunciate entry point.
| Nested Class Summary | |
|---|---|
class |
Enunciate.Stepper
Mechansim for stepping through the Enunciate build process. |
static class |
Enunciate.Target
The targets for the project. |
| Constructor Summary | |
|---|---|
protected |
Enunciate()
Protected to ensure the source files are set. |
|
Enunciate(List<String> sourceFiles)
Construct an enunciate mechanism on the specified source files. |
|
Enunciate(String[] sourceFiles)
Construct an enunciate mechanism on the specified source files. |
|
Enunciate(String[] sourceFiles,
EnunciateConfiguration config)
Construct an enunciate mechanism on the specified source files with the specified config. |
| Method Summary | |
|---|---|
boolean |
addArtifact(Artifact artifact)
Adds the specified artifact. |
void |
addExport(String artifactId,
File destination)
Adds an export. |
protected void |
buildFileList(List<File> list,
File... dirs)
Adds all files in specified directories to a list. |
void |
copyDir(File from,
File to)
Copy an entire directory from one place to another. |
void |
copyFile(File from,
File to)
Copy a file from one location to another. |
void |
copyFile(File src,
File fromDir,
File toDir)
Copy a file from one directory to another, preserving directory structure. |
void |
copyResource(String resource,
File to)
Copies a resource on the classpath to a file. |
void |
copyResource(URL url,
File to)
Copies a resource to a file. |
File |
createTempDir()
Creates a temporary directory. |
void |
debug(String message,
Object... formatArgs)
Handle a debug-level message. |
protected void |
doBuild(List<DeploymentModule> deploymentModules)
Do the build logic. |
protected void |
doClose(List<DeploymentModule> deploymentModules)
Logic for handling the closing of the Enunciate mechanism. |
protected void |
doCompile(List<DeploymentModule> deploymentModules)
Do the compile logic. |
protected void |
doGenerate(List<DeploymentModule> deploymentModules)
Do the generate logic. |
protected List<DeploymentModule> |
doInit()
Do the initialization logic. |
protected void |
doPackage(List<DeploymentModule> deploymentModules)
Do the package logic. |
void |
execute()
Execute the mechanism. |
void |
extractBase(InputStream baseIn,
File toDir)
Extracts the (zipped up) base to the specified directory. |
Artifact |
findArtifact(String artifactId)
Finds the artifact of the given id. |
Set<Artifact> |
getArtifacts()
The artifacts exportable by enunciate. |
File |
getBuildDir()
The directory to use to build the war. |
String |
getClasspath()
The classpath. |
File |
getCompileDir()
The destination directory for the compiled classes. |
EnunciateConfiguration |
getConfig()
|
File |
getConfigFile()
The enunciate config file. |
protected long |
getEarliestTimestamp(List<File> files)
Get the earliest timestamp of the specified files. |
String |
getEnunciateClasspath()
The enunciate classpath to use for javac and apt. |
Collection<String> |
getFiles(File basedir,
FileFilter filter)
Finds all files in the specified base directory using the specified filter. |
File |
getGenerateDir()
The preprocessor directory (-s). |
Collection<String> |
getJavaFiles(File basedir)
Finds all java files in the specified base directory. |
protected long |
getLatestTimestamp(List<File> files)
Get the latest timestamp of the specified files. |
File |
getPackageDir()
The package directory. |
Object |
getProperty(String property)
Get a property value. |
String[] |
getSourceFiles()
Get the source files for this enunciate mechanism. |
Enunciate.Stepper |
getStepper()
Get a stepper that can be used to step through the Enunciate mechanism, which will be initialized. |
Enunciate.Target |
getTarget()
The target. |
String |
getVersion()
The version of the Enunciate mechanism. |
void |
info(String message,
Object... formatArgs)
Handle an info-level message. |
protected void |
initModules(List<DeploymentModule> deploymentModules)
Initialize each module. |
protected void |
invokeApt(String[] sourceFiles,
String... additionalApiClasses)
Invokes APT on the specified source files. |
void |
invokeJavac(File compileDir,
String[] sourceFiles)
Invokes javac on the specified source files. |
void |
invokeJavac(String classpath,
File compileDir,
String[] sourceFiles)
Invokes javac on the specified source files. |
void |
invokeJavac(String classpath,
String version,
File compileDir,
List<String> additionalArgs,
String[] sourceFiles)
Invokes javac on the specified source files. |
boolean |
isDebug()
Whether to print debugging information. |
boolean |
isJavacCheck()
Whether to do a javac check before invoking the Enunciate mechanism. |
boolean |
isModuleEnabled(String moduleName)
Whether the specified module is enabled. |
boolean |
isUpToDate(File sourceFile,
File destFile)
Determines whether a destination file is newer than a source file. |
protected boolean |
isUpToDate(List<File> sourceFiles,
File destFile)
Whether a given destination file is newer than all the specified source files. |
boolean |
isUpToDateWithSources(File destDir)
Whether all files in the specified directory are newer than all the source files. |
boolean |
isVerbose()
Whether to be verbose. |
protected EnunciateConfiguration |
loadConfig()
Reads the enunciate configuration from the specified file, if any. |
static void |
main(String[] args)
|
File |
resolvePath(String filePath)
Resolves a path relative to the Enunciate config file, if present, otherwise the file will be a relative file to the current user directory. |
void |
setBuildDir(File buildDir)
The directory to use to build the war. |
void |
setClasspath(String classpath)
The classpath. |
void |
setCompileDir(File compileDir)
The destination directory for the compiled classes. |
void |
setConfig(EnunciateConfiguration config)
Set the configuration for the mechanism. |
void |
setConfigFile(File configFile)
The enunciate config file. |
void |
setDebug(boolean debug)
Whether to print debugging information. |
void |
setGenerateDir(File generateDir)
The preprocessor directory (-s). |
void |
setJavacCheck(boolean javacCheck)
Whether to do a javac check before invoking the Enunciate mechanism. |
void |
setPackageDir(File packageDir)
The package directory. |
void |
setProperty(String property,
Object value)
Set a property value. |
protected void |
setSourceFiles(String[] sourceFiles)
Protected to allow the source files to be set after construction. |
void |
setTarget(Enunciate.Target target)
The target. |
void |
setVerbose(boolean verbose)
Whether to be verbose. |
void |
warn(String message,
Object... formatArgs)
Handle a warn-level message. |
void |
zip(File toFile,
File... dirs)
zip up directories to a specified zip file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Enunciate()
public Enunciate(String[] sourceFiles)
sourceFiles - The source files.
public Enunciate(String[] sourceFiles,
EnunciateConfiguration config)
sourceFiles - The source files.config - The configpublic Enunciate(List<String> sourceFiles)
sourceFiles - The source files.| Method Detail |
|---|
public static void main(String[] args)
throws Exception
Exceptionprotected void setSourceFiles(String[] sourceFiles)
sourceFiles - The source files to enunciate.
public Enunciate.Stepper getStepper()
throws EnunciateException,
IOException
ConcurrentModificationException - If a stepper has already been retrieved.
EnunciateException - If there was an error initializing the Enunciate mechanism.
IOException - If there was an error initializing the Enunciate mechanism.
public void execute()
throws EnunciateException,
IOException
EnunciateException
IOException
protected void doClose(List<DeploymentModule> deploymentModules)
throws EnunciateException,
IOException
deploymentModules - The deployment modules to close.
EnunciateException
IOException
protected void doPackage(List<DeploymentModule> deploymentModules)
throws IOException,
EnunciateException
deploymentModules - The deployment modules to use.
IOException
EnunciateException
protected void doBuild(List<DeploymentModule> deploymentModules)
throws IOException,
EnunciateException
deploymentModules - The deployment modules to use.
IOException
EnunciateException
protected void doCompile(List<DeploymentModule> deploymentModules)
throws IOException,
EnunciateException
deploymentModules - The deployment modules to use.
IOException
EnunciateException
protected void doGenerate(List<DeploymentModule> deploymentModules)
throws IOException,
EnunciateException
deploymentModules - The deployment modules to use.
IOException
EnunciateException
protected List<DeploymentModule> doInit()
throws EnunciateException,
IOException
EnunciateException
IOException
protected void initModules(List<DeploymentModule> deploymentModules)
throws EnunciateException,
IOException
deploymentModules - The deployment modules.
EnunciateException
IOException
public void info(String message,
Object... formatArgs)
message - The info message.formatArgs - The format args of the message.
public void debug(String message,
Object... formatArgs)
message - The debug message.formatArgs - The format args of the message.
public void warn(String message,
Object... formatArgs)
message - The warn message.formatArgs - The format args of the message.
public File createTempDir()
throws IOException
IOExceptionpublic String[] getSourceFiles()
protected EnunciateConfiguration loadConfig()
throws IOException
IOExceptionpublic Collection<String> getJavaFiles(File basedir)
basedir - The base directory.
public Collection<String> getFiles(File basedir,
FileFilter filter)
basedir - The base directory.filter - The filter to use.
public String getEnunciateClasspath()
protected void invokeApt(String[] sourceFiles,
String... additionalApiClasses)
throws IOException,
EnunciateException
sourceFiles - The source files.additionalApiClasses - The FQNs of additional classes (should be found on the Enunciate classpath) that comprise the API.
IOException
EnunciateException
public void invokeJavac(File compileDir,
String[] sourceFiles)
throws EnunciateException
compileDir - The compile directory.sourceFiles - The source files.
EnunciateException - if the compile fails.
public void invokeJavac(String classpath,
File compileDir,
String[] sourceFiles)
throws EnunciateException
classpath - The classpath.compileDir - The compile directory.sourceFiles - The source files.
EnunciateException - if the compile fails.
public void invokeJavac(String classpath,
String version,
File compileDir,
List<String> additionalArgs,
String[] sourceFiles)
throws EnunciateException
classpath - The classpath.version - The Java version to compile to.compileDir - The compile directory.additionalArgs - Any additional arguments to the compiler.sourceFiles - The source files. @throws EnunciateException if the compile fails.
EnunciateException
public void copyDir(File from,
File to)
throws IOException
from - The source directory.to - The destination directory.
IOException
public void extractBase(InputStream baseIn,
File toDir)
throws IOException
baseIn - The stream to the base.toDir - The directory to extract to.
IOException
public void copyFile(File src,
File fromDir,
File toDir)
throws IOException
src - The source file.fromDir - The from directory.toDir - The to directory.
IOException
public void copyFile(File from,
File to)
throws IOException
from - The source file.to - The destination file.
IOException
public void copyResource(String resource,
File to)
throws IOException
resource - The resource to copy.to - The file to copy to.
IOException
public void copyResource(URL url,
File to)
throws IOException
url - The url of the resource.to - The file to copy to.
IOException
public void zip(File toFile,
File... dirs)
throws IOException
toFile - The file to zip to.dirs - The directories to zip up.
IOExceptionpublic File resolvePath(String filePath)
filePath - The file path to resolve.
public boolean isUpToDate(File sourceFile,
File destFile)
sourceFile - The source file.destFile - The destination file.
public boolean isUpToDateWithSources(File destDir)
destDir - The directory.
protected boolean isUpToDate(List<File> sourceFiles,
File destFile)
sourceFiles - The specified source files.destFile - The destination file.
protected long getLatestTimestamp(List<File> files)
files - The files.
protected long getEarliestTimestamp(List<File> files)
files - The files.
protected void buildFileList(List<File> list,
File... dirs)
list - The list.dirs - The directories.public boolean isVerbose()
public void setVerbose(boolean verbose)
verbose - Whether to be verbose.public boolean isDebug()
public void setDebug(boolean debug)
debug - Whether to print debugging information.public String getVersion()
public boolean isJavacCheck()
public void setJavacCheck(boolean javacCheck)
javacCheck - Whether to do a javac check before invoking the Enunciate mechanism.public File getConfigFile()
public void setConfigFile(File configFile)
configFile - The enunciate config file.public File getCompileDir()
public void setCompileDir(File compileDir)
compileDir - The destination directory for the compiled classes.public File getBuildDir()
public void setBuildDir(File buildDir)
buildDir - The directory to use to build the war.public File getPackageDir()
public void setPackageDir(File packageDir)
packageDir - The package directory.public File getGenerateDir()
public void setGenerateDir(File generateDir)
generateDir - The preprocessor directory (-s).public String getClasspath()
public void setClasspath(String classpath)
classpath - The classpath.public Enunciate.Target getTarget()
public void setTarget(Enunciate.Target target)
target - The target.
public void setProperty(String property,
Object value)
property - The property.value - The value.public Set<Artifact> getArtifacts()
public Artifact findArtifact(String artifactId)
artifactId - The id of the artifact.
public boolean addArtifact(Artifact artifact)
artifact - The artifact to add.
public void addExport(String artifactId,
File destination)
artifactId - The id of the artifact to export.destination - The file or directory to export the artifact to.public Object getProperty(String property)
property - The property whose value to retrieve.
public EnunciateConfiguration getConfig()
public boolean isModuleEnabled(String moduleName)
moduleName - The name of the module.
public void setConfig(EnunciateConfiguration config)
config - The configuration.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||