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