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.AbstractMojoMaven mojo applying preprocessor templates.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringattachSourcesbooleanincrementalprivate java.util.HashMap<java.lang.String,IntrinsicMethod>intrinsicsjava.io.FileoutputDirprivate java.nio.file.PathoutputPathprivate org.apache.maven.project.MavenProjectprojectjava.io.FiletemplatesDirprivate java.nio.file.PathtemplatesPathprivate com.google.common.base.StopwatchtimeCommentsprivate com.google.common.base.StopwatchtimeIntrinsicsprivate com.google.common.base.StopwatchtimeTypeClassRefsprivate com.google.common.base.StopwatchtimeVelocityprivate org.apache.velocity.runtime.RuntimeInstancevelocitybooleanverbose
-
Constructor Summary
Constructors Constructor Description TemplateProcessorMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.List<TemplateFile>collectTemplateFiles(java.nio.file.Path dir)Collect all template files from this and subdirectories.voidexecute()private voidexecute0()private java.lang.StringfilterComments(java.lang.String input)private java.lang.StringfilterIntrinsics(java.lang.String input, TemplateOptions templateOptions)private java.lang.StringfilterStaticTokens(java.lang.String template, TemplateOptions templateOptions)private java.lang.StringfilterTypeClassRefs(java.lang.String input, TemplateOptions options)private java.lang.StringfilterVelocity(TemplateFile f, java.lang.String template, TemplateOptions options)Apply velocity to the input.private voidgenerate(TemplateFile input, java.util.List<OutputFile> outputs, TemplateOptions templateOptions)Apply templates.private java.util.List<OutputFile>processTemplates(java.util.List<TemplateFile> inputs)Apply templates to.ktypefiles (single-argument).private java.util.List<java.nio.file.Path>removeOtherFiles(java.nio.file.Path outputPath, java.util.List<OutputFile> keep)private java.util.List<java.nio.file.Path>scanFilesMatching(java.nio.file.Path dir, java.lang.String matchPattern)private java.lang.StringtargetFileName(java.lang.String relativePath, TemplateOptions templateOptions)private voidverboseLog(java.lang.String message)
-
-
-
Field Detail
-
intrinsics
private final java.util.HashMap<java.lang.String,IntrinsicMethod> 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
@Parameter(required=true) public java.lang.String attachSources
-
templatesDir
@Parameter(required=true) public java.io.File templatesDir
-
outputDir
@Parameter(required=true) public java.io.File outputDir
-
velocity
private org.apache.velocity.runtime.RuntimeInstance velocity
-
templatesPath
private java.nio.file.Path templatesPath
-
outputPath
private java.nio.file.Path 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
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute0
private void execute0() throws java.io.IOException, org.apache.maven.plugin.MojoExecutionException- Throws:
java.io.IOExceptionorg.apache.maven.plugin.MojoExecutionException
-
removeOtherFiles
private java.util.List<java.nio.file.Path> removeOtherFiles(java.nio.file.Path outputPath, java.util.List<OutputFile> keep) throws java.io.IOException- Throws:
java.io.IOException
-
verboseLog
private void verboseLog(java.lang.String message)
-
processTemplates
private java.util.List<OutputFile> processTemplates(java.util.List<TemplateFile> inputs) throws java.io.IOException
Apply templates to.ktypefiles (single-argument).- Throws:
java.io.IOException
-
generate
private void generate(TemplateFile input, java.util.List<OutputFile> outputs, TemplateOptions templateOptions) throws java.io.IOException
Apply templates.- Throws:
java.io.IOException
-
filterStaticTokens
private java.lang.String filterStaticTokens(java.lang.String template, TemplateOptions templateOptions)
-
filterIntrinsics
private java.lang.String filterIntrinsics(java.lang.String input, TemplateOptions templateOptions)
-
filterComments
private java.lang.String filterComments(java.lang.String input)
-
filterTypeClassRefs
private java.lang.String filterTypeClassRefs(java.lang.String input, TemplateOptions options)
-
filterVelocity
private java.lang.String filterVelocity(TemplateFile f, java.lang.String template, TemplateOptions options)
Apply velocity to the input.
-
targetFileName
private java.lang.String targetFileName(java.lang.String relativePath, TemplateOptions templateOptions)
-
scanFilesMatching
private java.util.List<java.nio.file.Path> scanFilesMatching(java.nio.file.Path dir, java.lang.String matchPattern) throws java.io.IOException- Throws:
java.io.IOException
-
collectTemplateFiles
private java.util.List<TemplateFile> collectTemplateFiles(java.nio.file.Path dir) throws java.io.IOException
Collect all template files from this and subdirectories.- Throws:
java.io.IOException
-
-