@Override protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) throws CoreException { this.currentProject = getProject(); if (this.currentProject == null || !this.currentProject.isAccessible()) return new IProject[0]; try { this.notifier.checkCancel(); kind = initializeBuilder(kind, true); if (isWorthBuilding()) { if (kind == FULL_BUILD) { if (DEBUG) System.out.println("JavaBuilder: Performing full build as requested"); //$NON-NLS-1$ buildAll(); } else { if ((this.lastState = getLastState(this.currentProject)) == null) { if (DEBUG) System.out.println("JavaBuilder: Performing full build since last saved state was not found"); //$NON-NLS-1$ buildAll(); } else if (hasClasspathChanged()) { buildAll(); } else if (this.nameEnvironment.sourceLocations.length > 0 || this.testNameEnvironment.sourceLocations.length > 0) { SimpleLookupTable deltas = findDeltas(); if (deltas == null) { if (DEBUG) System.out.println("JavaBuilder: Performing full build since deltas are missing after incremental request"); //$NON-NLS-1$ buildAll(); } else if (deltas.elementSize > 0) {
private void buildDeltas(SimpleLookupTable deltas) { this.notifier.checkCancel(); this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && this.lastState != null) System.out.println("JavaBuilder: Clearing last state : " + this.lastState); //$NON-NLS-1$ clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time IncrementalImageBuilder imageBuilder = new IncrementalImageBuilder(this); if (imageBuilder.build(deltas)) { recordNewState(imageBuilder.newState); } else { if (DEBUG) System.out.println("JavaBuilder: Performing full build since incremental build failed"); //$NON-NLS-1$ buildAll(); } }
protected void clean(IProgressMonitor monitor) throws CoreException { this.currentProject = getProject(); if (this.currentProject == null || !this.currentProject.isAccessible()) return; if (DEBUG) System.out.println("\nCleaning " + this.currentProject.getName() //$NON-NLS-1$ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$ this.notifier = new BuildNotifier(monitor, this.currentProject); this.notifier.begin(); try { this.notifier.checkCancel(); initializeBuilder(CLEAN_BUILD, true); if (DEBUG) System.out.println("Clearing last state as part of clean : " + this.lastState); //$NON-NLS-1$ clearLastState(); removeProblemsAndTasksFor(this.currentProject); new BatchImageBuilder(this, false).cleanOutputFolders(false); } catch (CoreException e) { Util.log(e, "JavaBuilder handling CoreException while cleaning: " + this.currentProject.getName()); //$NON-NLS-1$ createInconsistentBuildMarker(e); } finally { this.notifier.done(); cleanup(); } if (DEBUG) System.out.println("Finished cleaning " + this.currentProject.getName() //$NON-NLS-1$ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$ }
private void buildAll() { this.notifier.checkCancel(); this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && this.lastState != null) System.out.println("JavaBuilder: Clearing last state : " + this.lastState); //$NON-NLS-1$ clearLastState(); BatchImageBuilder imageBuilder = new BatchImageBuilder(this, true); imageBuilder.build(); recordNewState(imageBuilder.newState); }
private SimpleLookupTable findDeltas() { this.notifier.subTask(Messages.bind(Messages.build_readingDelta, this.currentProject.getName())); IResourceDelta delta = getDelta(this.currentProject); SimpleLookupTable deltas = new SimpleLookupTable(3); if (delta != null) { IProject p = (IProject) keyTable[i]; if (p != null && p != this.currentProject) { State s = getLastState(p); if (!this.lastState.wasStructurallyChanged(p, s)) { // see if we can skip its delta if (s.wasNoopBuild()) delta = getDelta(p); if (delta != null) { if (delta.getKind() != IResourceDelta.NO_CHANGE) {
JavaBuilder.removeProblemsAndTasksFor(movedFolder); JavaBuilder.removeProblemsAndTasksFor(movedFile); if (this.javaBuilder.filterExtraResource(resource)) return true;
JavaBuilder.buildStarting(); JavaBuilder.buildFinished(); return;
private boolean hasStructuralDelta() { // handle case when currentProject has only .class file folders and/or jar files... no source/output folders IResourceDelta delta = getDelta(this.currentProject); if (delta != null && delta.getKind() != IResourceDelta.NO_CHANGE) { ClasspathLocation[] classFoldersAndJars = (ClasspathLocation[]) this.binaryLocationsPerProject.get(this.currentProject); if (classFoldersAndJars != null) { for (int i = 0, l = classFoldersAndJars.length; i < l; i++) { ClasspathLocation classFolderOrJar = classFoldersAndJars[i]; // either a .class file folder or a zip/jar file if (classFolderOrJar != null) { IPath p = classFolderOrJar.getProjectRelativePath(); if (p != null) { IResourceDelta binaryDelta = delta.findMember(p); if (binaryDelta != null && binaryDelta.getKind() != IResourceDelta.NO_CHANGE) return true; } } } } } return false; }
if (BatchImageBuilder.this.javaBuilder.filterExtraResource(resource)) return false; if (exclusionPatterns != null || inclusionPatterns != null) if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) case IResource.FOLDER : resource = proxy.requestResource(); if (BatchImageBuilder.this.javaBuilder.filterExtraResource(resource)) return false; if (isAlsoProject && isExcludedFromProject(resource.getFullPath())) return false; // the sourceFolder == project if (exclusionPatterns != null && inclusionPatterns == null) // must walk children if inclusionPatterns != null
protected void clean(IProgressMonitor monitor) throws CoreException { this.currentProject = getProject(); if (this.currentProject == null || !this.currentProject.isAccessible()) return; if (DEBUG) System.out.println("\nJavaBuilder: Cleaning " + this.currentProject.getName() //$NON-NLS-1$ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$ this.notifier = new BuildNotifier(monitor, this.currentProject); this.notifier.begin(); try { this.notifier.checkCancel(); initializeBuilder(CLEAN_BUILD, true); if (DEBUG) System.out.println("JavaBuilder: Clearing last state as part of clean : " + this.lastState); //$NON-NLS-1$ clearLastState(); removeProblemsAndTasksFor(this.currentProject); new BatchImageBuilder(this, false).cleanOutputFolders(false); } catch (CoreException e) { Util.log(e, "JavaBuilder handling CoreException while cleaning: " + this.currentProject.getName()); //$NON-NLS-1$ createInconsistentBuildMarker(e); } finally { this.notifier.done(); cleanup(); } if (DEBUG) System.out.println("JavaBuilder: Finished cleaning " + this.currentProject.getName() //$NON-NLS-1$ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$ }
private void buildDeltas(SimpleLookupTable deltas) { this.notifier.checkCancel(); this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && this.lastState != null) System.out.println("Clearing last state : " + this.lastState); //$NON-NLS-1$ clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time IncrementalImageBuilder imageBuilder = new IncrementalImageBuilder(this); if (imageBuilder.build(deltas)) { recordNewState(imageBuilder.newState); } else { if (DEBUG) System.out.println("Performing full build since incremental build failed"); //$NON-NLS-1$ buildAll(); } }
private void buildAll() { this.notifier.checkCancel(); this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && this.lastState != null) System.out.println("JavaBuilder: Clearing last state : " + this.lastState); //$NON-NLS-1$ clearLastState(); BatchImageBuilder imageBuilder = new BatchImageBuilder(this, true); imageBuilder.build(); recordNewState(imageBuilder.newState); }
private SimpleLookupTable findDeltas() { this.notifier.subTask(Messages.bind(Messages.build_readingDelta, this.currentProject.getName())); IResourceDelta delta = getDelta(this.currentProject); SimpleLookupTable deltas = new SimpleLookupTable(3); if (delta != null) { IProject p = (IProject) keyTable[i]; if (p != null && p != this.currentProject) { State s = getLastState(p); if (!this.lastState.wasStructurallyChanged(p, s)) { // see if we can skip its delta if (s.wasNoopBuild()) delta = getDelta(p); if (delta != null) { if (delta.getKind() != IResourceDelta.NO_CHANGE) {
JavaBuilder.removeProblemsAndTasksFor(movedFolder); JavaBuilder.removeProblemsAndTasksFor(movedFile); if (this.javaBuilder.filterExtraResource(resource)) return true;
JavaBuilder.buildStarting(); JavaBuilder.buildFinished(); return;
private boolean hasStructuralDelta() { // handle case when currentProject has only .class file folders and/or jar files... no source/output folders IResourceDelta delta = getDelta(this.currentProject); if (delta != null && delta.getKind() != IResourceDelta.NO_CHANGE) { ClasspathLocation[] classFoldersAndJars = (ClasspathLocation[]) this.binaryLocationsPerProject.get(this.currentProject); if (classFoldersAndJars != null) { for (int i = 0, l = classFoldersAndJars.length; i < l; i++) { ClasspathLocation classFolderOrJar = classFoldersAndJars[i]; // either a .class file folder or a zip/jar file if (classFolderOrJar != null) { IPath p = classFolderOrJar.getProjectRelativePath(); if (p != null) { IResourceDelta binaryDelta = delta.findMember(p); if (binaryDelta != null && binaryDelta.getKind() != IResourceDelta.NO_CHANGE) return true; } } } } } return false; }
if (BatchImageBuilder.this.javaBuilder.filterExtraResource(resource)) return false; if (exclusionPatterns != null || inclusionPatterns != null) if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) case IResource.FOLDER : resource = proxy.requestResource(); if (BatchImageBuilder.this.javaBuilder.filterExtraResource(resource)) return false; if (isAlsoProject && isExcludedFromProject(resource.getFullPath())) return false; // the sourceFolder == project if (exclusionPatterns != null && inclusionPatterns == null) // must walk children if inclusionPatterns != null
protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) throws CoreException { this.currentProject = getProject(); if (this.currentProject == null || !this.currentProject.isAccessible()) return new IProject[0]; try { this.notifier.checkCancel(); kind = initializeBuilder(kind, true); if (isWorthBuilding()) { if (kind == FULL_BUILD) { if (DEBUG) System.out.println("Performing full build as requested by user"); //$NON-NLS-1$ buildAll(); } else { if ((this.lastState = getLastState(this.currentProject)) == null) { if (DEBUG) System.out.println("Performing full build since last saved state was not found"); //$NON-NLS-1$ buildAll(); } else if (hasClasspathChanged()) { buildAll(); } else if (this.nameEnvironment.sourceLocations.length > 0) { SimpleLookupTable deltas = findDeltas(); if (deltas == null) { if (DEBUG) System.out.println("Performing full build since deltas are missing after incremental request"); //$NON-NLS-1$ buildAll(); } else if (deltas.elementSize > 0) { buildDeltas(deltas);
protected void clean(IProgressMonitor monitor) throws CoreException { this.currentProject = getProject(); if (this.currentProject == null || !this.currentProject.isAccessible()) return; if (DEBUG) System.out.println("\nJavaBuilder: Cleaning " + this.currentProject.getName() //$NON-NLS-1$ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$ this.notifier = new BuildNotifier(monitor, this.currentProject); this.notifier.begin(); try { this.notifier.checkCancel(); initializeBuilder(CLEAN_BUILD, true); if (DEBUG) System.out.println("JavaBuilder: Clearing last state as part of clean : " + this.lastState); //$NON-NLS-1$ clearLastState(); removeProblemsAndTasksFor(this.currentProject); new BatchImageBuilder(this, false).cleanOutputFolders(false); } catch (CoreException e) { Util.log(e, "JavaBuilder handling CoreException while cleaning: " + this.currentProject.getName()); //$NON-NLS-1$ createInconsistentBuildMarker(e); } finally { this.notifier.done(); cleanup(); } if (DEBUG) System.out.println("JavaBuilder: Finished cleaning " + this.currentProject.getName() //$NON-NLS-1$ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$ }
private void buildDeltas(SimpleLookupTable deltas) { this.notifier.checkCancel(); this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName())); if (DEBUG && this.lastState != null) System.out.println("JavaBuilder: Clearing last state : " + this.lastState); //$NON-NLS-1$ clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time IncrementalImageBuilder imageBuilder = new IncrementalImageBuilder(this); if (imageBuilder.build(deltas)) { recordNewState(imageBuilder.newState); } else { if (DEBUG) System.out.println("JavaBuilder: Performing full build since incremental build failed"); //$NON-NLS-1$ buildAll(); } }