Пример #1
0
  public static void resetModuleManager() {
    RepositoryManagerBuilder builder =
        new RepositoryManagerBuilder(
            new Logger() {

              @Override
              public void error(String str) {
                System.err.println("ERROR: " + str);
              }

              @Override
              public void warning(String str) {
                System.err.println("WARN: " + str);
              }

              @Override
              public void info(String str) {
                System.err.println("INFO: " + str);
              }

              @Override
              public void debug(String str) {
                System.err.println("DEBUG: " + str);
              }
            });
    RepositoryManager repoManager = builder.buildRepository();
    VFS vfs = new VFS();
    Context context = new Context(repoManager, vfs);
    moduleManager = new RuntimeModuleManager(context);
    moduleManager.initCoreModules();
    moduleManager.prepareForTypeChecking();
  }
Пример #2
0
 private RepositoryManager getRepositoryManager(
     File root, boolean offline, int timeout, String apiVersion) throws Exception {
   RepositoryManagerBuilder builder =
       getRepositoryManagerBuilder(root, offline, timeout, java.net.Proxy.NO_PROXY);
   WebDAVContentStore rcs =
       new WebDAVContentStore(HERD_URL, log, false, 60000, java.net.Proxy.NO_PROXY, apiVersion);
   CmrRepository repo = new DefaultRepository(rcs.createRoot());
   return builder.addRepository(repo).buildRepository();
 }
Пример #3
0
  public static Module loadModule(
      File sysRep, ClassLoader loader, ModuleIdentifier moduleIdentifier) throws Exception {

    //
    Field field = CeylonModuleLoader.class.getDeclaredField("JDK_MODULE_NAMES");
    field.setAccessible(true);
    HashSet<String> a = (HashSet<String>) field.get(null);
    a.add("io.vertx.core");
    a.add("io.vertx.platform");

    //
    CeylonUtils.CeylonRepoManagerBuilder metaBuilder = CeylonUtils.repoManager();
    metaBuilder.systemRepo(sysRep.getAbsolutePath());
    metaBuilder.logger(new JULLogger());
    RepositoryManagerBuilder builder = metaBuilder.buildManagerBuilder();
    RepositoryManager repo = builder.buildRepository();

    // Extend to add system classloader as fallback
    CeylonModuleLoader moduleLoader =
        new CeylonModuleLoaderExt(new ClassLoaderLocalLoader(loader), repo);

    //
    return moduleLoader.loadModule(moduleIdentifier);
  }
 @Override
 protected void configureRepositories(File archiveDirectory, RepositoryManagerBuilder builder) {
   super.configureRepositories(archiveDirectory, builder);
   StructureBuilder structureBuilder = new FileContentStore(getEmbeddedCeylonRepository());
   builder.addRepository(new DefaultRepository(structureBuilder.createRoot()));
 }