org.plovr
Class Compilation

java.lang.Object
  extended by org.plovr.Compilation

public final class Compilation
extends Object

Compilation represents a compilation performed by the Closure Compiler.

Author:
bolinfest@gmail.com (Michael Bolin)

Method Summary
 void appendRootModuleInfo(Appendable appendable, boolean isDebugMode, Function<String,String> moduleNameToUri)
           
 void compile(Config config)
           
static Compilation create(List<JSSourceFile> externs, List<JSSourceFile> inputs)
           
static Compilation createForModules(List<JSSourceFile> externs, List<JSModule> modules)
           
 String getCodeForModule(String moduleName, boolean isDebugMode, Function<String,String> moduleNameToUri)
           
 String getCodeForRootModule(boolean isDebugMode, Function<String,String> moduleNameToUri)
           
 List<org.plovr.CompilationError> getCompilationErrors()
           
 List<org.plovr.CompilationError> getCompilationWarnings()
           
 String getCompiledCode()
           
 List<JSSourceFile> getInputs()
           
 Result getResult()
           
 String getRootModuleName()
           
 Double getTypedPercent()
           
 boolean hasResult()
           
 String toString()
           
 boolean usesModules()
           
 void writeCompiledCodeToFiles(Function<String,String> moduleNameToUri, String sourceMapPath)
          Writes out all of the module files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static Compilation create(List<JSSourceFile> externs,
                                 List<JSSourceFile> inputs)

createForModules

public static Compilation createForModules(List<JSSourceFile> externs,
                                           List<JSModule> modules)

compile

public void compile(Config config)

usesModules

public boolean usesModules()

hasResult

public boolean hasResult()

getResult

public Result getResult()

getCompiledCode

public String getCompiledCode()

getRootModuleName

public String getRootModuleName()

getCodeForModule

public String getCodeForModule(String moduleName,
                               boolean isDebugMode,
                               Function<String,String> moduleNameToUri)

appendRootModuleInfo

public void appendRootModuleInfo(Appendable appendable,
                                 boolean isDebugMode,
                                 Function<String,String> moduleNameToUri)
                          throws IOException
Throws:
IOException

getCodeForRootModule

public String getCodeForRootModule(boolean isDebugMode,
                                   Function<String,String> moduleNameToUri)

writeCompiledCodeToFiles

public void writeCompiledCodeToFiles(Function<String,String> moduleNameToUri,
                                     String sourceMapPath)
                              throws IOException
Writes out all of the module files. This method is only applicable when modules are used. This is expected to be used only with the build command.

Throws:
IOException

getCompilationErrors

public List<org.plovr.CompilationError> getCompilationErrors()

getCompilationWarnings

public List<org.plovr.CompilationError> getCompilationWarnings()

getTypedPercent

@Nullable
public Double getTypedPercent()
Returns:
null if the code was compiled in CompilationMode.RAW mode

getInputs

public List<JSSourceFile> getInputs()

toString

public String toString()
Overrides:
toString in class Object