-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-engine.xml
136 lines (116 loc) · 6.43 KB
/
build-engine.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="IATI Data Validator">
<description>
IATI Data Validator
</description>
<property name="filemask" value=""/>
<property name="datasets" value="iati-datasets"/>
<!-- Use config/build.xml to add artifacts to extension points -->
<import file="/work/space/config/iati-data-validator.xml" optional="yes"/>
<!-- Include additional development targets if available -->
<import file="helpers/build.xml" optional="yes"/>
<target name="init" description="Set up workspace directories.">
<mkdir dir="/work/space/input"/>
<mkdir dir="/work/space/src"/>
<mkdir dir="/work/space/dest"/>
<mkdir dir="/work/space/json"/>
<mkdir dir="/work/space/svrl"/>
<mkdir dir="/work/space/tmp"/>
<mkdir dir="/work/space/reports"/>
</target>
<target name="clean" depends="init" description="Clean intermediary results and feedback files.">
<delete>
<fileset dir="/work/space/tmp" includes="**/${filemask}*"/>
<fileset dir="/work/space/dest" includes="${filemask}*.xml"/>
</delete>
<echo level="info">Intermediate results have been deleted from dest and tmp directories.</echo>
</target>
<target name="xml-check" description="Verify that the files in input/ are IATI XML files." depends="init">
<echo level="info">Verify that the files in input/ are IATI XML files.</echo>
<exec executable="./xml-check">
<arg value="input"/>
<arg value="src"/>
<arg value="${filemask}"/>
<arg value="${datasets}"/>
</exec>
<xslt basedir="/work/space/tmp/feedback/" includes="**/${filemask}*" destdir="/work/space/dest" extension=".feedback.xml" style="data-quality/feedback-notxml.xslt" failOnError="false" filenameparameter="filename"/>
</target>
<target name="rules" description="Check the files source data against IATI rules." depends="init">
<echo level="info">Check the data files in src/ against the ruleset.</echo>
<xslt basedir="/work/space/src/" includes="**/${filemask}*" destdir="/work/space/dest" extension=".feedback.xml" style="data-quality/rules/iati.xslt" failOnError="false" filenameparameter="filename"/>
</target>
<target name="report" description="Generate a data quality feedback HTML page." depends="init, html-skeleton, rules">
<echo level="info">Generate data quality feedback report in the report/ folder.</echo>
<xslt basedir="/work/space/dest/" includes="**/*.feedback.xml" destdir="/work/space/reports" style="helpers/feedback.xslt" failOnError="false">
<globmapper from="*.feedback.xml" to="*.feedback.html"/>
</xslt>
</target>
<target name="json" description="Generate JSON output from feedback.">
<echo level="info">Generate JSON feedback files in json/.</echo>
<xslt basedir="/work/space/dest/" includes="**/${filemask}*.feedback.xml" destdir="/work/space/json" style="helpers/feedback-json.xslt" failOnError="false">
<globmapper from="*.feedback.xml" to="*.json"/>
</xslt>
</target>
<target name="svrl" description="Generate SVRL reports from feedback.">
<echo level="info">Generate data quality SVRL reports in svrl/.</echo>
<xslt basedir="/work/space/dest/" includes="**/${filemask}*.feedback.xml" destdir="/work/space/svrl" style="helpers/feedback-svrl.xslt" failOnError="false">
<globmapper from="*.feedback.xml" to="*.svrl"/>
</xslt>
</target>
<target name="feedback" description="Do the XML checks and validate the rules." depends="xml-check, rules"/>
<target name="redo-feedback" description="Redo all steps for the feedback." depends="clean, xml-check, rules"/>
<target name="full-feedback" description="(same as 'feedback')" depends="xml-check, rules"/>
<target name="full-svrl" description="Do the XML checks, validate the rules, create svrl." depends="xml-check, rules, svrl"/>
<target name="full-json" description="Do the XML checks, validate the rules, create json." depends="xml-check, rules, json"/>
<target name="data-quality-rules-spreadsheet" description="Generate overview of the data quality rules as a spreadsheet." depends="init">
<echo level="info">Generate overview of the data quality rules as a spreadsheet.</echo>
<delete file="/work/space/reports/data-quality-rules.fods"/>
<xslt in="data-quality/meta.xml" out="/work/space/reports/data-quality-rules.fods" style="helpers/data-quality-rules-spreadsheet.xslt">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/suppressXsltNamespaceCheck" value="true"/>
</factory>
</xslt>
</target>
<target name="data-quality-rules-csv" description="Generate overview of the data quality rules as a CSV file." depends="init">
<echo level="info">Generate overview of the data quality rules as a CSV file.</echo>
<delete file="/work/space/reports/data-quality-rules.csv"/>
<xslt in="data-quality/meta.xml" out="/work/space/reports/data-quality-rules.csv" style="helpers/data-quality-rules-csv.xslt">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/suppressXsltNamespaceCheck" value="true"/>
</factory>
</xslt>
</target>
<target name="html-skeleton" depends="init">
<copy todir="/work/space/reports">
<fileset dir="share/html"/>
</copy>
</target>
<target name="run_testsuites" depends="xml-check, rules, test-context, test-json, test-validator"/>
<target name="test" description="Run test suites">
<symlink action="delete" link="/work/space"/>
<copy todir="/work/space">
<fileset dir="/home/testspace"/>
</copy>
<antcall target="run_testsuites"/>
</target>
<target name="tests" description="Run all tests (don't stop at failure)">
<antcall target="test">
<param name="xspec.fail" value="false"/>
</antcall>
</target>
<target name="test-context" description="Run the context-generation tests for messages">
<antcall target="xspec.xspec" inheritall="false">
<param name="xspec.xml" location="tests/context.xspec"/>
</antcall>
</target>
<target name="test-json" description="Run the JSON feedback tests">
<antcall target="xspec.xspec" inheritall="false">
<param name="xspec.xml" location="tests/json-feedback.xspec"/>
</antcall>
</target>
<target name="test-validator" description="Run the Validator tests">
<antcall target="xspec.xspec" inheritall="false">
<param name="xspec.xml" location="tests/validator.xspec"/>
</antcall>
</target>
</project>