Added code to check if "cmd" attribute is valid or not. This is to make error report...
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Oct 2006 05:55:36 +0000 (05:55 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Oct 2006 05:55:36 +0000 (05:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1702 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineDef.java

index d983880..9b66ebe 100644 (file)
@@ -227,6 +227,13 @@ public class UserDefineDef extends ProcessorDef {
         if (isReference()) {\r
             throw tooManyAttributes();\r
         }\r
         if (isReference()) {\r
             throw tooManyAttributes();\r
         }\r
+        if (cmd == null || cmd.trim().length() == 0) {\r
+            throw new BuildException("cmd attribute is empty!");\r
+        }\r
+        File cmdProgram = new File(cmd);\r
+        if (cmdProgram.isDirectory()) {\r
+            throw new BuildException(cmd + " is not valid or executable!");\r
+        }\r
         this.cmd = cmd;\r
     }\r
 \r
         this.cmd = cmd;\r
     }\r
 \r