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
///\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
/**\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
/// 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
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
} else {\r
File srcFile = new File(srcFileName);\r
if (!srcFile.exists()) {\r
- throw new BuildException(srcFileName + " doesn't exist !!!");\r
+ throw new BuildException("Source File name: " + srcFileName + " doesn't exist!!!");\r
}\r
srcTimeStamp = srcFile.lastModified();\r
timeStampCache.put(srcFileName, new Long(srcTimeStamp));\r
}\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