Examples of ModuleManager


Examples of com.intellij.openapi.module.ModuleManager

  @NotNull
  @Override
  public Module[] getModules() {
    List<Module> modules = new ArrayList<Module>();

    ModuleManager moduleManager = ModuleManager.getInstance(getProject());
    for (SelectedBundle selectedBundle : getBundlesToDeploy()) {
      if (selectedBundle.isModule()) {
        Module module = moduleManager.findModuleByName(selectedBundle.getName());
        if (module != null) {
          modules.add(module);
        }
        else {
          LOG.error("no module [" + selectedBundle.getName() + "]");
View Full Code Here

Examples of com.intellij.openapi.module.ModuleManager

        AccessToken token = ApplicationManager.getApplication().acquireReadActionLock();
        try {
          Set<SelectedBundle> selectedBundles = new HashSet<SelectedBundle>();
          // the bundles are module names, by now we try to find jar files in the output directory which we can then install
          ModuleManager moduleManager = ModuleManager.getInstance(myRunConfiguration.getProject());
          int bundleCount = myRunConfiguration.getBundlesToDeploy().size();
          for (int i = 0; i < bundleCount; i++) {
            progressIndicator.setFraction((double)i / bundleCount);

            SelectedBundle selectedBundle = myRunConfiguration.getBundlesToDeploy().get(i);
            if (selectedBundle.isModule()) {
              // use the output jar name if it is a module
              String name = selectedBundle.getName();
              Module module = moduleManager.findModuleByName(name);
              if (module == null) {
                throw new CantRunException("Module '" + name + "' no longer exists. Please check your run configuration.");
              }
              OsmorcFacet facet = OsmorcFacet.getInstance(module);
              if (facet == null) {
View Full Code Here

Examples of com.intellij.openapi.module.ModuleManager

    assertNotNull(psiFile);
    return psiFile;
  }

  public static ModuleRootManager getModuleRootManager(Project project, String moduleName) {
    ModuleManager moduleManager = ModuleManager.getInstance(project);
    Module module = moduleManager.findModuleByName(moduleName);
    assertNotNull(module);
    return ModuleRootManager.getInstance(module);
  }
View Full Code Here

Examples of com.intellij.openapi.module.ModuleManager

    super.setUp();
    myModulesToDispose.clear();
  }

  protected void tearDown() throws Exception {
    final ModuleManager moduleManager = ModuleManager.getInstance(myProject);
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      public void run() {
        for (Module module : myModulesToDispose) {
          String moduleName = module.getName();
          if (moduleManager.findModuleByName(moduleName) != null) {
            moduleManager.disposeModule(module);
          }
        }
      }
    });
    myModulesToDispose.clear();
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

    private List<String> moduleFilters;
    private String encoding;

    public PhasedUnits(Context context) {
        this.context = context;
        this.moduleManager = new ModuleManager(context);
        this.moduleManager.initCoreModules();
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

    public PhasedUnits(Context context, ModuleManagerFactory moduleManagerFactory) {
        this.context = context;
        if(moduleManagerFactory != null){
            this.moduleManager = moduleManagerFactory.createModuleManager(context);
        }else{
            this.moduleManager = new ModuleManager(context);
        }
        this.moduleManager.initCoreModules();
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

                public void visit(ModuleDescriptor that) {
                    super.visit(that);
                    ImportPath importPath = that.getImportPath();
                    if (importPath != null) {
                        String moduleName = Util.formatPath(importPath.getIdentifiers());
                        ModuleManager moduleManager = moduleManagerRef.get();
                        if (moduleManager != null) {
                            for (Module otherModule : moduleManager.getCompiledModules()) {
                                String otherModuleName = otherModule.getNameAsString();
                                if (moduleName.startsWith(otherModuleName + ".") ||
                                        otherModuleName.startsWith(moduleName + ".")) {
                                    StringBuilder error = new StringBuilder("Found two modules within the same hierarchy: '");
                                    error.append( otherModule.getNameAsString() )
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

        RepositoryManager repoManager = builder.buildRepository();
        VFS vfs = new VFS();
        Context context = new Context(repoManager, vfs);
        PhasedUnits pus = new PhasedUnits(context);
        List<String> name = ModuleManager.splitModuleName(moduleName);
        ModuleManager moduleManager = pus.getModuleManager();
        if(Module.DEFAULT_MODULE_NAME.equals(moduleName)){
            // visit every folder and skip modules
            boolean exists = findDefaultModuleSource(srcDir);
            if(!exists)
                throw new NoSuchModuleException("No source found for default module");
        }else{
            visitModule(vfs, pus, name, srcDir, vfs.getFromFile(srcDir), moduleManager);
        }
        for (PhasedUnit pu : pus.getPhasedUnits()) {
            pu.visitSrcModulePhase();
        }
        this.moduleDescriptor = moduleManager.getOrCreateModule(name, null);
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

   
    private JCCompilationUnit ceylonParse(JavaFileObject filename, CharSequence readSource) {
        if(ceylonEnter.hasRun())
            throw new RunTwiceException("Trying to load new source file after CeylonEnter has been called: "+filename);
        try {
            ModuleManager moduleManager = phasedUnits.getModuleManager();
            File sourceFile = new File(filename.getName());
            // FIXME: temporary solution
            VirtualFile file = vfs.getFromFile(sourceFile);
            VirtualFile srcDir = vfs.getFromFile(getSrcDir(sourceFile));
           
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

                }
            }else{
                // there was a syntax error in the module descriptor, make a pretend module so that we can
                // correctly mark all declarations as part of that module, but we won't generate any code
                // for it
                ModuleManager moduleManager = phasedUnits.getModuleManager();
                module = moduleManager.getOrCreateModule(Arrays.asList(pkgName.split("\\.")), "bogus");
            }
            // now remember it
            if(module != null){
                modulesLoadedFromSource.add(module);
                return module;
View Full Code Here
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.