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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 126 - (show annotations)
Mon Mar 31 19:41:40 2008 UTC (12 years, 7 months ago) by gerard.lemson
File MIME type: text/xml
File size: 8058 byte(s)
Clean up after Laurent and I decided to concentrate on the pure XSLT way of generating code. This does require Saxon to be able to use the xsl:result-document syntax to output multiple files.
1 <?xml version="1.0" ?>
2 <!DOCTYPE project [
3 <!ENTITY xsltOptions '
4 <factory name="net.sf.saxon.TransformerFactoryImpl" />
5 <outputproperty name="{http://xml.apache.org/xslt}indent-amount" value="2" />
6 '>
7 <!ENTITY buildJava SYSTEM "./build_java.xml">
8 ]>
9
10 <project name="Snap DM Transformer" default="makeAll" basedir=".">
11
12 <description>
13 Transformer tool for SNAP DM (UML model) in XML schemas and documentation
14 </description>
15
16 <!-- set global properties for this build -->
17
18 <!-- input files -->
19 <property name="domain_source" value="DomainModelWithTemplate.xml" />
20 <property name="snap_source" value="SNAP_Simulation_DM_LBO_1.xml" />
21
22 <!-- output files -->
23 <property name="domain_source_filtered" value="DomainModelWithTemplate_FILTER.xml" />
24 <property name="snap_source_checked" value="SNAP_Simulation_DM_CHECK.xml" />
25 <property name="snap_source_filtered" value="SNAP_Simulation_DM_FILTER.xml" />
26 <property name="snap_source_filtered_preGen" value="SNAP_Simulation_DM_FOR_GEN.xml" />
27 <property name="snap_source_filtered_preGen_schema" value="SNAP_Simulation_DM_FOR_GEN_SCHEMA.xml" />
28 <property name="out_schema" value="SNAP-xmi.xsd" />
29 <property name="out_xhtml" value="SNAP-xsd.html" />
30
31 <!-- paths -->
32 <property name="input" location="./input" />
33 <property name="output" location="./output" />
34 <property name="res" location="./res" />
35
36 <property name="outputJava" location="${output}/java" />
37
38
39 <!-- java props -->
40 <property name="root" location="."/>
41
42 <property name="sources" location="./src"/>
43 <property name="sources.gen" location="${outputJava}/src"/>
44 <property name="sources.gen.alt" location="${outputJava}/src_alt"/>
45
46 <property name="libs" location="./libs"/>
47
48 <property name="root_package" value="org.ivoa"/>
49 <property name="model_package" value="org.ivoa.dm.model"/>
50
51 <!-- compile Sources -->
52 <property name="build" location="./build"/>
53 <property name="build.src" location="${build}/src"/>
54
55 <property name="build.gen" location="${build}/gen"/>
56
57 <!-- classpath -->
58 <path id="project.class.path">
59 <pathelement location="${libs}/commons-logging-1.1.jar"/>
60 <pathelement location="${libs}/log4j-1.2.15.jar"/>
61 </path>
62
63 <!-- Get properties -->
64 <property file="build.properties"/>
65 <fail unless="build.by" message="bad configuration in build.properties !" />
66
67
68 <!-- targets -->
69
70 <target name="makeAll" depends="cleanAll, processDomain, processSnap" description="make all transformations">
71
72 <echo>makeAll : done</echo>
73
74 </target>
75
76
77
78 <target name="processDomain">
79 <ant target="filterSource">
80 <property name="source" value="${domain_source}" />
81 <property name="source_filtered" value="${domain_source_filtered}" />
82 </ant>
83 </target>
84
85
86
87
88 <target name="processSnap">
89
90 <property name="source" value="${snap_source}" />
91 <ant target="checkSource">
92 <property name="source_checked" value="${snap_source_checked}" />
93 </ant>
94
95 <property name="source_filtered" value="${snap_source_filtered}" />
96
97 <ant target="filterSource" />
98 <ant target="genXSD" />
99 <ant target="genXHTML" />
100
101 <ant target="filterSourceGen">
102 <property name="source" value="${snap_source_filtered}" />
103 <property name="source_filtered" value="${snap_source_filtered_preGen}" />
104 </ant>
105
106 </target>
107
108
109 <target name="run_filterSourceGen_schema">
110 <ant target="filterSourceGen_schema">
111 <property name="source" value="${snap_source_filtered}" />
112 <property name="source_filtered" value="${snap_source_filtered_preGen_schema}" />
113 </ant>
114 </target>
115
116 <target name="run_xml2jpa" depends="clean">
117 <echo>run_xml2jpa : starting filter on file ${output}/${source}</echo>
118
119 <ant target="filterSourceGen_schema">
120 <property name="source" value="${snap_source_filtered}" />
121 <property name="source_filtered" value="${snap_source_filtered_preGen_schema}" />
122 </ant>
123
124 <xslt force="true" reloadstylesheet="true"
125 in="${output}/${snap_source_filtered_preGen_schema}"
126 out="${sources.gen.alt}/javagen.log"
127 style="${res}/xml2jpa_schema.xsl" >
128 &xsltOptions;
129 <param name="root_package" expression="${root_package}"/>
130 <param name="model_package" expression="${model_package}"/>
131 </xslt>
132
133 <echo>run_xml2jpa : done </echo>
134 </target>
135
136 <!-- generic targets -->
137
138 <!-- target checkSource : check xmi well formed tags in source document -->
139 <target name="checkSource" description="check that xmi is well formed">
140
141 <echo>checkSource : starting checks on file ${input}/${source}</echo>
142
143 <xslt force="true" reloadstylesheet="true"
144 in="${input}/${source}" out="${output}/${source_checked}"
145 style="${res}/xmiCheck.xsl">
146 &xsltOptions;
147 </xslt>
148
149 <echo>checkSource : done </echo>
150
151 </target>
152
153
154
155 <!-- target filterSource : remove all xmi:Extension tags in source document -->
156 <target name="filterSource" description="remove all xmi:Extension tags in source document">
157
158 <echo>filterSource : starting filter on file ${input}/${source}</echo>
159
160 <xslt force="true" reloadstylesheet="true"
161 in="${input}/${source}" out="${output}/${source_filtered}"
162 style="${res}/xmiFilter.xsl">
163 &xsltOptions;
164 </xslt>
165
166 <echo>filterSource : done </echo>
167
168 </target>
169
170
171
172
173 <!-- target filterSourceGen : GenTool preprocessor -->
174 <target name="filterSourceGen" description="remove more tags in source document">
175
176 <echo>filterSourceGen : starting filter on file ${output}/${source}</echo>
177
178 <xslt force="true" reloadstylesheet="true"
179 in="${output}/${source}" out="${output}/${source_filtered}"
180 style="${res}/xmiPreProcessTool.xsl" >
181 &xsltOptions;
182 </xslt>
183
184 <echo>filterSourceGen : done </echo>
185
186 </target>
187
188 <!-- target filterSourceGen_schema : GenTool preprocessor generating accordint to ivoaDMMetamodel.xsd -->
189 <target name="filterSourceGen_schema" description="remove more tags in source document">
190
191 <echo>filterSourceGen_schema : starting filter on file ${output}/${source}</echo>
192
193 <xslt force="true" reloadstylesheet="true"
194 in="${output}/${source}" out="${output}/${source_filtered}"
195 style="${res}/xmiPreProcessTool_schema.xsl" >
196 &xsltOptions;
197 <param name="root_package" expression="${root_package}"/>
198 <param name="model_package" expression="${model_package}"/>
199 </xslt>
200
201 <echo>filterSourceGen_schema : done </echo>
202
203 </target>
204
205
206 <!-- target genXSD : generates XML schemas from UML Model as xmi document -->
207 <target name="genXSD" description="generates XML schemas from UML Model as xmi document">
208
209 <echo>genXSD : starting generate XSD from file ${output}/${source_filtered}</echo>
210
211 <xslt force="true" reloadstylesheet="true"
212 in="${output}/${source_filtered}" out="${output}/${out_schema}"
213 style="${res}/xmi2xsd.xsl">
214 &xsltOptions;
215 </xslt>
216
217 <echo>genXSD : done </echo>
218
219 </target>
220
221
222 <!-- target genXHTML : generates XHTML documentation the XSD file created by genXSD -->
223 <target name="genXHTML" description="generates XHTML documentation the XSD file created by genXSD">
224
225 <echo>genXTHML : starting generate XHTML docs from file ${output}/${out_schema}</echo>
226
227 <xslt force="true" reloadstylesheet="true"
228 in="${output}/${out_schema}" out="${output}/${out_xhtml}"
229 style="${res}/schema2xhtml.xsl">
230 &xsltOptions;
231 </xslt>
232
233 <echo>genXHTML : done </echo>
234
235 </target>
236
237
238 <!-- include java code targets -->
239
240 &buildJava;
241
242
243 </project>

Properties

Name Value
svn:executable *

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