9d4e6dbc3903a47080f2cff404f21357dde1c831
[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 "/>
45 </subant>
46 <echo message="The EDK II Java Tools build has completed!"/>
47 </target>
48
49 <target name="Wizard" depends="SurfaceArea">
50 <subant target="" verbose="true" inheritall="false">
51 <!-- Note: this is an ordered list. The projects have dependencies between them. -->
52 <filelist dir="."
53 files="
54 Java/Source/FrameworkWizard/build.xml
55 "/>
56 </subant>
57 </target>
58
59 <target name="Merge" depends="SurfaceArea">
60 <subant target="" verbose="true" inheritall="false">
61 <filelist dir="."
62 files="
63 Java/Source/Merge/build.xml
64 "/>
65 </subant>
66 </target>
67
68 <target name="SurfaceArea" depends="makeCatalog">
69 <subant target="" verbose="true" inheritall="false">
70 <filelist dir="."
71 files="
72 Java/Source/SurfaceArea/build.xml
73 "/>
74 </subant>
75 </target>
76
77 <target name="makeCatalog">
78 <if>
79 <not>
80 <available file="XMLSchema/catalog.xml"/>
81 </not>
82 <then>
83 <echo file="XMLSchema/catalog.xml"><![CDATA[<?xml version="1.0"?>
84 <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.xsd">
85 <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
86 <rewriteSystem systemIdStartString="http://www.TianoCore.org/2006/Edk2.0/"
87 rewritePrefix="file:/]]>${env.WORKSPACE}<![CDATA[/Tools/XMLSchema/"/>
88 <rewriteURI uriStartString="http://www.TianoCore.org/2006/Edk2.0/"
89 rewritePrefix="file:/]]>${env.WORKSPACE}<![CDATA[/Tools/XMLSchema/"/>
90 </catalog>]]>
91 </echo>
92 </then>
93 </if>
94 <if>
95 <not>
96 <available file="Conf/tools_def.txt"/>
97 </not>
98 <then>
99 <copy file="Conf/tools_def.template" tofile="Conf/tools_def.txt"/>
100 </then>
101 </if>
102
103 <if>
104 <not>
105 <available file="Conf/target.txt"/>
106 </not>
107 <then>
108 <copy file="Conf/target.template" tofile="Conf/target.txt"/>
109 </then>
110 </if>
111
112 <if>
113 <not>
114 <available file="Conf/FrameworkDatabase.db"/>
115 </not>
116 <then>
117 <copy file="Conf/FrameworkDatabase.template" tofile="Conf/FrameworkDatabase.db"/>
118 </then>
119 </if>
120 </target>
121
122 <target name="reconfig">
123 <!-- backup all config files -->
124 <if>
125 <available file="Conf/target.txt"/>
126 <then>
127 <echo message="Backup Conf/target.txt to Conf/target.txt.bak" />
128 <copy file="Conf/target.txt" tofile="Conf/target.txt.bak" overwrite="true" />
129 </then>
130 </if>
131 <if>
132 <available file="Conf/tools_def.txt"/>
133 <then>
134 <echo message="Backup Conf/tools_def.txt to Conf/tools_def.txt.bak" />
135 <copy file="Conf/tools_def.txt" tofile="Conf/tools_def.txt.bak" overwrite="true" />
136 </then>
137 </if>
138 <if>
139 <available file="Conf/FrameworkDatabase.db"/>
140 <then>
141 <echo message="Backup Conf/FrameworkDatabase.db to Conf/FrameworkDatabase.db.bak" />
142 <copy file="Conf/FrameworkDatabase.db" tofile="Conf/FrameworkDatabase.db.bak" overwrite="true" />
143 </then>
144 </if>
145
146 <if>
147 <available file="Conf/tools_def.template"/>
148 <then>
149 <echo message="Copy file from Conf/tools_def.template to Conf/tools_def.txt" />
150 <copy file="Conf/tools_def.template" tofile="Conf/tools_def.txt" overwrite="true" />
151 </then>
152 </if>
153
154 <if>
155 <available file="Conf/target.template"/>
156 <then>
157 <echo message="Copy file from Conf/target.template to Conf/target.txt" />
158 <copy file="Conf/target.template" tofile="Conf/target.txt" overwrite="true" />
159 </then>
160 </if>
161
162 <if>
163 <available file="Conf/FrameworkDatabase.template"/>
164 <then>
165 <echo message="Copy file from Conf/FrameworkDatabase.template to Conf/FrameworkDatabase.db" />
166 <copy file="Conf/FrameworkDatabase.template" tofile="Conf/FrameworkDatabase.db" overwrite="true" />
167 </then>
168 </if>
169 </target>
170
171 <target name="clean">
172 <subant target="clean" inheritall="false">
173 <filelist dir="."
174 files="
175 Java/Source/FrameworkWizard/build.xml
176 Java/Source/Cpptasks/build.xml
177 Java/Source/FrameworkTasks/build.xml
178 Java/Source/GenBuild/build.xml
179 Java/Source/PcdTools/build.xml
180 Java/Source/Common/build.xml
181 Java/Source/SurfaceArea/build.xml
182 Java/Source/MigrationTools/build.xml
183 Java/Source/ContextTool/build.xml
184 Java/Source/Merge/build.xml
185 CCode/Source/build.xml
186 "/>
187 </subant>
188 </target>
189
190 <target name="cleanall">
191 <echo message="Removing extra ${env.WORKSPACE} history.xml files!"/>
192 <if>
193 <available file="${env.WORKSPACE}/Tools/bin/history.xml"/>
194 <then>
195 <delete failonerror="false" quiet="true">
196 <fileset file="${env.WORKSPACE}/Tools/bin/history.xml"/>
197 </delete>
198 </then>
199 </if>
200 <if>
201 <available file="${env.WORKSPACE}/Tools/CCode/Source/Library/history.xml"/>
202 <then>
203 <delete failonerror="false" quiet="true">
204 <fileset file="${env.WORKSPACE}/Tools/CCode/Source/Library/history.xml"/>
205 </delete>
206 </then>
207 </if>
208 <available classname="org.tianocore.frameworkwizard.FrameworkWizardUI" property="FrameworkWizardUI.available"/>
209 <available classname="org.tianocore.build.GenBuildTask" property="GenBuildTask.available"/>
210 <available classname="org.tianocore.framework.tasks.Tool" property="Tool.available"/>
211 <available classname="org.tianocore.pcd.action.BuildAction" property="PcdClass.available"/>
212 <if>
213 <or>
214 <isset property="FrameworkWizardUI.available"/>
215 <isset property="GenBuildTask.available"/>
216 <isset property="Tool.available"/>
217 <isset property="PcdClass.available"/>
218 </or>
219 <then>
220 <fail message="Use ant -noclasspath cleanall, to remove all jar files!"/>
221 </then>
222 </if>
223 <subant target="cleanall" inheritall="true">
224 <filelist dir="."
225 files="
226 Java/Source/FrameworkWizard/build.xml
227 Java/Source/Cpptasks/build.xml
228 Java/Source/FrameworkTasks/build.xml
229 Java/Source/GenBuild/build.xml
230 Java/Source/PcdTools/build.xml
231 Java/Source/Common/build.xml
232 Java/Source/SurfaceArea/build.xml
233 Java/Source/MigrationTools/build.xml
234 Java/Source/ContextTool/build.xml
235 Java/Source/Merge/build.xml
236 CCode/Source/build.xml
237 "/>
238 </subant>
239 </target>
240 </project>