Package com.carrotsearch.hppc.generator
Class TemplateProcessorMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.carrotsearch.hppc.generator.TemplateProcessorMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="template-processor",
defaultPhase=GENERATE_SOURCES,
threadSafe=true,
requiresProject=true)
public class TemplateProcessorMojo
extends org.apache.maven.plugin.AbstractMojo
Maven mojo applying preprocessor templates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
private final HashMap
<String, IntrinsicMethod> private Path
private org.apache.maven.project.MavenProject
private Path
private com.google.common.base.Stopwatch
private com.google.common.base.Stopwatch
private com.google.common.base.Stopwatch
private com.google.common.base.Stopwatch
private org.apache.velocity.runtime.RuntimeInstance
boolean
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List
<TemplateFile> collectTemplateFiles
(Path dir) Collect all template files from this and subdirectories.void
execute()
private void
execute0()
private String
filterComments
(String input) private String
filterIntrinsics
(String input, TemplateOptions templateOptions) private String
filterStaticTokens
(String template, TemplateOptions templateOptions) private String
filterTypeClassRefs
(String input, TemplateOptions options) private String
filterVelocity
(TemplateFile f, String template, TemplateOptions options) Apply velocity to the input.private void
generate
(TemplateFile input, List<OutputFile> outputs, TemplateOptions templateOptions) Apply templates.private List
<OutputFile> processTemplates
(List<TemplateFile> inputs) Apply templates to.ktype
files (single-argument).removeOtherFiles
(Path outputPath, List<OutputFile> keep) scanFilesMatching
(Path dir, String matchPattern) private String
targetFileName
(String relativePath, TemplateOptions templateOptions) private void
verboseLog
(String message) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
intrinsics
-
project
@Parameter(property="project", readonly=true, required=true) private org.apache.maven.project.MavenProject project -
verbose
@Parameter(defaultValue="false") public boolean verbose -
incremental
@Parameter(property="template.processor.incremental", defaultValue="true") public boolean incremental -
attachSources
-
templatesDir
-
outputDir
-
velocity
private org.apache.velocity.runtime.RuntimeInstance velocity -
templatesPath
-
outputPath
-
timeVelocity
private com.google.common.base.Stopwatch timeVelocity -
timeIntrinsics
private com.google.common.base.Stopwatch timeIntrinsics -
timeTypeClassRefs
private com.google.common.base.Stopwatch timeTypeClassRefs -
timeComments
private com.google.common.base.Stopwatch timeComments
-
-
Constructor Details
-
TemplateProcessorMojo
public TemplateProcessorMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute0
- Throws:
IOException
org.apache.maven.plugin.MojoExecutionException
-
removeOtherFiles
- Throws:
IOException
-
verboseLog
-
processTemplates
Apply templates to.ktype
files (single-argument).- Throws:
IOException
-
generate
private void generate(TemplateFile input, List<OutputFile> outputs, TemplateOptions templateOptions) throws IOException Apply templates.- Throws:
IOException
-
filterStaticTokens
-
filterIntrinsics
-
filterComments
-
filterTypeClassRefs
-
filterVelocity
Apply velocity to the input. -
targetFileName
-
scanFilesMatching
- Throws:
IOException
-
collectTemplateFiles
Collect all template files from this and subdirectories.- Throws:
IOException
-