use of org.eclipse.ceylon.cmr.api.OverridesRuntimeResolver in project ceylon by eclipse.
the class Main method setup.
/**
* Sets up the Ceylon metamodel by adding the specified module to it. This does not run any Ceylon code,
* nor does it reset the metamodel first. You can repeatedly invoke this method to add new Ceylon modules
* to the metamodel.
*
* @param module the module name to load.
* @param version the version to load. Ignored if the module is the default module.
*/
public void setup(String module, String version) {
Overrides parsedOverrides = Overrides.getDistOverrides();
if (overrides != null) {
try {
parsedOverrides = parsedOverrides.append(overrides);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Metamodel.resetModuleManager(new OverridesRuntimeResolver(parsedOverrides));
if (moduleClassLoader == null)
setupModuleClassLoader(module);
if (classPath == null) {
classPath = new ClassPath(parsedOverrides);
visited = new HashSet<ClassPath.Module>();
registerInMetamodel("ceylon.language", Versions.CEYLON_VERSION_NUMBER, false);
registerInMetamodel("org.eclipse.ceylon.common", Versions.CEYLON_VERSION_NUMBER, false);
registerInMetamodel("org.eclipse.ceylon.model", Versions.CEYLON_VERSION_NUMBER, false);
}
if (module.equals(org.eclipse.ceylon.model.typechecker.model.Module.DEFAULT_MODULE_NAME))
version = null;
registerInMetamodel(module, version, false);
}
Aggregations