summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-24 00:58:42 +0000
committeraclement <aclement>2009-03-24 00:58:42 +0000
commitc017db4d89081fe954e645cc53585cf0df98c2ed (patch)
tree402c9297e9495c2b0ccc43c859d901e483934917 /org.aspectj.ajdt.core
parentbd57a2e9ad8b5e40c110b669df586d97ce1ee323 (diff)
downloadaspectj-c017db4d89081fe954e645cc53585cf0df98c2ed.tar.gz
aspectj-c017db4d89081fe954e645cc53585cf0df98c2ed.zip
268827: ask for the JDT project state
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java3
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java19
2 files changed, 22 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java
index 8eb0e9434..8ea5c2c17 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java
@@ -75,9 +75,12 @@ public interface CompilationResultDestinationManager {
*/
void reportFileRemove(String outputfile, int filetype);
+ int discoverChangesSince(File dir, long buildtime);
+
// match numbers in IOutputLocationManager - ought to factor into super interface
int FILETYPE_UNKNOWN = 0;
int FILETYPE_CLASS = 1;
int FILETYPE_OUTJAR = 2;
int FILETYPE_RESOURCE = 3;
+
}
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 7c005a045..10bf2a345 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
@@ -432,6 +432,7 @@ public class AjState implements CompilerConfigurationChangeFlags {
getListener().recordDecision("Failed to find a state instance managing output location : " + dir);
}
}
+
// pr268827 - this guard will cause us to exit quickly if the state says there really is
// nothing of interest. This will not catch the case where a user modifies the .class files outside of
@@ -443,6 +444,24 @@ public class AjState implements CompilerConfigurationChangeFlags {
}
return CLASS_FILE_NO_CHANGES;
}
+
+ if (state == null) {
+ // This may be because the directory is the output path of a Java project upon which we depend
+ // we need to call back into AJDT to ask about that projects state.
+ CompilationResultDestinationManager crdm = buildConfig.getCompilationResultDestinationManager();
+ if (crdm!=null) {
+ int i = crdm.discoverChangesSince(dir,lastSuccessfulBuildTime);
+ // 0 = dontknow if it has changed
+ // 1 = definetly not changed at all
+ // further numbers can determine more granular changes
+ if (i==1) {
+ if (listenerDefined()) {
+ getListener().recordDecision("'"+dir+"' is apparently unchanged so not performing timestamp check");
+ }
+ return CLASS_FILE_NO_CHANGES;
+ }
+ }
+ }
List classFiles = FileUtil.listClassFiles(dir);