Package com.google.javascript.jscomp.ant
Class CompileTask
- java.lang.Object
-
- Task
-
- com.google.javascript.jscomp.ant.CompileTask
-
public final class CompileTask extends Task
This class implements a simple Ant task to do almost the same as CommandLineRunner. Most of the public methods of this class are entry points for the Ant code to hook into.
-
-
Constructor Summary
Constructors Constructor Description CompileTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExterns(FileList list)
Sets the externs file.void
addPath(Path list)
Adds aentry. void
addSources(FileList list)
Sets the source files.void
addWarning(Warning warning)
Adds aentry Each warning entry must have two attributes, group and level. Parameter
createDefine()
Creates a new<define/>
nested element.void
execute()
void
setCompilationLevel(java.lang.String value)
Set the compilation level.void
setCustomExternsOnly(boolean value)
Use only custom externs.void
setDebug(boolean value)
Enable debugging options.void
setEncoding(java.lang.String encoding)
Set input file encodingvoid
setForceRecompile(boolean forceRecompile)
Set force recompile optionvoid
setGenerateExports(boolean generateExports)
Set generateExports optionvoid
setLanguageIn(java.lang.String value)
Set the language to which input sources conform.void
setManageDependencies(boolean value)
void
setOutput(java.io.File value)
Set output file.void
setOutputEncoding(java.lang.String outputEncoding)
Set output file encodingvoid
setPrettyPrint(boolean pretty)
Set pretty print formatting optionvoid
setPrintInputDelimiter(boolean print)
Set print input delimiter formatting optionvoid
setReplaceProperties(boolean value)
Whether to replace@define
lines with propertiesvoid
setReplacePropertiesPrefix(java.lang.String value)
Set the replacement property prefix.void
setSourceMapFormat(java.lang.String format)
void
setSourceMapOutputFile(java.io.File sourceMapOutputFile)
void
setWarning(java.lang.String value)
Set the warning level.
-
-
-
Method Detail
-
setLanguageIn
public void setLanguageIn(java.lang.String value)
Set the language to which input sources conform.- Parameters:
value
- The name of the language. (ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT).
-
setWarning
public void setWarning(java.lang.String value)
Set the warning level.- Parameters:
value
- The warning level by string name. (default, quiet, verbose).
-
setDebug
public void setDebug(boolean value)
Enable debugging options.- Parameters:
value
- True if debug mode is enabled.
-
setCompilationLevel
public void setCompilationLevel(java.lang.String value)
Set the compilation level.- Parameters:
value
- The optimization level by string name. (whitespace, simple, advanced).
-
setManageDependencies
public void setManageDependencies(boolean value)
-
setCustomExternsOnly
public void setCustomExternsOnly(boolean value)
Use only custom externs.
-
setOutput
public void setOutput(java.io.File value)
Set output file.
-
setReplacePropertiesPrefix
public void setReplacePropertiesPrefix(java.lang.String value)
Set the replacement property prefix.
-
setReplaceProperties
public void setReplaceProperties(boolean value)
Whether to replace@define
lines with properties
-
setEncoding
public void setEncoding(java.lang.String encoding)
Set input file encoding
-
setOutputEncoding
public void setOutputEncoding(java.lang.String outputEncoding)
Set output file encoding
-
setPrettyPrint
public void setPrettyPrint(boolean pretty)
Set pretty print formatting option
-
setPrintInputDelimiter
public void setPrintInputDelimiter(boolean print)
Set print input delimiter formatting option
-
setForceRecompile
public void setForceRecompile(boolean forceRecompile)
Set force recompile option
-
setGenerateExports
public void setGenerateExports(boolean generateExports)
Set generateExports option
-
addExterns
public void addExterns(FileList list)
Sets the externs file.
-
addWarning
public void addWarning(Warning warning)
Adds aentry Each warning entry must have two attributes, group and level. Group must contain one of the constants from DiagnosticGroups (e.g., "ACCESS_CONTROLS"), while level must contain one of the CheckLevel constants ("ERROR", "WARNING" or "OFF").
-
addSources
public void addSources(FileList list)
Sets the source files.
-
addPath
public void addPath(Path list)
Adds aentry.
-
execute
public void execute()
-
createDefine
public Parameter createDefine()
Creates a new<define/>
nested element. Supports name and value attributes.
-
setSourceMapFormat
public void setSourceMapFormat(java.lang.String format)
-
setSourceMapOutputFile
public void setSourceMapOutputFile(java.io.File sourceMapOutputFile)
-
-