예제 #1
0
  public void clean(final Set<? extends SModule> modules, @NotNull final ProgressMonitor monitor) {
    monitor.start("Cleaning...", modules.size());
    try {
      for (SModule module : modules) {
        if (isExcluded(module)) {
          monitor.advance(1);
          continue;
        }
        if (monitor.isCanceled()) break;

        monitor.step(module.getModuleName());
        JavaModuleFacet facet = module.getFacet(JavaModuleFacet.class);
        assert facet != null && facet.getClassesGen() != null;
        String path = facet.getClassesGen().getPath();
        FileUtil.delete(new File(path));
        ClassPathFactory.getInstance().invalidate(Collections.singleton(path));
        monitor.advance(1);
      }
    } finally {
      monitor.done();
    }
  }
예제 #2
0
 private void invalidateCompiledClasses(SModule module) {
   IFile classesGen = getJavaFacet(module).getClassesGen();
   if (classesGen != null) {
     ClassPathFactory.getInstance().invalidate(Collections.singleton(classesGen.getPath()));
   }
 }