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, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEntryPoint(org.apache.tools.ant.types.Parameter entrypoint)
    Adds a <entrypoint/> entry Each entrypoint entry must have one attribute, name.
    void
    addExterns(org.apache.tools.ant.types.FileList list)
    Sets the externs file.
    void
    addPath(org.apache.tools.ant.types.Path list)
    Adds a <path/> entry.
    void
    addSources(org.apache.tools.ant.types.FileList list)
    Sets the source files.
    void
    Adds a <warning/> entry Each warning entry must have two attributes, group and level.
    org.apache.tools.ant.types.Parameter
    Creates a new <define/> nested element.
    org.apache.tools.ant.types.Parameter
    Creates a new <entrypoint/> nested element.
    void
     
    void
    setAngularPass(boolean angularPass)
     
    void
    Set the compilation level.
    void
    setDebug(boolean value)
    Enable debugging options.
    void
    setEncoding(String encoding)
    Set input file encoding
    void
    Set the environment which determines the builtin extern set.
    void
    setForceRecompile(boolean forceRecompile)
    Set force recompile option
    void
    setGenerateExports(boolean generateExports)
    Set generateExports option
    void
    Set the language to which output sources conform.
    void
    setManageDependencies(boolean value)
     
    void
    setOutput(File value)
    Set output file.
    void
    setOutputEncoding(String outputEncoding)
    Set output file encoding
    void
    Set output wrapper.
    void
    Set output wrapper file.
    void
    setPreferSingleQuotes(boolean singlequotes)
    Normally, when there are an equal number of single and double quotes in a string, the compiler will use double quotes.
    void
    setPrettyPrint(boolean pretty)
    Set pretty print formatting option
    void
    setPrintInputDelimiter(boolean print)
    Set print input delimiter formatting option
    void
    setReplaceProperties(boolean value)
    Whether to replace @define lines with properties
    void
    Set the replacement property prefix.
    void
     
    void
     
    void
    setSourceMapOutputFile(File sourceMapOutputFile)
     
    void
    setStrictModeInput(boolean strictModeInput)
     
    void
    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, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompileTask

      public CompileTask()
  • Method Details

    • setLanguageOut

      public void setLanguageOut(String value)
      Set the language to which output sources conform.
      Parameters:
      value - The name of the language. (ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT).
    • setWarning

      public void setWarning(String value)
      Set the warning level.
      Parameters:
      value - The warning level by string name. (default, quiet, verbose).
    • setEnvironment

      public void setEnvironment(String value)
      Set the environment which determines the builtin extern set.
      Parameters:
      value - The name of the environment. (BROWSER, CUSTOM).
    • setDebug

      public void setDebug(boolean value)
      Enable debugging options.
      Parameters:
      value - True if debug mode is enabled.
    • setCompilationLevel

      public void setCompilationLevel(String value)
      Set the compilation level.
      Parameters:
      value - The optimization level by string name. (whitespace, simple, advanced).
    • setStrictModeInput

      public void setStrictModeInput(boolean strictModeInput)
    • setManageDependencies

      public void setManageDependencies(boolean value)
    • setOutput

      public void setOutput(File value)
      Set output file.
    • setOutputWrapper

      public void setOutputWrapper(String value)
      Set output wrapper.
    • setOutputWrapperFile

      public void setOutputWrapperFile(File value)
      Set output wrapper file.
    • setReplacePropertiesPrefix

      public void setReplacePropertiesPrefix(String value)
      Set the replacement property prefix.
    • setReplaceProperties

      public void setReplaceProperties(boolean value)
      Whether to replace @define lines with properties
    • setEncoding

      public void setEncoding(String encoding)
      Set input file encoding
    • setOutputEncoding

      public void setOutputEncoding(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
    • setPreferSingleQuotes

      public void setPreferSingleQuotes(boolean singlequotes)
      Normally, when there are an equal number of single and double quotes in a string, the compiler will use double quotes. Set this to true to prefer single quotes.
    • setForceRecompile

      public void setForceRecompile(boolean forceRecompile)
      Set force recompile option
    • setAngularPass

      public void setAngularPass(boolean angularPass)
    • 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

      public void addWarning(Warning warning)
      Adds a <warning/> entry 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").
    • addEntryPoint

      public void addEntryPoint(org.apache.tools.ant.types.Parameter entrypoint)
      Adds a <entrypoint/> entry Each entrypoint entry must have one attribute, name.
    • 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 a <path/> entry.
    • execute

      public void execute()
      Overrides:
      execute in class org.apache.tools.ant.Task
    • createDefine

      public org.apache.tools.ant.types.Parameter createDefine()
      Creates a new <define/> nested element. Supports name and value attributes.
    • createEntryPoint

      public org.apache.tools.ant.types.Parameter createEntryPoint()
      Creates a new <entrypoint/> nested element. Supports name attribute.
    • setSourceMapFormat

      public void setSourceMapFormat(String format)
    • setSourceMapOutputFile

      public void setSourceMapOutputFile(File sourceMapOutputFile)
    • setSourceMapLocationMapping

      public void setSourceMapLocationMapping(String mapping)