Package com.redhat.ceylon.compiler.java.runtime.tools

Source Code of com.redhat.ceylon.compiler.java.runtime.tools.CeylonToolProvider

package com.redhat.ceylon.compiler.java.runtime.tools;

import com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaCompilerImpl;
import com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaRunnerImpl;
import com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaScriptCompilerImpl;
import com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaScriptRunnerImpl;


public class CeylonToolProvider {
   
    public static Compiler getCompiler(Backend backend){
        switch(backend){
        case Java:
            return new JavaCompilerImpl();
        case JavaScript:
            return new JavaScriptCompilerImpl();
        default:
            throw new RuntimeException("Compiler for backend not supported yet: "+backend);
        }
    }

    public static Runner getRunner(Backend backend, RunnerOptions options, String module, String version) {
        switch(backend){
        case JavaScript:
            return new JavaScriptRunnerImpl(options, module, version);
        case Java:
            return new JavaRunnerImpl(options, module, version);
        default:
            throw new RuntimeException("Runner for backend not supported yet: "+backend);
        }
    }
}
TOP

Related Classes of com.redhat.ceylon.compiler.java.runtime.tools.CeylonToolProvider

TOP
Copyright © 2018 www.massapi.com. 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.