Class DefaultCommandLineCompiler

java.lang.Object
com.google.common.css.AbstractCommandLineCompiler<JobDescription>
com.google.common.css.compiler.commandline.DefaultCommandLineCompiler
Direct Known Subclasses:
ClosureCommandLineCompiler, ClosureStylesheetCompiler

public class DefaultCommandLineCompiler extends AbstractCommandLineCompiler<JobDescription>
DefaultCommandLineCompiler provides the CSS parser from command line interface to users.
  • Field Details

    • MAXIMUM_ERRORS_TO_OUTPUT

      protected static final int MAXIMUM_ERRORS_TO_OUTPUT
      The compiler will limit the number of error messages it outputs to this number.
      See Also:
  • Constructor Details

    • DefaultCommandLineCompiler

      protected DefaultCommandLineCompiler(JobDescription job, ExitCodeHandler exitCodeHandler, ErrorManager errorManager)
      Constructs a DefaultCommandLineCompiler.
      Parameters:
      job - The inputs the compiler should process and the options to use.
      errorManager - The error manager to use for error reporting.
  • Method Details

    • compile

      public String compile() throws GssParserException
      Parses all the inputs, reports error messages and combines the parsed inputs into one stylesheet.
      Returns:
      the resulting stylesheet in string format
      Throws:
      GssParserException
    • execute

      protected String execute(@Nullable File renameFile, @Nullable File sourcemapFile)
      Executes the job associated with this compiler and returns the compiled CSS as a string. If renameFile is specified along with a RecordingSubstitutionMap, then the renaming file will be written, as well.
    • writeRenamingMap

      protected void writeRenamingMap(Map<String,String> renamingMap, PrintWriter renamingMapWriter)
      Writes the mappings to the specified writer. By default, mappings are written (one per line) as:
       key:value
       

      Subclasses may override this method to provide alternate output formats. Subclasses must not close the writer.