]> source.dussan.org Git - aspectj.git/commitdiff
268827: ask for the JDT project state
authoraclement <aclement>
Tue, 24 Mar 2009 00:58:42 +0000 (00:58 +0000)
committeraclement <aclement>
Tue, 24 Mar 2009 00:58:42 +0000 (00:58 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java

index 8eb0e9434cde82b3a934c013c4c6185ad9d18605..8ea5c2c1781ee4ad06d0d2e98fc694b4f42a268d 100644 (file)
@@ -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;
+       
 }
index 7c005a045540134144f22b03734fa1fb27a9e143..10bf2a3459f01f620c40cd70f66dd34a8d526f5f 100644 (file)
@@ -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);