Search in sources :

Example 6 with Compiler

use of com.google.javascript.jscomp.Compiler in project AngularBeans by bessemHmidi.

the class ClosureCompiler method compile.

public String compile(String code) {
    Compiler compiler = new Compiler();
    compiler.disableThreads();
    SourceFile extern = SourceFile.fromCode("externs.js", "function alert(x) {}");
    SourceFile input = SourceFile.fromCode("input.js", code);
    compiler.compile(extern, input, options);
    return compiler.toSource();
}
Also used : Compiler(com.google.javascript.jscomp.Compiler) SourceFile(com.google.javascript.jscomp.SourceFile)

Aggregations

Compiler (com.google.javascript.jscomp.Compiler)6 CompilerOptions (com.google.javascript.jscomp.CompilerOptions)3 File (java.io.File)3 ArrayList (java.util.ArrayList)3 AbstractCompiler (com.google.javascript.jscomp.AbstractCompiler)2 CompilerInput (com.google.javascript.jscomp.CompilerInput)2 JSModule (com.google.javascript.jscomp.JSModule)2 JSSourceFile (com.google.javascript.jscomp.JSSourceFile)2 SourceFile (com.google.javascript.jscomp.SourceFile)2 CircularDependencyException (com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException)2 AbstractJSProject (net.vtst.ow.closure.compiler.deps.AbstractJSProject)2 JSProject (net.vtst.ow.closure.compiler.deps.JSProject)2 ClosureCompiler (net.vtst.ow.eclipse.js.closure.compiler.ClosureCompiler)2 IFile (org.eclipse.core.resources.IFile)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 IReadOnlyStore (net.vtst.eclipse.easy.ui.properties.stores.IReadOnlyStore)1 LaunchConfigurationReadOnlyStore (net.vtst.eclipse.easy.ui.properties.stores.LaunchConfigurationReadOnlyStore)1 ResourcePropertyStore (net.vtst.eclipse.easy.ui.properties.stores.ResourcePropertyStore)1 CompilableJSUnit (net.vtst.ow.closure.compiler.compile.CompilableJSUnit)1