public abstract class AbstractIDLJMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Class and Description |
|---|---|
(package private) static interface |
AbstractIDLJMojo.DependenciesFacade |
(package private) static class |
AbstractIDLJMojo.DependenciesFacadeImpl |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
compiler
The compiler to use.
|
private boolean |
debug
Activate more detailed debug messages.
|
private AbstractIDLJMojo.DependenciesFacade |
dependencies
The interface between this class and the rest of the world - unit tests replace the default implementation.
|
private static AbstractIDLJMojo.DependenciesFacade |
DEPENDENCIES_FACADE
The default implementation of the dependencies.
|
private boolean |
failOnError
Should the plugin fail the build if there's an error while generating sources from IDLs.
|
private org.apache.maven.project.MavenProject |
project |
private org.apache.maven.project.MavenProjectHelper |
projectHelper
The maven project helper class for adding resources.
|
private java.util.List<Source> |
sources
A
List of Source configurations to compile. |
private int |
staleMillis
The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
|
private java.io.File |
timestampDirectory
The directory to store the processed grammars.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractIDLJMojo()
Creates the abstract class using a production implementation of the dependencies.
|
(package private) |
AbstractIDLJMojo(AbstractIDLJMojo.DependenciesFacade dependencies) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addCompileSourceRoot(java.io.File directory)
Add generated sources in compile source root
|
private java.util.Set<java.io.File> |
computeStaleGrammars(Source source)
Determine which idl files need to be compiled.
|
private void |
copyToTimestampDirectory(java.io.File idlFile) |
private CompilerTranslator |
createAppropriateTranslatorType() |
private org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner |
createIdlScanner(Source source) |
private void |
createIfAbsent(java.io.File directory) |
private CompilerTranslator |
createTranslator() |
void |
execute()
Execute the goal of the MOJO that is: compiling the IDL files
|
private void |
failIfNotWriteable(java.io.File directory) |
protected abstract java.io.File[] |
getIncludeDirs() |
private java.util.Set<java.lang.String> |
getNonNullSet(java.lang.String comment,
java.util.Set<java.lang.String> set,
java.lang.String... defaultValues) |
protected abstract java.io.File |
getOutputDirectory() |
protected org.apache.maven.project.MavenProject |
getProject() |
protected org.apache.maven.project.MavenProjectHelper |
getProjectHelper() |
protected abstract java.io.File |
getSourceDirectory() |
private java.util.Set<java.io.File> |
getStaleSources(org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner scanner,
java.io.File sourceDir) |
private boolean |
isExistingDirectory(java.io.File sourceDir) |
private boolean |
isSourceSpecified() |
private void |
prepareGeneratedSourceDirectory(java.io.File directory) |
private void |
processIdlFile(Source source,
CompilerTranslator translator,
java.io.File idlFile) |
private void |
processSource(Source source,
CompilerTranslator translator)
Compile the IDL files located in the given source path.
|
private void |
reportProcessingNeeded(java.util.Set<java.io.File> staleGrammars) |
private void |
translateIdlFile(java.io.File idlFile,
Source source,
CompilerTranslator translator) |
private void |
translateInferredSource(CompilerTranslator translator) |
private void |
translateSources(CompilerTranslator translator,
java.util.List<Source> sourceList) |
private java.util.Set<java.io.File> |
tryToGetStaleSources(org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner scanner,
java.io.File sourceDir) |
private java.util.List<Source> sources
List of Source configurations to compile.private boolean debug
private boolean failOnError
private org.apache.maven.project.MavenProject project
private int staleMillis
private org.apache.maven.project.MavenProjectHelper projectHelper
private java.io.File timestampDirectory
private java.lang.String compiler
private AbstractIDLJMojo.DependenciesFacade dependencies
private static final AbstractIDLJMojo.DependenciesFacade DEPENDENCIES_FACADE
protected AbstractIDLJMojo()
AbstractIDLJMojo(AbstractIDLJMojo.DependenciesFacade dependencies)
protected abstract java.io.File getSourceDirectory()
protected abstract java.io.File[] getIncludeDirs()
File[] of the directories to use as include directories for the compilationprotected abstract java.io.File getOutputDirectory()
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - if the compilation fails or the compiler crashesprivate void prepareGeneratedSourceDirectory(java.io.File directory)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate boolean isSourceSpecified()
private void translateInferredSource(CompilerTranslator translator) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void translateSources(CompilerTranslator translator, java.util.List<Source> sourceList) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate CompilerTranslator createTranslator() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate CompilerTranslator createAppropriateTranslatorType() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void failIfNotWriteable(java.io.File directory)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void createIfAbsent(java.io.File directory)
private void processSource(Source source, CompilerTranslator translator) throws org.apache.maven.plugin.MojoExecutionException
source - the Source that specify which file compile with arguments to use for the sourcetranslator - the CompilerTranslator that raprresents idl compiler backend that will be usedorg.apache.maven.plugin.MojoExecutionException - if the compilation fails or the compiler crashesprivate void processIdlFile(Source source, CompilerTranslator translator, java.io.File idlFile) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void translateIdlFile(java.io.File idlFile,
Source source,
CompilerTranslator translator)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void copyToTimestampDirectory(java.io.File idlFile)
throws org.apache.maven.plugin.MojoExecutionException,
java.io.IOException
org.apache.maven.plugin.MojoExecutionExceptionjava.io.IOExceptionprivate void reportProcessingNeeded(java.util.Set<java.io.File> staleGrammars)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate java.util.Set<java.io.File> computeStaleGrammars(Source source) throws org.apache.maven.plugin.MojoExecutionException
source - the Source that represents which files to compileorg.apache.maven.plugin.MojoExecutionException - if the selection of the files to compile failsprivate java.util.Set<java.io.File> getStaleSources(org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner scanner,
java.io.File sourceDir)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate java.util.Set<java.io.File> tryToGetStaleSources(org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner scanner,
java.io.File sourceDir)
throws org.codehaus.plexus.compiler.util.scan.InclusionScanException
org.codehaus.plexus.compiler.util.scan.InclusionScanExceptionprivate boolean isExistingDirectory(java.io.File sourceDir)
private org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner createIdlScanner(Source source)
private java.util.Set<java.lang.String> getNonNullSet(java.lang.String comment,
java.util.Set<java.lang.String> set,
java.lang.String... defaultValues)
protected abstract void addCompileSourceRoot(java.io.File directory)
directory - a directory containing generated java files to be compiled.protected org.apache.maven.project.MavenProject getProject()
MavenProject instanceprotected org.apache.maven.project.MavenProjectHelper getProjectHelper()
MavenProjectHelper instance