Fix the bug of library instance selection interference between different archs of...
[mirror_edk2.git] / Tools / Source / SurfaceArea / build.xml
CommitLineData
878ddf1f 1<?xml version="1.0" encoding="UTF-8"?>\r
2<!--\r
3Copyright (c) 2006, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11-->\r
12<project default="all" basedir="." name="SurfaceArea">\r
13 <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
14 <property environment="env" />\r
15 <property name="WORKSPACE" value="${env.WORKSPACE}"/>\r
16 <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
17\r
18 <path id="classpath">\r
19 <fileset dir="${WORKSPACE}/Tools/Jars">\r
20 <include name="*.jar"/>\r
21 </fileset>\r
19924945 22 <fileset dir="${env.XMLBEANS_HOME}/lib">\r
878ddf1f 23 <include name="*.jar"/>\r
24 </fileset>\r
25 <pathelement path = "${env.CLASSPATH}"/>\r
26 </path>\r
27\r
28 <target name="init">\r
29 <uptodate targetfile="${WORKSPACE}/Tools/Jars/SurfaceArea.jar" property="jar.newer">\r
30 <srcfiles dir="${WORKSPACE}/Tools/XMLSchema" includes="*.xsd"/>\r
31 </uptodate>\r
32 </target>\r
33\r
34 <!--\r
35 Generate SurfaceArea.jar and source code \r
36 -->\r
37 <target name="SurfaceArea.jar" depends="init">\r
38 <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler">\r
39 <classpath refid="classpath"/>\r
40 <arg value="-javasource"/>\r
41 <arg value="1.5"/>\r
42 <arg value="-dl"/>\r
43 <arg value="-out"/>\r
44 <arg value="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>\r
45 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>\r
9c39e214 46 <arg value="${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>\r
878ddf1f 47 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>\r
48 </java>\r
49 </target>\r
50 \r
51 <target name="SurfaceArea.java" depends="init">\r
52 <antcall target="SurfaceArea.java.clean"/>\r
53 <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler">\r
54 <classpath refid="classpath"/>\r
55 <arg value="-javasource"/>\r
56 <arg value="1.5"/>\r
57 <arg value="-dl"/>\r
58 <arg value="-srconly"/>\r
59 <arg value="-src"/>\r
60 <arg value="${WORKSPACE}/Tools/Source/SurfaceArea"/>\r
61 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>\r
9c39e214 62 <arg value="${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>\r
878ddf1f 63 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>\r
64 </java>\r
65 </target>\r
66 \r
67 <target name="SurfaceArea" depends="init" unless="jar.newer">\r
68 <antcall target="SurfaceArea.java.clean"/>\r
f3dcd511 69 <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler" fork="true">\r
878ddf1f 70 <classpath refid="classpath"/>\r
71 <arg value="-javasource"/>\r
72 <arg value="1.5"/>\r
73 <arg value="-dl"/>\r
74 <arg value="-src"/>\r
75 <arg value="${WORKSPACE}/Tools/Source/SurfaceArea"/>\r
76 <arg value="-out"/>\r
77 <arg value="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>\r
78 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>\r
9c39e214 79 <arg value="${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>\r
878ddf1f 80 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>\r
81 </java>\r
82 </target>\r
83 \r
84 <target name="SurfaceArea.java.clean">\r
8db3db9a 85 <delete includeemptydirs="true" failonerror="false">\r
86 <fileset dir="${WORKSPACE}/Tools/Source/SurfaceArea/org" includes="**/*"/>\r
878ddf1f 87 </delete>\r
88 </target>\r
89\r
90 <target name="SurfaceArea.jar.clean">\r
91 </target>\r
92 \r
93 <!--\r
94 Surface Area Description file validation\r
95 -->\r
96 <target name="validate">\r
97 <echo message="Validating ... ${SURFACE_AREA_FILE}"/>\r
98 <!--\r
99 java -classpath %cp% org.apache.xmlbeans.impl.tool.InstanceValidator %*\r
100 -->\r
101 <copy file="${SURFACE_AREA_FILE}" tofile="${SURFACE_AREA_FILE}.xml"/>\r
102 <java classname="org.apache.xmlbeans.impl.tool.InstanceValidator" \r
6c96db71 103 outputproperty="XMLBEANS_OUTPUT"\r
104 resultproperty="XMLBEANS_RESULT"\r
105 errorproperty="XMLBEANS_ERROR">\r
878ddf1f 106 \r
107 <classpath refid="classpath"/>\r
108 <arg value="-dl"/>\r
109 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>\r
110 <arg value="${SURFACE_AREA_FILE}.xml"/>\r
111 \r
112 </java> \r
113\r
114 <delete file="${SURFACE_AREA_FILE}.xml" quiet="true"/>\r
6c96db71 115 <if>\r
116 <contains string="${XMLBEANS_OUTPUT}" substring="NOT valid"/>\r
117 <then>\r
118 <fail message="Result ... ${XMLBEANS_OUTPUT}"/>\r
119 </then>\r
120 <else>\r
121 <echo message="Result ... ${XMLBEANS_OUTPUT}"/>\r
122 </else>\r
123 </if>\r
878ddf1f 124 </target>\r
125 \r
126 <!--\r
127 beautify xml file\r
128 -->\r
129 <target name="pretty">\r
130 <echo message="Beautify ... ${SURFACE_AREA_FILE}"/>\r
131 <!--\r
132 java -classpath %cp% org.apache.xmlbeans.impl.tool.PrettyPrinter %*\r
133 -->\r
134 <java classname="org.apache.xmlbeans.impl.tool.PrettyPrinter" \r
135 errorproperty="XMLBEANS_OUTPUT"\r
136 output="${SURFACE_AREA_FILE}">\r
137 \r
138 <classpath refid="classpath"/>\r
139 <arg value="-indent"/>\r
140 <arg value="2"/>\r
141 <arg value="${SURFACE_AREA_FILE}"/>\r
142 \r
143 </java>\r
144\r
145 <if>\r
146 <equals arg1="${XMLBEANS_OUTPUT}" arg2=""/>\r
147 <then>\r
148 <echo message="Result ... DONE"/>\r
149 </then>\r
150 <else>\r
151 <echo message="Result ... ${XMLBEANS_OUTPUT}"/>\r
152 </else>\r
153 </if>\r
154 </target>\r
155\r
156 <!--\r
157 generate Surface Area template file from schema\r
158 -->\r
159 <target name="generate">\r
160 <echo message="Generating ... ${SURFACE_AREA_FILE}"/>\r
161 <!--\r
162 java -classpath %cp% org.apache.xmlbeans.impl.xsd2inst.SchemaInstanceGenerator %*\r
163 -->\r
164 <java classname="org.apache.xmlbeans.impl.xsd2inst.SchemaInstanceGenerator" fork="true"\r
165 errorproperty="XMLBEANS_OUTPUT" \r
166 output="${SURFACE_AREA_FILE}.tmp">\r
167 \r
168 <classpath refid="classpath"/>\r
169 <arg value="-dl"/>\r
170 <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>\r
171 <arg value="-name"/>\r
172 <arg value="${SURFACE_AREA_ELEMENT}"/>\r
173 \r
174 </java>\r
175\r
176 <concat destfile="${SURFACE_AREA_FILE}">\r
177 <header trimleading="yes" filtering="no"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>]]>\r
178 </header>\r
179 <fileset file="${SURFACE_AREA_FILE}.tmp"/>\r
180 </concat>\r
181 \r
182 <delete file="${SURFACE_AREA_FILE}.tmp" deleteonexit="true" quiet="true"/>\r
183 <if>\r
184 <equals arg1="${XMLBEANS_OUTPUT}" arg2=""/>\r
185 <then>\r
186 <echo message="Result ... DONE"/>\r
187 </then>\r
188 <else>\r
189 <echo message="Result ... ${XMLBEANS_OUTPUT}"/>\r
190 </else>\r
191 </if>\r
192 </target>\r
193\r
194 <target name="clean" depends="SurfaceArea.java.clean">\r
195 </target>\r
196\r
197 <target name="cleanall" depends="SurfaceArea.jar.clean">\r
617cc72b 198 <delete file="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>\r
878ddf1f 199 <if>\r
200 <available file="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>\r
201 <then>\r
202 <echo message="You must manually remove the file: ${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>\r
203 <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>\r
204 </then>\r
205 </if>\r
206 </target>\r
207\r
208 <target name="all" depends="SurfaceArea">\r
209 </target>\r
210\r
211 <target name="install" depends="SurfaceArea.jar">\r
212 </target>\r
213\r
214</project> \r