aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-08-05 13:30:47 +0000
committeracolyer <acolyer>2004-08-05 13:30:47 +0000
commitd6f64ad25a7317930d334ae8a5b2ac1bd9b2f18f (patch)
treea10bdd4c3cdabdc9683803a6c8e6273eca186e12
parent4295fcd68c0fc746a7788da28a6ed7ae5274d34a (diff)
downloadaspectj-d6f64ad25a7317930d334ae8a5b2ac1bd9b2f18f.tar.gz
aspectj-d6f64ad25a7317930d334ae8a5b2ac1bd9b2f18f.zip
last piece of fix for Bugzilla Bug 54621
Incremental support ignores binary source
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
index 6950b307a..ed6d64e07 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
@@ -93,7 +93,15 @@ public class AjState {
// we can't do an incremental build if one of our paths
// has changed, or a jar on a path has been modified
- if (pathChange(buildConfig,newBuildConfig)) return false;
+ if (pathChange(buildConfig,newBuildConfig)) {
+ // last time we built, .class files and resource files from jars on the
+ // inpath will have been copied to the output directory.
+ // these all need to be deleted in preparation for the clean build that is
+ // coming - otherwise a file that has been deleted from an inpath jar
+ // since the last build will not be deleted from the output directory.
+ removeAllResultsOfLastBuild();
+ return false;
+ }
simpleStrings = new ArrayList();
qualifiedStrings = new ArrayList();
@@ -257,6 +265,33 @@ public class AjState {
return toWeave;
}
+ /**
+ * Called when a path change is about to trigger a full build, but
+ * we haven't cleaned up from the last incremental build...
+ */
+ private void removeAllResultsOfLastBuild() {
+ // remove all binarySourceFiles, and all classesFromName...
+ for (Iterator iter = binarySourceFiles.values().iterator(); iter.hasNext();) {
+ List ucfs = (List) iter.next();
+ for (Iterator iterator = ucfs.iterator(); iterator.hasNext();) {
+ UnwovenClassFile ucf = (UnwovenClassFile) iterator.next();
+ try {
+ ucf.deleteRealFile();
+ } catch (IOException ex) { /* we did our best here */ }
+ }
+ }
+ for (Iterator iterator = classesFromName.values().iterator(); iterator.hasNext();) {
+ UnwovenClassFile ucf = (UnwovenClassFile) iterator.next();
+ try {
+ ucf.deleteRealFile();
+ } catch (IOException ex) { /* we did our best here */ }
+ }
+ for (Iterator iter = resources.iterator(); iter.hasNext();) {
+ String resource = (String) iter.next();
+ new File(buildConfig.getOutputDir(),resource).delete();
+ }
+ }
+
private void deleteClassFiles() {
for (Iterator i = deletedFiles.iterator(); i.hasNext(); ) {
File deletedFile = (File)i.next();