-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
89 lines (66 loc) · 2.75 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
<project name="imf-artifacts" default="default" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>Builds regxml schemas and dicts from registers</description>
<property name="dict.dir" value="dict"/>
<property name="schemas.dir" value="xsd/regxml"/>
<property name="lib.dir" value="lib"/>
<property name="register.dir" value="registers"/>
<property name="elements.register" value="${register.dir}/Elements.xml"/>
<property name="labels.register" value="${register.dir}/Labels.xml"/>
<property name="types.register" value="${register.dir}/Types.xml"/>
<property name="groups.register" value="${register.dir}/Groups.xml"/>
<path id="lib-classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- java version -->
<condition property="compile.config" value="java_8">
<equals arg1="${ant.java.version}" arg2="1.8"/>
</condition>
<condition property="compile.config" value="java_11">
<equals arg1="${ant.java.version}" arg2="11"/>
</condition>
<!-- Retrieve dependencies -->
<target name="deps" description="retrieve dependencies with ivy">
<ivy:retrieve type="jar" pattern="${lib.dir}/[artifact].[ext]" conf="${compile.config}"/>
</target>
<!-- Generate RegXML XML Schemas -->
<target name="build-regxml-schema" depends="build-regxml-dict,deps">
<fileset dir="${dict.dir}" id="dicts">
<include name="*.xml" />
</fileset>
<pathconvert property="dictpaths" refid="dicts" pathsep=" " />
<delete>
<fileset dir="${schemas.dir}" includes="*.xsd"/>
</delete>
<java classname="com.sandflow.smpte.tools.GenerateDictionaryXMLSchema">
<arg value="-d"/>
<arg line="${dictpaths}"/>
<arg value="-o"/>
<arg value="${schemas.dir}"/>
<classpath>
<path refid="lib-classpath"/>
</classpath>
</java>
</target>
<!--Generate RegXML dictionary-->
<target name="build-regxml-dict" depends="deps">
<delete>
<fileset dir="${dict.dir}" includes="*.xml"/>
</delete>
<java classname="com.sandflow.smpte.tools.XMLRegistersToDict">
<arg value="-e"/>
<arg value="${elements.register}"/>
<arg value="-l"/>
<arg value="${labels.register}"/>
<arg value="-g"/>
<arg value="${groups.register}"/>
<arg value="-t"/>
<arg value="${types.register}"/>
<arg value="${dict.dir}"/>
<classpath>
<path refid="lib-classpath"/>
</classpath>
</java>
</target>
</project>