Make cleanall fail if executing ant cleanall, without the -noclasspath option.
[mirror_edk2.git] / Tools / build.xml
index 14f5afc..820bc2c 100644 (file)
@@ -102,6 +102,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </target>\r
 \r
   <target name="cleanall">\r
+    <available classname="org.tianocore.frameworkwizard.FrameworkWizardUI" property="FrameworkWizardUI.available"/>\r
+    <available classname="org.tianocore.build.GenBuildTask" property="GenBuildTask.available"/>\r
+    <available classname="org.tianocore.framework.tasks.Tool" property="Tool.available"/>\r
+    <available classname="org.tianocore.pcd.action.BuildAction" property="PcdClass.available"/>\r
+    <if>\r
+      <or>\r
+        <isset property="FrameworkWizardUI.available"/>\r
+        <isset property="GenBuildTask.available"/>\r
+        <isset property="Tool.available"/>\r
+        <isset property="PcdClass.available"/>\r
+      </or>\r
+      <then>\r
+        <fail message="Use ant -noclasspath cleanall, to remove all jar files!"/>\r
+      </then>\r
+    </if>\r
     <subant target="cleanall" inheritall="true">\r
       <filelist dir="."\r
         files="\r