Package com.google.javascript.jscomp.ant
Class CompileTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.google.javascript.jscomp.ant.CompileTask
- All Implemented Interfaces:
Cloneable
public final class CompileTask
extends org.apache.tools.ant.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.
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExterns(org.apache.tools.ant.types.FileList list) Sets the externs file.voidaddPath(org.apache.tools.ant.types.Path list) Adds aentry. voidaddSources(org.apache.tools.ant.types.FileList list) Sets the source files.voidaddWarning(Warning warning) Adds aentry Each warning entry must have two attributes, group and level. org.apache.tools.ant.types.ParameterCreates a new<define/>nested element.voidexecute()voidsetCompilationLevel(String value) Set the compilation level.voidsetCustomExternsOnly(boolean value) Use only custom externs.voidsetDebug(boolean value) Enable debugging options.voidsetEncoding(String encoding) Set input file encodingvoidsetForceRecompile(boolean forceRecompile) Set force recompile optionvoidsetGenerateExports(boolean generateExports) Set generateExports optionvoidsetLanguageIn(String value) Set the language to which input sources conform.voidsetManageDependencies(boolean value) voidSet output file.voidsetOutputEncoding(String outputEncoding) Set output file encodingvoidsetPrettyPrint(boolean pretty) Set pretty print formatting optionvoidsetPrintInputDelimiter(boolean print) Set print input delimiter formatting optionvoidsetReplaceProperties(boolean value) Whether to replace@definelines with propertiesvoidsetReplacePropertiesPrefix(String value) Set the replacement property prefix.voidsetSourceMapFormat(String format) voidsetSourceMapOutputFile(File sourceMapOutputFile) voidsetWarning(String value) Set the warning level.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
CompileTask
public CompileTask()
-
-
Method Details
-
setLanguageIn
Set the language to which input sources conform.- Parameters:
value- The name of the language. (ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT).
-
setWarning
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
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
Set output file. -
setReplacePropertiesPrefix
Set the replacement property prefix. -
setReplaceProperties
public void setReplaceProperties(boolean value) Whether to replace@definelines with properties -
setEncoding
Set input file encoding -
setOutputEncoding
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(org.apache.tools.ant.types.FileList list) Sets the externs file. -
addWarning
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(org.apache.tools.ant.types.FileList list) Sets the source files. -
addPath
public void addPath(org.apache.tools.ant.types.Path list) Adds aentry. -
execute
public void execute()- Overrides:
executein classorg.apache.tools.ant.Task
-
createDefine
public org.apache.tools.ant.types.Parameter createDefine()Creates a new<define/>nested element. Supports name and value attributes. -
setSourceMapFormat
-
setSourceMapOutputFile
-