/[volute]/trunk/projects/theory/snapdm/build.xml
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 142 - (show annotations)
Tue Apr 1 18:06:25 2008 UTC (12 years, 8 months ago) by bourges.laurent
File MIME type: text/xml
File size: 9508 byte(s)
indent option for saxon
1 <?xml version="1.0" ?>
2
3 <!DOCTYPE project [
4 <!ENTITY buildJava SYSTEM "./build_java.xml">
5 ]>
6
7 <project name="Snap DM Transformer" default="about" basedir=".">
8
9 <description>
10 Transformer tool for SNAP DM (UML model) in other documents : XML schemas, documentation and code (java ...)
11 </description>
12
13
14 <!-- Get properties -->
15 <property file="build.properties"/>
16 <fail unless="build.by" message="bad configuration in build.properties !" />
17
18
19 <!-- set global properties for this build -->
20
21 <!-- maybe files should be in build.properties ? -->
22 <!-- input files -->
23 <property name="domain_source" value="DomainModelWithTemplate.xml" />
24 <property name="snap_source" value="SNAP_Simulation_DM_LBO_1.xml" />
25
26 <!-- output files -->
27 <property name="domain_source_filtered" value="DomainModelWithTemplate_FILTER.xml" />
28 <property name="snap_source_checked" value="SNAP_Simulation_DM_CHECK.xml" />
29 <property name="snap_source_filtered" value="SNAP_Simulation_DM_FILTER.xml" />
30 <property name="snap_source_filtered_preGen" value="SNAP_Simulation_DM_FOR_GEN.xml" />
31 <property name="out_schema" value="SNAP-xmi.xsd" />
32 <property name="out_xhtml" value="SNAP-xsd.html" />
33
34 <!-- paths -->
35 <property name="input" location="./input" />
36 <property name="output" location="./output" />
37 <property name="res" location="./res" />
38
39 <property name="outputJava" location="${output}/java" />
40
41
42 <!-- java props -->
43 <property name="root" location="."/>
44
45 <property name="sources" location="./src"/>
46 <property name="sources.gen" location="${outputJava}/src"/>
47
48 <property name="sources.gen.docs" location="${outputJava}/doc"/>
49
50 <property name="libs" location="./libs"/>
51
52 <!-- compile Sources -->
53 <property name="build" location="./build"/>
54 <property name="build.src" location="${build}/src"/>
55
56 <property name="build.gen" location="${build}/gen"/>
57
58
59 <!-- class paths -->
60 <path id="project.class.path">
61 <pathelement location="${libs}/commons-logging-1.1.jar"/>
62 <pathelement location="${libs}/log4j-1.2.15.jar"/>
63 </path>
64
65 <path id="infrastructure.class.path">
66 <pathelement location="${root}/${build.file}"/>
67 </path>
68
69
70 <!-- specific properties -->
71 <property name="root_package" value="org.ivoa"/>
72 <property name="model_package" value="org.ivoa.dm.model"/>
73
74
75
76
77 <!-- presets -->
78
79 <!-- Performs an XSL translation of an XML file using the Saxon processor. -->
80 <presetdef name="xslt2">
81 <!-- The processor=SaxonLiaison setting causes our custom XSLTLiaison class to be used. -->
82 <!-- This works around bug #41314: http://issues.apache.org/bugzilla/show_bug.cgi?id=41314 -->
83 <xslt classpath="${libs}/saxon9.jar:${libs}/anthack/" processor="SaxonLiaison">
84 <outputproperty name="{http://saxon.sf.net/}indent-spaces" value="2" />
85 </xslt>
86
87 </presetdef>
88
89
90
91
92 <!-- targets -->
93
94 <!-- target init : timestamp -->
95 <target name="init">
96 <tstamp>
97 <format property="build.date" pattern="dd/MM/yyyy HH:mm:ss" />
98 </tstamp>
99
100 <echo>-------------------------------------------------------------------------------</echo>
101 <echo> ${vendor} </echo>
102 <echo> ${title} - ${version} </echo>
103 <echo>-------------------------------------------------------------------------------</echo>
104 <echo> Build File </echo>
105 <echo>-------------------------------------------------------------------------------</echo>
106 <echo> contacts : ${build.by} </echo>
107 <echo> build date : ${build.date} </echo>
108 <echo>-------------------------------------------------------------------------------</echo>
109 </target>
110
111
112
113
114 <!-- target about : -->
115 <target name="about" depends="init" description="show information for public targets">
116 <echo>available ant targets : </echo>
117 <echo>-------------------------------------------------------------------------------</echo>
118 <echo> - makeAll : make all transformations (uml -> metaModel -> others) </echo>
119 <echo>-------------------------------------------------------------------------------</echo>
120 </target>
121
122
123
124
125 <!-- main target : generates all documents -->
126 <target name="makeAll" depends="init, cleanOutput, processDomain, processSnap" description="make all transformations">
127 <echo>makeAll : done.</echo>
128 </target>
129
130
131
132
133 <!-- target cleanOutput : clean output java files -->
134 <target name="cleanOutput">
135 <delete verbose="true">
136 <fileset dir="${root}" includes="*.log"/>
137 </delete>
138
139 <echo>cleaning directory : ${outputJava} ...</echo>
140
141 <!-- do not remove directories to have respect for .svn directories -->
142 <delete includeemptydirs="false" verbose="true">
143 <fileset dir="${outputJava}" includes="**/*"/>
144 </delete>
145
146 <echo>cleaned directory : ${outputJava} : done.</echo>
147
148 <mkdir dir="${sources.gen}/"/>
149 </target>
150
151
152
153
154 <target name="processDomain">
155 <ant target="filterSource">
156 <property name="source" value="${domain_source}" />
157 <property name="source_filtered" value="${domain_source_filtered}" />
158 </ant>
159 </target>
160
161
162
163
164 <target name="processSnap">
165 <property name="source" value="${snap_source}" />
166 <ant target="checkSource">
167 <property name="source_checked" value="${snap_source_checked}" />
168 </ant>
169
170 <property name="source_filtered" value="${snap_source_filtered}" />
171
172 <ant target="filterSource" />
173 <ant target="genXSD" />
174 <ant target="genXHTML" />
175
176 <ant target="run_filterSourceGen" />
177 <ant target="run_xml2jpa"/>
178 <ant target="compileOutput" />
179 <ant target="makeJavaDoc" />
180 </target>
181
182
183
184
185 <target name="run_filterSourceGen">
186 <ant target="filterSourceGen">
187 <property name="source" value="${snap_source_filtered}" />
188 <property name="source_filtered" value="${snap_source_filtered_preGen}" />
189 </ant>
190 </target>
191
192
193
194
195 <target name="run_xml2jpa" depends="run_filterSourceGen">
196 <echo>run_xml2jpa : starting filter on file ${output}/${source}</echo>
197
198 <xslt2 force="true" reloadstylesheet="true"
199 in="${output}/${snap_source_filtered_preGen}"
200 out="${sources.gen}/javagen.log"
201 style="${res}/xml2java.xsl">
202 <param name="root_package" expression="${root_package}"/>
203 <param name="model_package" expression="${model_package}"/>
204 </xslt2>
205
206 <echo>run_xml2jpa : done.</echo>
207 </target>
208
209
210
211
212
213 <!-- generic targets -->
214
215 <!-- target checkSource : check xmi well formed tags in source document -->
216 <target name="checkSource" description="check that xmi is well formed">
217 <echo>checkSource : starting checks on file ${input}/${source}</echo>
218
219 <xslt2 force="true" reloadstylesheet="true"
220 in="${input}/${source}" out="${output}/${source_checked}"
221 style="${res}/xmiCheck.xsl" />
222
223 <echo>checkSource : done.</echo>
224 </target>
225
226
227
228 <!-- target filterSource : remove all xmi:Extension tags in source document -->
229 <target name="filterSource" description="remove all xmi:Extension tags in source document">
230 <echo>filterSource : starting filter on file ${input}/${source}</echo>
231
232 <xslt2 force="true" reloadstylesheet="true"
233 in="${input}/${source}" out="${output}/${source_filtered}"
234 style="${res}/xmiFilter.xsl" />
235
236 <echo>filterSource : done.</echo>
237 </target>
238
239
240
241
242
243
244 <!-- target filterSourceGen : GenTool preprocessor generating accordint to ivoaDMMetamodel.xsd -->
245 <target name="filterSourceGen" description="remove more tags in source document">
246 <echo>filterSourceGen : starting filter on file ${output}/${source}</echo>
247
248 <xslt2 force="true" reloadstylesheet="true"
249 in="${output}/${source}" out="${output}/${source_filtered}"
250 style="${res}/xmiPreProcessTool.xsl" >
251 <param name="root_package" expression="${root_package}"/>
252 <param name="model_package" expression="${model_package}"/>
253 </xslt2>
254
255 <echo>filterSourceGen : done.</echo>
256 </target>
257
258
259
260
261 <!-- target genXSD : generates XML schemas from UML Model as xmi document -->
262 <target name="genXSD" description="generates XML schemas from UML Model as xmi document">
263 <echo>genXSD : starting generate XSD from file ${output}/${source_filtered}</echo>
264
265 <xslt2 force="true" reloadstylesheet="true"
266 in="${output}/${source_filtered}" out="${output}/${out_schema}"
267 style="${res}/xmi2xsd.xsl" />
268
269 <echo>genXSD : done.</echo>
270 </target>
271
272
273
274
275 <!-- target genXHTML : generates XHTML documentation the XSD file created by genXSD -->
276 <target name="genXHTML" description="generates XHTML documentation the XSD file created by genXSD">
277 <echo>genXTHML : starting generate XHTML docs from file ${output}/${out_schema}</echo>
278
279 <xslt2 force="true" reloadstylesheet="true"
280 in="${output}/${out_schema}" out="${output}/${out_xhtml}"
281 style="${res}/schema2xhtml.xsl" />
282
283 <echo>genXHTML : done.</echo>
284 </target>
285
286
287 <!-- include java code targets -->
288
289 &buildJava;
290
291 </project>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26