forked from IATI/IATI-Rulesets
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
71 lines (60 loc) · 3.17 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- IATI workbench: produce and use IATI data
Copyright (C) 2016-2022, drostan.org and data4development.org
Portions (C) 2019-2020, unops.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="IATI-Rules">
<include file="lib/xspec/build.xml"/>
<target name="update-codelist-rules" description="Update the codelist check rules based on the adapted IATI codelist mapping.">
<echo level="info">Update the codelist check rules based on the adapted IATI codelist mapping.</echo>
<xslt in="lib/schemata/mapping-rules.xml" out="rules/iati/codelists.xslt" style="helpers/generate-codelist-checks.xslt"/>
</target>
<!-- TODO This extension point and linked targets should be moved to a separate engine and data volume -->
<extension-point name="update-external-data"
description="Update local copies of external data to use in the validator."
depends="update-orgid-prefixes, update-known-publishers"/>
<!-- TODO get known publishers from Datastore or Registry -->
<target name="update-known-publishers">
<mkdir dir="tmp"/>
<get src="http://www.dataworkbench.io/api/iati-publishers" dest="tmp/iati-publishers.json"/>
<xslt out="var/known-publishers.xml"
in="helpers/known-publishers.xslt"
style="helpers/known-publishers.xslt"/>
</target>
<target name="update-orgid-prefixes" >
<mkdir dir="tmp"/>
<get src="http://org-id.guide/download.xml" dest="tmp/org-id.xml"/>
<xslt in="tmp/org-id.xml" out="var/known-orgid-prefixes.xml" style="helpers/known-orgid-prefixes.xslt"/>
</target>
<target name="test" description="Run the tests">
<xmlvalidate lenient="true">
<fileset dir="tests/iati/testfiles" includes="*.xml"/>
</xmlvalidate>
<antcall target="xspec.xspec" inheritall="false">
<param name="xspec.xml" location="tests/iati.xspec"/>
</antcall>
</target>
<target name="tests" description="Run all the tests (don't stop at first failure)">
<antcall target="test">
<param name="xspec.fail" value="false"/>
</antcall>
</target>
<target name="data-quality-rules-csv" description="Generate overview of the data quality rules as a CSV file.">
<echo level="info">Generate overview of the data quality rules as a CSV file.</echo>
<xslt in="rules/meta.xml" out="docs/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>
</project>