6931d8170656b8a89b1b0dab00d769d24fd18ff5
1 <?xml version=
"1.0" encoding=
"UTF-8"?>
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
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.
12 <project default=
"all" basedir=
"." name=
"SurfaceArea">
13 <taskdef resource=
"net/sf/antcontrib/antlib.xml"/>
14 <property environment=
"env" />
15 <property name=
"WORKSPACE" value=
"${env.WORKSPACE}"/>
16 <taskdef resource=
"net/sf/antcontrib/antlib.xml"/>
19 <fileset dir=
"${WORKSPACE}/Tools/Jars">
20 <include name=
"*.jar"/>
22 <fileset dir=
"${env.XMLBEANS_HOME}/lib">
23 <include name=
"*.jar"/>
25 <pathelement path =
"${env.CLASSPATH}"/>
29 <uptodate targetfile=
"${WORKSPACE}/Tools/Jars/SurfaceArea.jar" property=
"jar.newer">
30 <srcfiles dir=
"${WORKSPACE}/Tools/XMLSchema" includes=
"*.xsd"/>
35 Generate SurfaceArea.jar and source code
37 <target name=
"SurfaceArea.jar" depends=
"init">
38 <java classname=
"org.apache.xmlbeans.impl.tool.SchemaCompiler">
39 <classpath refid=
"classpath"/>
40 <arg value=
"-javasource"/>
44 <arg value=
"${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
45 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
46 <arg value=
"${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>
47 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>
51 <target name=
"SurfaceArea.java" depends=
"init">
52 <antcall target=
"SurfaceArea.java.clean"/>
53 <java classname=
"org.apache.xmlbeans.impl.tool.SchemaCompiler">
54 <classpath refid=
"classpath"/>
55 <arg value=
"-javasource"/>
58 <arg value=
"-srconly"/>
60 <arg value=
"${WORKSPACE}/Tools/Java/Source/SurfaceArea"/>
61 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
62 <arg value=
"${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>
63 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>
67 <target name=
"SurfaceArea" depends=
"init" unless=
"jar.newer">
68 <antcall target=
"SurfaceArea.java.clean"/>
69 <java classname=
"org.apache.xmlbeans.impl.tool.SchemaCompiler" fork=
"true">
70 <classpath refid=
"classpath"/>
71 <arg value=
"-javasource"/>
75 <arg value=
"${WORKSPACE}/Tools/Java/Source/SurfaceArea"/>
77 <arg value=
"${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
78 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
79 <arg value=
"${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>
80 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>
84 <target name=
"SurfaceArea.java.clean">
85 <delete includeemptydirs=
"true" failonerror=
"false">
86 <fileset dir=
"${WORKSPACE}/Tools/Java/Source/SurfaceArea" includes=
"org"/>
90 <target name=
"SurfaceArea.jar.clean">
94 Surface Area Description file validation
96 <target name=
"validate">
97 <echo message=
"Validating ... ${SURFACE_AREA_FILE}"/>
99 java -classpath %cp% org.apache.xmlbeans.impl.tool.InstanceValidator %*
101 <copy file=
"${SURFACE_AREA_FILE}" tofile=
"${SURFACE_AREA_FILE}.xml"/>
102 <java classname=
"org.apache.xmlbeans.impl.tool.InstanceValidator"
103 outputproperty=
"XMLBEANS_OUTPUT"
104 errorproperty=
"XMLBEANS_ERROR">
106 <classpath refid=
"classpath"/>
108 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
109 <arg value=
"${SURFACE_AREA_FILE}.xml"/>
113 <delete file=
"${SURFACE_AREA_FILE}.xml" quiet=
"true"/>
116 <contains string=
"${XMLBEANS_OUTPUT}" substring=
"NOT valid"/>
117 <contains string=
"${XMLBEANS_OUTPUT}" substring=
": error:"/>
118 <contains string=
"${XMLBEANS_ERROR}" substring=
"XmlException"/>
119 <contains string=
"${XMLBEANS_ERROR}" substring=
": error:"/>
122 <echo message=
"Result ... ${XMLBEANS_OUTPUT}
${XMLBEANS_ERROR}"/>
123 <fail message=
"${SURFACE_AREA_FILE} is invalid!"/>
126 <echo message=
"Result ... ${SURFACE_AREA_FILE} is valid"/>
134 <target name=
"pretty">
135 <echo message=
"Beautify ... ${SURFACE_AREA_FILE}"/>
137 java -classpath %cp% org.apache.xmlbeans.impl.tool.PrettyPrinter %*
139 <java classname=
"org.apache.xmlbeans.impl.tool.PrettyPrinter"
140 errorproperty=
"XMLBEANS_OUTPUT"
141 output=
"${SURFACE_AREA_FILE}">
143 <classpath refid=
"classpath"/>
144 <arg value=
"-indent"/>
146 <arg value=
"${SURFACE_AREA_FILE}"/>
151 <equals arg1=
"${XMLBEANS_OUTPUT}" arg2=
""/>
153 <echo message=
"Result ... DONE"/>
156 <echo message=
"Result ... ${XMLBEANS_OUTPUT}"/>
162 generate Surface Area template file from schema
164 <target name=
"generate">
165 <echo message=
"Generating ... ${SURFACE_AREA_FILE}"/>
167 java -classpath %cp% org.apache.xmlbeans.impl.xsd2inst.SchemaInstanceGenerator %*
169 <java classname=
"org.apache.xmlbeans.impl.xsd2inst.SchemaInstanceGenerator" fork=
"true"
170 errorproperty=
"XMLBEANS_OUTPUT"
171 output=
"${SURFACE_AREA_FILE}.tmp">
173 <classpath refid=
"classpath"/>
175 <arg value=
"${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
177 <arg value=
"${SURFACE_AREA_ELEMENT}"/>
181 <concat destfile=
"${SURFACE_AREA_FILE}">
182 <header trimleading=
"yes" filtering=
"no"><![CDATA[
<?xml version=
"1.0" encoding=
"UTF-8"?>]]
>
184 <fileset file=
"${SURFACE_AREA_FILE}.tmp"/>
187 <delete file=
"${SURFACE_AREA_FILE}.tmp" deleteonexit=
"true" quiet=
"true"/>
189 <equals arg1=
"${XMLBEANS_OUTPUT}" arg2=
""/>
191 <echo message=
"Result ... DONE"/>
194 <echo message=
"Result ... ${XMLBEANS_OUTPUT}"/>
199 <target name=
"clean" depends=
"SurfaceArea.java.clean">
202 <target name=
"cleanall" depends=
"SurfaceArea.jar.clean">
203 <delete file=
"${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
205 <available file=
"${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
207 <echo message=
"You must manually remove the file: ${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
208 <echo message=
"Java has already loaded the file, and cannot remove it within ANT!"/>
213 <target name=
"all" depends=
"SurfaceArea">
216 <target name=
"install" depends=
"SurfaceArea.jar">