Search in sources :

Example 1 with JavaRunnerOptions

use of org.eclipse.ceylon.compiler.java.runtime.tools.JavaRunnerOptions in project ceylon by eclipse.

the class CeylonRunTool method startInFlatClasspath.

private void startInFlatClasspath(String module, String version) {
    JavaRunnerOptions options = new JavaRunnerOptions();
    if (repos != null) {
        for (URI userRepository : repos) {
            options.addUserRepository(userRepository.toASCIIString());
        }
    }
    if (getCwd() != null) {
        options.setWorkingDirectory(getCwd().getAbsolutePath());
    }
    options.setOffline(offline);
    options.setSystemRepository(systemRepo);
    options.setVerboseCategory(verbose);
    options.setRun(prependModuleName(module, run));
    options.setOverrides(overrides);
    options.setDowngradeDist(!upgradeDist);
    options.setExtraModules(extraModules);
    try {
        Runner runner = CeylonToolProvider.getRunner(Backend.Java, options, module, version);
        runner.run(args.toArray(new String[args.size()]));
    } catch (ModuleNotFoundException e) {
        throw new CeylonRuntimeException(e.getMessage());
    }
}
Also used : JavaRunnerOptions(org.eclipse.ceylon.compiler.java.runtime.tools.JavaRunnerOptions) CeylonRuntimeException(ceylon.modules.CeylonRuntimeException) Runner(org.eclipse.ceylon.compiler.java.runtime.tools.Runner) ModuleNotFoundException(org.eclipse.ceylon.compiler.java.runtime.tools.ModuleNotFoundException) URI(java.net.URI)

Aggregations

CeylonRuntimeException (ceylon.modules.CeylonRuntimeException)1 URI (java.net.URI)1 JavaRunnerOptions (org.eclipse.ceylon.compiler.java.runtime.tools.JavaRunnerOptions)1 ModuleNotFoundException (org.eclipse.ceylon.compiler.java.runtime.tools.ModuleNotFoundException)1 Runner (org.eclipse.ceylon.compiler.java.runtime.tools.Runner)1