Package com.redhat.ceylon.compiler.js

Examples of com.redhat.ceylon.compiler.js.CeylonCompileJsTool


public class JavaScriptCompilerImpl implements Compiler {

    @Override
    public boolean compile(CompilerOptions options,
                           CompilationListener listener) {
        CeylonCompileJsTool tool = new CeylonCompileJsTool();
        if(options.isVerbose())
            tool.setVerbose("");
        tool.setOffline(options.isOffline());
        try {
            tool.setRepositoryAsStrings(options.getUserRepositories());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        tool.setSystemRepository(options.getSystemRepository());
        tool.setOut(options.getOutputRepository());
        tool.setSource(options.getSourcePath());
        // just mix them all
        List<String> moduleOrFile = new ArrayList<String>();
        moduleOrFile.addAll(options.getModules());
        moduleOrFile.addAll(fileToStringList(options.getFiles()));
        tool.setModule(moduleOrFile);
        tool.setDiagnosticListener(adapt(listener));
        tool.setThrowOnError(true);
        // FIXME: allow the user to capture stdout
        if(!options.isVerbose()){
            // make the tool shut the hell up
            tool.setOut(new NullWriter());
        }

        try {
            tool.run();
        } catch (CompilerErrorException e) {
            return false;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.js.CeylonCompileJsTool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.