コード例 #1
0
ファイル: DCLBuilder.java プロジェクト: joyeliz/DCL
  protected void fullLoad(final IProgressMonitor monitor)
      throws CoreException, IOException, ClassNotFoundException, ParseException {
    monitor.setTaskName("Checking architecture");
    monitor.subTask("loading dependencies");
    final Architecture architecture =
        ArchitectureUtils.getOrInitializeArchitecture(this.getProject());
    monitor.beginTask("Checking architecture", architecture.getProjectClasses().size());

    for (String className : architecture.getProjectClasses()) {
      monitor.subTask(className);
      Collection<Dependency> dependencies = DCLPersistence.load(this.getProject(), className);
      if (dependencies == null) {
        throw new CoreException(null);
      }
      architecture.updateDependencies(className, dependencies);
      monitor.worked(1);
    }
  }
コード例 #2
0
ファイル: DCLBuilder.java プロジェクト: joyeliz/DCL
  protected void incrementalBuild(IResourceDelta delta, IProgressMonitor monitor)
      throws CoreException, IOException, ParseException {
    final Architecture architecture = ArchitectureUtils.getOrInitializeArchitecture(getProject());
    final boolean updateDC = (delta.findMember(new Path(DCLUtil.DC_FILENAME)) != null);
    if (updateDC) {
      architecture.updateDependencyConstraints(this.getProject());
    }
    monitor.beginTask(
        "Checking architecture",
        delta.getAffectedChildren(
                IResourceDelta.ADDED | IResourceDelta.CHANGED | IResourceDelta.REMOVED,
                IResource.FILE)
            .length);
    delta.accept(new IncrementalDeltaVisitor(architecture, monitor));

    /* For now, any change in the DCL File requires full build */
    if (updateDC) {
      getProject().accept(new FullBuildVisitor(architecture, monitor, false));
    }
  }