This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
219 lines (183 loc) · 10.8 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<project name="xrechnung-validation-configuration" default="dist" basedir=".">
<description>Build XGewerbeanzeige validator configuration</description>
<!-- set global properties for this build -->
<!-- main build directories -->
<property name="src.dir" location="${basedir}/src"/>
<property name="lib.dir" location="${basedir}/lib"/>
<property name="build.dir" location="${basedir}/build"/>
<property name="download.dir" location="${build.dir}/download"/>
<property name="dist.dir" location="${basedir}/dist"/>
<property name="test.src.dir" location="${src.dir}/test"/>
<property name="test.build.dir" location="${build.dir}/test"/>
<!-- Naming -->
<property name="dist.name" value="xgewerbeanzeige-validator-configuration"/>
<property name="validationtool.jar" value="validationtool-1.0.1-standalone.jar"/>
<property name="saxon.jar" value="saxon9he.jar"/>
<property name="xga-2.2.dir" location="${svn.base.dir}/spezifikation/trunk"/>
<property name="xga-2.1.dir" location="${svn.base.dir}/spezifikation/branches/Release-2.1"/>
<property name="xga-2.0.dir" location="${svn.base.dir}/spezifikation/branches/Release-2.0"/>
<property name="xgewerbeanzeige-1.3.download.url.prefix" value="http://xgewerbeanzeige.de/wp-content/uploads/2018/05/"/>
<property name="xgewerbeanzeige-1.3.zip" value="xgewerbeanzeige-v-1-3_2018-03-19.zip"/>
<!-- root/work directory where KoSIT validationtool expects Schema(s)-and trons -->
<property name="repository.dir" location="${build.dir}"/>
<property name="resource.dir" location="${repository.dir}/resources"/>
<property name="schematron.url" value="https://github.com/Schematron/schematron/releases/download/2017-02-09/iso-schematron-xslt2.zip"/>
<!-- Resource directories -->
<property name="reports.schema.dir" location="${resource.dir}/xsd"/>
<property name="test.docs.dir" location="${test.src.dir}/instances"/>
<property name="reports.dir" location="${basedir}/reports"/>
<target name="init" description="Initializes build directory structure and ISO timestamp">
<!-- Create timestamps -->
<tstamp>
<format property="build.date" pattern="yyyy-MM-dd"/>
</tstamp>
<echo>Build date: ${build.date}</echo>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${download.dir}"/>
<mkdir dir="${lib.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="prepare-saxon" depends="init" description="Download Saxon-HE and add jar to library directory">
<get src="https://sourceforge.net/projects/saxon/files/Saxon-HE/9.8/SaxonHE9-8-0-8J.zip/download" dest="${download.dir}/SaxonHE9-8-0-8J.zip" skipexisting="true" usetimestamp="true"/>
<unzip src="${download.dir}/SaxonHE9-8-0-8J.zip" dest="${lib.dir}">
<patternset>
<include name="**/${saxon.jar}"/>
</patternset>
<flattenmapper/>
</unzip>
</target>
<target name="prepare-validationtool" depends="init" description="Download KoSIT validation tool and add jar to library directory">
<get src="https://github.com/itplr-kosit/validator/releases/download/validationtool-1_0_1/validationtool-dist-1.0.1-standalone.zip" dest="${download.dir}" skipexisting="true" usetimestamp="true"/>
<unzip src="${download.dir}/validationtool-dist-1.0.1-standalone.zip" dest="${lib.dir}">
<patternset>
<include name="**/${validationtool.jar}"/>
</patternset>
<flattenmapper/>
</unzip>
</target>
<target name="prepare-schematron" depends="init">
<mkdir dir="${download.dir}/schematron"/>
<get src="${schematron.url}" dest="${download.dir}/schematron.zip" skipexisting="true" usetimestamp="true"/>
<unzip src="${download.dir}/schematron.zip" dest="${download.dir}/schematron/"/>
</target>
<target name="retrieve-xstatistik-xmlschema" depends="init">
<mkdir dir="${download.dir}/xstatistik-2.1.0"/>
<get src="https://www.xrepository.de/Datei/urn:uuid:62f98658-a87a-413e-9dc8-dbee4826ed73.xsd" dest="${download.dir}/xstatistik-2.1.0/xstatistik-nachrichten.xsd" skipexisting="true" usetimestamp="true"/>
<get src="https://www.xrepository.de/Datei/urn:uuid:16b2a9f1-a292-4cbe-bb64-f686601fc3a2.xsd" dest="${download.dir}/xstatistik-2.1.0/xstatistik-baukasten.xsd" skipexisting="true" usetimestamp="true"/>
<get src="https://www.xrepository.de/Datei/urn:uuid:ea74b966-f52f-4ce3-9c29-a4ebf83d0b41.xsd" dest="${download.dir}/xstatistik-2.1.0/xoev-basisdatentypen.xsd" skipexisting="true" usetimestamp="true"/>
<get src="https://www.xrepository.de/Datei/urn:uuid:cd95d6bc-1919-4bfb-91d3-e487a868d928.xsd" dest="${download.dir}/xstatistik-2.1.0/xstatistik-basistypen.xsd" skipexisting="true" usetimestamp="true"/>
</target>
<target name="retrieve-xgewerbeanzeige" depends="init">
<mkdir dir="${download.dir}/xgewerbeanzeige-1.3"/>
<mkdir dir="${download.dir}/xgewerbeanzeige-2.0"/>
<mkdir dir="${download.dir}/xgewerbeanzeige-2.1"/>
<mkdir dir="${download.dir}/xgewerbeanzeige-2.2"/>
<get src="${xgewerbeanzeige-1.3.download.url.prefix}${xgewerbeanzeige-1.3.zip}" dest="${download.dir}" skipexisting="true" usetimestamp="true"/>
<unzip src="${download.dir}/${xgewerbeanzeige-1.3.zip}" dest="${download.dir}/xgewerbeanzeige-1.3">
<patternset>
<include name="**/*.sch"/>
</patternset>
</unzip>
<copy todir="${download.dir}/xgewerbeanzeige-2.0">
<fileset dir="${xga-2.0.dir}/build/xsd">
<include name="*.xsd"/>
</fileset>
<fileset dir="${xga-2.0.dir}/build/sch">
<include name="*.sch"/>
</fileset>
</copy>
<copy todir="${download.dir}/xgewerbeanzeige-2.1">
<fileset dir="${xga-2.1.dir}/build/xsd">
<include name="*.xsd"/>
</fileset>
<fileset dir="${xga-2.1.dir}/build/sch">
<include name="*.sch"/>
</fileset>
</copy>
<copy todir="${download.dir}/xgewerbeanzeige-2.2">
<fileset dir="${xga-2.2.dir}/build/xsd">
<include name="*.xsd"/>
</fileset>
<fileset dir="${xga-2.2.dir}/build/sch">
<include name="*.sch"/>
</fileset>
</copy>
</target>
<target name="compile-scenario" depends="init">
<filter token="build.date" value="${build.date}"/>
<copy file="${src.dir}/scenarios.xml" todir="${repository.dir}" failonerror="true" filtering="true"/>
</target>
<target name="compile" depends="compile-scenario,retrieve-xstatistik-xmlschema,retrieve-xgewerbeanzeige,prepare-validationtool,prepare-saxon,prepare-schematron">
<echo>Compiling Schemas and XSLTs ...</echo>
<copy file="${src.dir}/default-report.xsl" todir="${resource.dir}"/>
<!-- Following unzip also creates ${resource.dir}/xsd directory-->
<unzip src="${lib.dir}/${validationtool.jar}" dest="${build.dir}">
<patternset>
<include name="xsd/scenarios.xsd"/>
</patternset>
</unzip>
<copy file="${src.dir}/report.xsd" todir="${build.dir}/xsd"/>
<copy todir="${resource.dir}/xgewerbeanzeige-1.3">
<fileset dir="${download.dir}/xstatistik-2.1.0">
<include name="*.xsd"/>
</fileset>
</copy>
<copy todir="${resource.dir}/xgewerbeanzeige-2.0">
<fileset dir="${download.dir}/xgewerbeanzeige-2.0">
<include name="*.xsd"/>
<include name="*.sch"/>
</fileset>
</copy>
<copy todir="${resource.dir}/xgewerbeanzeige-2.1">
<fileset dir="${download.dir}/xgewerbeanzeige-2.1">
<include name="*.xsd"/>
<include name="*.sch"/>
</fileset>
</copy>
<copy todir="${resource.dir}/xgewerbeanzeige-2.2">
<fileset dir="${download.dir}/xgewerbeanzeige-2.2">
<include name="*.xsd"/>
<include name="*.sch"/>
</fileset>
</copy>
<xslt in="${download.dir}/xgewerbeanzeige-1.3/00041840059999000001.sch" out="${resource.dir}/xgewerbeanzeige-1.3/00041840059999000001.xsl" style="${download.dir}/schematron/iso_svrl_for_xslt2.xsl">
<classpath location="${lib.dir}/${saxon.jar}"/>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="generate-fired-rule" expression="false"/>
<param name="full-path-notation" expression="3"/>
</xslt>
<xslt in="${download.dir}/xgewerbeanzeige-2.0/spezifikation.sch" out="${resource.dir}/xgewerbeanzeige-2.0/spezifikation.xsl" style="${download.dir}/schematron/iso_svrl_for_xslt2.xsl">
<classpath location="${lib.dir}/${saxon.jar}"/>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="generate-fired-rule" expression="false"/>
<param name="full-path-notation" expression="3"/>
</xslt>
<xslt in="${download.dir}/xgewerbeanzeige-2.1/spezifikation.sch" out="${resource.dir}/xgewerbeanzeige-2.1/spezifikation.xsl" style="${download.dir}/schematron/iso_svrl_for_xslt2.xsl">
<classpath location="${lib.dir}/${saxon.jar}"/>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="generate-fired-rule" expression="false"/>
<param name="full-path-notation" expression="3"/>
</xslt>
<xslt in="${download.dir}/xgewerbeanzeige-2.2/spezifikation.sch" out="${resource.dir}/xgewerbeanzeige-2.2/spezifikation.xsl" style="${download.dir}/schematron/iso_svrl_for_xslt2.xsl">
<classpath location="${lib.dir}/${saxon.jar}"/>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="generate-fired-rule" expression="false"/>
<param name="full-path-notation" expression="3"/>
</xslt>
<copy todir="${build.dir}/beispiele">
<fileset dir="beispiele">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="dist" depends="compile" description="Generate the distribution">
<zip destfile="${dist.dir}/validator-configuration-xgewerbeanzeige_${build.date}.zip" basedir="${build.dir}" excludes="download/**,test"/>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}" verbose="true" includeEmptyDirs="true"/>
<delete dir="${dist.dir}"/>
<delete dir="${reports.dir}"/>
</target>
</project>