public JavaRunnerImpl(RunnerOptions options, String module, String version) { this.module = module; RepositoryManager repositoryManager = CeylonUtils.repoManager() .userRepos(options.getUserRepositories()) .systemRepo(options.getSystemRepository()) .offline(options.isOffline()) .noDefaultRepos(options.isNoDefaultRepositories()) .overrides(options.getOverrides()) .logger(new CmrLogger(options.isVerbose("cmr"))) .buildManager(); ClassLoader delegateClassLoader = null; if (options instanceof JavaRunnerOptions) { delegateClassLoader = ((JavaRunnerOptions) options).getDelegateClassLoader(); } moduleLoader = new FlatpathModuleLoader( repositoryManager, delegateClassLoader, options.getExtraModules(), options.isVerbose("cmr")); moduleClassLoader = moduleLoader.loadModule(module, version); if (options.getRun() != null) className = options.getRun().replace("::", "."); else if (module.equals(com.redhat.ceylon.model.typechecker.model.Module.DEFAULT_MODULE_NAME)) className = "run_"; else className = module + ".run_"; }
// for tests public URL[] getClassLoaderURLs() { return moduleLoader.getClassLoaderURLs(module); }
@Override public void cleanup() { moduleLoader.cleanup(); moduleLoader = null; moduleClassLoader = null; }