Class ProcessFilesTask
java.lang.Object
com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessFilesTask
- Direct Known Subclasses:
ProcessJSFilesTask
Abstract class for merging and compressing a files list.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClosureConfigprotected final booleanprotected final MojoMetadataprotected final FilenameInterpolatorprotected final FileProcessConfigprotected final Fileprotected final Filestatic final String -
Constructor Summary
ConstructorsConstructorDescriptionProcessFilesTask(MojoMetadata mojoMeta, FileProcessConfig processConfig, FileSpecifier fileSpecifier, ClosureConfig closureConfig) Task constructor. -
Method Summary
Modifier and TypeMethodDescriptioncall()Method executed by the thread.protected ProcessingResultCopies sourceFile to targetFile, making sure to inform the build context of the change.protected booleanhaveFilesChanged(Collection<File> sourceFiles, Collection<File> outputFiles) protected voidlogCompressionGains(List<File> srcFiles, String minified) Logs compression gains.protected ProcessingResultMerges a list of source files.protected voidCreates the given directory (and parents) and informs the build context.protected voidremoveMessages(Collection<File> files)
-
Field Details
-
TEMP_SUFFIX
- See Also:
-
mojoMeta
-
closureConfig
-
files
-
includesEmpty
protected final boolean includesEmpty -
outputFilenameInterpolator
-
processConfig
-
sourceDir
-
targetDir
-
-
Constructor Details
-
ProcessFilesTask
public ProcessFilesTask(MojoMetadata mojoMeta, FileProcessConfig processConfig, FileSpecifier fileSpecifier, ClosureConfig closureConfig) throws IOException Task constructor.- Parameters:
mojoMeta- Base mojo data.processConfig- Configuration for this file task.fileSpecifier- Details about the input / output files.closureConfig- Google closure configuration- Throws:
IOException
-
-
Method Details
-
call
Method executed by the thread.- Specified by:
callin interfaceCallable<Object>- Throws:
IOException- when the merge or minify steps failorg.apache.maven.plugin.MojoFailureException
-
removeMessages
-
logCompressionGains
Logs compression gains.- Parameters:
srcFiles- list of input files to compressminified- output file resulting from the minify step
-
mkDir
Creates the given directory (and parents) and informs the build context.- Parameters:
directory-
-
copy
Copies sourceFile to targetFile, making sure to inform the build context of the change.- Parameters:
sourceFile-targetFile-- Returns:
trueif execution was performed,falseif it was skipped (because files did not change).- Throws:
IOException
-
merge
Merges a list of source files. Create missing parent directories if needed.- Parameters:
mergedFile- output file resulting from the merged step- Throws:
IOException- when the merge step fails
-
haveFilesChanged
- Parameters:
sourceFiles-outputFiles-- Returns:
- Whether any change was made to the source / output files. If not, then we can skip the execution of the current bundle.
-