diff options
author | acolyer <acolyer> | 2004-03-17 11:36:47 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-03-17 11:36:47 +0000 |
commit | 90fbe5d804038002cc651421a5bc94a2b20f7e70 (patch) | |
tree | 5a5a6448a89f83e5a1aae8d3e2cb586aae206e71 /org.aspectj.ajdt.core | |
parent | be76ce460676d1dbc75b95c32358412c4d5ed7f1 (diff) | |
download | aspectj-90fbe5d804038002cc651421a5bc94a2b20f7e70.tar.gz aspectj-90fbe5d804038002cc651421a5bc94a2b20f7e70.zip |
fix for Bugzilla Bug 54618
Test to see if we can compile incrementally ignores path changes
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java | 39 |
1 files changed, 39 insertions, 0 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 a63847a06..232f93126 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 @@ -83,8 +83,13 @@ public class AjState { return false; } + // we don't support incremental with an outjar yet if (newBuildConfig.getOutputJar() != null) return false; + // 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; + simpleStrings = new ArrayList(); qualifiedStrings = new ArrayList(); @@ -121,6 +126,40 @@ public class AjState { return ret; } + private boolean pathChange(AjBuildConfig oldConfig, AjBuildConfig newConfig) { + boolean changed = false; + List oldClasspath = oldConfig.getClasspath(); + List newClasspath = newConfig.getClasspath(); + if (changed(oldClasspath,newClasspath)) return true; + List oldAspectpath = oldConfig.getAspectpath(); + List newAspectpath = newConfig.getAspectpath(); + if (changed(oldAspectpath,newAspectpath)) return true; + List oldInJars = oldConfig.getInJars(); + List newInJars = newConfig.getInJars(); + if (changed(oldInJars,newInJars)) return true; + List oldInPath = oldConfig.getInpath(); + List newInPath = newConfig.getInpath(); + if (changed(oldInPath, newInPath)) return true; + return changed; + } + + private boolean changed(List oldPath, List newPath) { + if (oldPath == null) oldPath = new ArrayList(); + if (newPath == null) newPath = new ArrayList(); + if (oldPath.size() != newPath.size()) { + return true; + } + for (int i = 0; i < oldPath.size(); i++) { + if (!oldPath.get(i).equals(newPath.get(i))) { + return true; + } + File f = new File((String)oldPath.get(i)); + if (f.exists() && !f.isDirectory() && (f.lastModified() >= lastSuccessfulBuildTime)) { + return true; + } + } + return false; + } public List getFilesToCompile(boolean firstPass) { List thisTime = new ArrayList(); |