]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/global/OnDependency.java
Fixed an issue which will cause dependency check failure
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / OnDependency.java
index 4177b50466c043d06b7b726286662583eae75c2c..173528ab392f97b422572c56af12415514f43e8e 100644 (file)
@@ -21,6 +21,7 @@ import java.util.Map;
 import org.apache.tools.ant.BuildException;\r
 import org.apache.tools.ant.Task;\r
 import org.apache.tools.ant.taskdefs.Sequential;\r
+import org.tianocore.common.logger.EdkLog;\r
 \r
 /**\r
  Class OnDepdendency is used to check the timestamp between source files and\r
@@ -31,7 +32,7 @@ public class OnDependency extends Task {
     ///\r
     /// cache the modified timestamp of files accessed, to speed up the depencey check\r
     /// \r
-    private static Map<String, Long> timeStampCache = new HashMap<String, Long>();\r
+    private Map<String, Long> timeStampCache = new HashMap<String, Long>();\r
     ///\r
     /// source files list\r
     ///\r
@@ -54,7 +55,7 @@ public class OnDependency extends Task {
     /**\r
      Standard execute method of ANT task\r
      **/\r
-    public void execute() {\r
+    public void execute() throws BuildException {\r
         if (isOutOfDate() && task != null) {\r
             task.perform();\r
         }\r
@@ -68,6 +69,12 @@ public class OnDependency extends Task {
         /// if no source files specified, take it as a fresh start\r
         ///\r
         if (sources.nameList.size() == 0) {\r
+            EdkLog.log(this, EdkLog.EDK_VERBOSE, "No source file spcified!");\r
+            return true;\r
+        }\r
+\r
+        if (targets.nameList.size() == 0) {\r
+            EdkLog.log(this, EdkLog.EDK_VERBOSE, "No target file found!");\r
             return true;\r
         }\r
 \r
@@ -76,6 +83,7 @@ public class OnDependency extends Task {
             String dstFileName = (String)dstIt.next();\r
             File dstFile = new File(dstFileName);\r
             if (!dstFile.exists()) {\r
+                EdkLog.log(this, EdkLog.EDK_VERBOSE, "Target file [" + dstFileName + "] doesn't exist!");\r
                 return true;\r
             }\r
 \r
@@ -97,11 +105,13 @@ public class OnDependency extends Task {
                 }\r
 \r
                 if (dstTimeStamp < srcTimeStamp) {\r
+                    EdkLog.log(this, EdkLog.EDK_VERBOSE, "Source file [" + srcFileName + "] has been changed since last build!");\r
                     return true;\r
                 }\r
             }\r
         }\r
 \r
+        EdkLog.log(this, EdkLog.EDK_VERBOSE, "Target files are up-to-date!");\r
         return false;\r
     }\r
 \r