Original range calculation in GetNextFile() is incorrect.
[people/mcb30/edk2.git] / edk2 / Tools / build.xml
1 <?xml version="1.0"?>\r
2 <!--\r
3 Copyright (c) 2006, Intel Corporation\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution.  The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8 \r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11 -->\r
12 <project name="Tools" default="all" basedir=".">\r
13 \r
14   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
15   <property environment="env"/>\r
16 \r
17   <target name="all" depends="C_Code">\r
18     <echo message="The EDK II Tools build has completed!"/>\r
19   </target>\r
20 \r
21   <target name="C_Code" depends="JavaCode">\r
22     <subant target="" inheritall="false">\r
23       <filelist dir="."\r
24         files="\r
25           CCode/Source/build.xml\r
26           "/>\r
27     </subant>\r
28   </target>\r
29 \r
30   <target name="JavaCode" depends="SurfaceArea">\r
31     <subant target="" verbose="true" inheritall="false">\r
32       <!-- Note: this is an ordered list. The projects have dependencies between them. -->\r
33       <filelist dir="."\r
34         files="\r
35           Java/Source/Common/build.xml\r
36           Java/Source/PcdTools/build.xml\r
37           Java/Source/GenBuild/build.xml\r
38           Java/Source/FrameworkTasks/build.xml\r
39           Java/Source/Cpptasks/build.xml\r
40           Java/Source/FrameworkWizard/build.xml\r
41           Java/Source/MigrationTools/build.xml\r
42           Java/Source/ContextTool/build.xml\r
43           Java/Source/Merge/build.xml\r
44           Java/Source/CheckTools/build.xml\r
45           Java/Source/DbTools/build.xml\r
46           "/>\r
47     </subant>\r
48     <echo message="The EDK II Java Tools build has completed!"/>\r
49   </target>\r
50 \r
51   <target name="Wizard" depends="SurfaceArea">\r
52     <subant target="" verbose="true" inheritall="false">\r
53       <!-- Note: this is an ordered list. The projects have dependencies between them. -->\r
54       <filelist dir="."\r
55         files="\r
56           Java/Source/FrameworkWizard/build.xml\r
57           "/>\r
58     </subant>\r
59   </target>\r
60 \r
61   <target name="Merge" depends="SurfaceArea">\r
62     <subant target="" verbose="true" inheritall="false">\r
63       <filelist dir="."\r
64         files="\r
65           Java/Source/Merge/build.xml\r
66           "/>\r
67     </subant>\r
68   </target>\r
69 \r
70   <target name="SurfaceArea" depends="makeCatalog">\r
71     <subant target="" verbose="true" inheritall="false">\r
72       <filelist dir="."\r
73         files="\r
74           Java/Source/SurfaceArea/build.xml\r
75           "/>\r
76     </subant>\r
77   </target>\r
78 \r
79   <target name="makeCatalog">\r
80     <if>\r
81       <not>\r
82         <available file="XMLSchema/catalog.xml"/>\r
83       </not>\r
84       <then>\r
85         <echo file="XMLSchema/catalog.xml"><![CDATA[<?xml version="1.0"?>\r
86 <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.xsd">\r
87 <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">\r
88   <rewriteSystem systemIdStartString="http://www.TianoCore.org/2006/Edk2.0/"\r
89     rewritePrefix="file:/]]>${env.WORKSPACE}<![CDATA[/Tools/XMLSchema/"/>\r
90   <rewriteURI uriStartString="http://www.TianoCore.org/2006/Edk2.0/"\r
91     rewritePrefix="file:/]]>${env.WORKSPACE}<![CDATA[/Tools/XMLSchema/"/>\r
92 </catalog>]]>\r
93 </echo>\r
94       </then>\r
95     </if>\r
96     <if>\r
97       <not>\r
98         <available file="Conf/tools_def.txt"/>\r
99       </not>\r
100       <then>\r
101         <copy file="Conf/tools_def.template" tofile="Conf/tools_def.txt"/>\r
102       </then>\r
103     </if>\r
104 \r
105     <if>\r
106       <not>\r
107         <available file="Conf/target.txt"/>\r
108       </not>\r
109       <then>\r
110         <copy file="Conf/target.template" tofile="Conf/target.txt"/>\r
111       </then>\r
112     </if>\r
113 \r
114     <if>\r
115       <not>\r
116         <available file="Conf/FrameworkDatabase.db"/>\r
117       </not>\r
118       <then>\r
119         <copy file="Conf/FrameworkDatabase.template" tofile="Conf/FrameworkDatabase.db"/>\r
120       </then>\r
121     </if>\r
122   </target>\r
123 \r
124   <target name="reconfig">\r
125     <!-- backup all config files -->\r
126     <if>\r
127       <available file="Conf/target.txt"/>\r
128       <then>\r
129         <echo message="Backup Conf/target.txt to Conf/target.txt.bak" />\r
130         <copy file="Conf/target.txt" tofile="Conf/target.txt.bak" overwrite="true" />\r
131       </then>\r
132     </if>\r
133     <if>\r
134       <available file="Conf/tools_def.txt"/>\r
135       <then>\r
136         <echo message="Backup Conf/tools_def.txt to Conf/tools_def.txt.bak" />\r
137         <copy file="Conf/tools_def.txt" tofile="Conf/tools_def.txt.bak"  overwrite="true" />\r
138       </then>\r
139     </if>\r
140     <if>\r
141       <available file="Conf/FrameworkDatabase.db"/>\r
142       <then>\r
143         <echo message="Backup Conf/FrameworkDatabase.db to Conf/FrameworkDatabase.db.bak" />\r
144         <copy file="Conf/FrameworkDatabase.db" tofile="Conf/FrameworkDatabase.db.bak"  overwrite="true" />\r
145       </then>\r
146     </if>\r
147     \r
148     <if>\r
149       <available file="Conf/tools_def.template"/>\r
150       <then>\r
151         <echo message="Copy file from Conf/tools_def.template to Conf/tools_def.txt" />\r
152         <copy file="Conf/tools_def.template" tofile="Conf/tools_def.txt" overwrite="true" />\r
153       </then>\r
154     </if>\r
155 \r
156     <if>\r
157       <available file="Conf/target.template"/>\r
158       <then>\r
159         <echo message="Copy file from Conf/target.template to Conf/target.txt" />\r
160         <copy file="Conf/target.template" tofile="Conf/target.txt" overwrite="true" />\r
161       </then>\r
162     </if>\r
163 \r
164     <if>\r
165       <available file="Conf/FrameworkDatabase.template"/>\r
166       <then>\r
167         <echo message="Copy file from Conf/FrameworkDatabase.template to Conf/FrameworkDatabase.db" />\r
168         <copy file="Conf/FrameworkDatabase.template" tofile="Conf/FrameworkDatabase.db" overwrite="true" />\r
169       </then>\r
170     </if>\r
171   </target>\r
172 \r
173   <target name="clean">\r
174     <subant target="clean" inheritall="false">\r
175       <filelist dir="."\r
176         files="\r
177           Java/Source/FrameworkWizard/build.xml \r
178           Java/Source/Cpptasks/build.xml \r
179           Java/Source/FrameworkTasks/build.xml \r
180           Java/Source/GenBuild/build.xml \r
181           Java/Source/PcdTools/build.xml \r
182           Java/Source/Common/build.xml \r
183           Java/Source/SurfaceArea/build.xml \r
184           Java/Source/MigrationTools/build.xml\r
185           Java/Source/ContextTool/build.xml\r
186           Java/Source/Merge/build.xml\r
187           Java/Source/CheckTools/build.xml\r
188           Java/Source/DbTools/build.xml\r
189           CCode/Source/build.xml\r
190         "/>\r
191     </subant>\r
192   </target>\r
193 \r
194   <target name="cleanall">\r
195     <echo message="Removing extra ${env.WORKSPACE} history.xml files!"/>\r
196     <if>\r
197       <available file="${env.WORKSPACE}/Tools/bin/history.xml"/>\r
198       <then>\r
199         <delete failonerror="false" quiet="true">\r
200           <fileset file="${env.WORKSPACE}/Tools/bin/history.xml"/>\r
201         </delete>\r
202       </then>\r
203     </if>\r
204     <if>\r
205       <available file="${env.WORKSPACE}/Tools/CCode/Source/Library/history.xml"/>\r
206       <then>\r
207         <delete failonerror="false" quiet="true">\r
208           <fileset file="${env.WORKSPACE}/Tools/CCode/Source/Library/history.xml"/>\r
209         </delete>\r
210       </then>\r
211     </if>\r
212     <available classname="org.tianocore.frameworkwizard.FrameworkWizardUI" property="FrameworkWizardUI.available"/>\r
213     <available classname="org.tianocore.build.GenBuildTask" property="GenBuildTask.available"/>\r
214     <available classname="org.tianocore.framework.tasks.Tool" property="Tool.available"/>\r
215     <available classname="org.tianocore.pcd.action.BuildAction" property="PcdClass.available"/>\r
216     <if>\r
217       <or>\r
218         <isset property="FrameworkWizardUI.available"/>\r
219         <isset property="GenBuildTask.available"/>\r
220         <isset property="Tool.available"/>\r
221         <isset property="PcdClass.available"/>\r
222       </or>\r
223       <then>\r
224         <fail message="Use ant -noclasspath cleanall, to remove all jar files!"/>\r
225       </then>\r
226     </if>\r
227     <subant target="cleanall" inheritall="true">\r
228       <filelist dir="."\r
229         files="\r
230           Java/Source/FrameworkWizard/build.xml \r
231           Java/Source/Cpptasks/build.xml \r
232           Java/Source/FrameworkTasks/build.xml \r
233           Java/Source/GenBuild/build.xml \r
234           Java/Source/PcdTools/build.xml \r
235           Java/Source/Common/build.xml \r
236           Java/Source/SurfaceArea/build.xml \r
237           Java/Source/MigrationTools/build.xml\r
238           Java/Source/ContextTool/build.xml\r
239           Java/Source/Merge/build.xml\r
240           Java/Source/CheckTools/build.xml\r
241           Java/Source/DbTools/build.xml\r
242           CCode/Source/build.xml\r
243         "/>\r
244     </subant>\r
245   </target>\r
246 </project>\r