forked from Freischuetz-Digital/Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
187 lines (143 loc) · 8.92 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="help" name="processMovs">
<scriptdef name="substring-before" language="javascript">
<attribute name="text" />
<attribute name="delimiter" />
<attribute name="property" />
<![CDATA[
var text = attributes.get("text");
project.setProperty(attributes.get("property"), text.slice(0, text.indexOf(attributes.get("delimiter"))));
]]>
</scriptdef>
<target name="help">
<echo>USAGE:</echo>
<echo>ant musicXMLPartToTime -Dfreidi.in=INPUT_MUSICXML -Dfreidi.out=OUTPUT_MUSICXML</echo>
<echo>ant musicXMLToMEI -Dfreidi.in=INPUT_MUSICXML -Dfreidi.out=OUTPUT_MEI</echo>
<echo>ant improveMusic -Dfreidi.in=INPUT_MEI -Dfreidi.out=OUTPUT_MEI -Dfreidi.mov.id=MOV_ID</echo>
<echo>ant includeMusicInCore -Dfreidi.in=INPUT_MEI -Dfreidi.core=CORE_MEI -Dfreidi.core.tmp=TMP_CORE_MEI -Dfreidi.blueprint=BLUEPRINT_MEI -Dfreidi.mov.id=MOV_ID</echo>
<echo>ant includeMusicInSources -Dfreidi.blueprint=BLUEPRINT_MEI -Dfreidi.source.dir=SOURCES_DIR -Dfreidi.mov.id=MOV_ID</echo>
<echo>ant mergeCoreAndSources -Dfreidi.core=CORE_MEI -Dfreidi.source.dir=SOURCES_DIR -Dfreidi.dest.dir=DEST_DIR</echo>
<echo>ant splitInPages -Dfreidi.in=INPUT_MEI -Dfreidi.dest.dir=DEST_DIR -Dfreidi.mov.id=MOV_ID</echo>
<echo>ant generateXarPackage -Dfreidi.src.dir=SRC_DIR -Dfreidi.out=OUTPUT-XAR -Dfreidi.source.mov=SOURCE_MOV -Dfreidi.exist.col=EXIST_COL</echo>
</target>
<target name="musicXMLPartToTime">
<available file="${freidi.in}" property="freidi.in.exists"/>
<fail unless="freidi.in" message="Parameter freidi.in is missing"/>
<fail unless="freidi.out" message="Parameter freidi.out is missing"/>
<fail message="File ${freidi.in} does not exist, is empty or not readable" unless="freidi.in.exists"/>
<xslt in="${freidi.in}"
out="${freidi.out}"
force="true"
style="02 MusicXML partwise to timewise/MusicXML_parttime.xsl"/>
</target>
<target name="musicXMLToMEI">
<available file="${freidi.in}" property="freidi.in.exists"/>
<fail unless="freidi.in" message="Parameter freidi.in is missing"/>
<fail unless="freidi.out" message="Parameter freidi.out is missing"/>
<fail message="File ${freidi.in} does not exist, is empty or not readable" unless="freidi.in.exists"/>
<xslt in="${freidi.in}"
out="${freidi.out}"
force="true"
style="03 MusicXML to MEI/musicxml2mei-3.0.xsl"/>
</target>
<target name="improveMusic">
<available file="${freidi.in}" property="freidi.in.exists"/>
<fail unless="freidi.in" message="Parameter freidi.in is missing"/>
<fail unless="freidi.out" message="Parameter freidi.out is missing"/>
<fail unless="freidi.mov.id" message="Parameter freidi.mov.id is missing"/>
<fail message="File ${freidi.in} does not exist, is empty or not readable" unless="freidi.in.exists"/>
<xslt in="${freidi.in}"
out="${freidi.out}"
force="true"
style="04 MEI cleaning/improveMusic.xsl">
<param name="movID" expression="${freidi.mov.id}"/>
</xslt>
</target>
<target name="includeMusicInCore">
<available file="${freidi.in}" property="freidi.in.exists"/>
<available file="${freidi.core}" property="freidi.core.exists"/>
<fail unless="freidi.in" message="Parameter freidi.in is missing"/>
<fail unless="freidi.core" message="Parameter freidi.core is missing"/>
<fail unless="freidi.blueprint" message="Parameter freidi.blueprint is missing"/>
<fail unless="freidi.mov.id" message="Parameter freidi.mov.id is missing"/>
<fail message="File ${freidi.in} does not exist, is empty or not readable" unless="freidi.in.exists"/>
<fail message="File ${freidi.core} does not exist, is empty or not readable" unless="freidi.core.exists"/>
<xslt in="${freidi.core}"
out="${freidi.core.tmp}"
force="true"
style="06.1 Include Music in Core/includeMusic2core.xsl">
<param name="musicDoc" expression="${freidi.in}"/>
<param name="targetMov" expression="${freidi.mov.id}"/>
<param name="bluePrintfile" expression="${freidi.blueprint}"/>
</xslt>
</target>
<target name="includeMusicInSources">
<available file="${freidi.source.dir}" property="freidi.source.dir.exists"/>
<available file="${freidi.blueprint}" property="freidi.blueprint.exists"/>
<fail unless="freidi.blueprint" message="Parameter freidi.blueprint is missing"/>
<fail unless="freidi.source.dir" message="Parameter freidi.source.dir is missing"/>
<fail unless="freidi.mov.id" message="Parameter freidi.mov.id is missing"/>
<fail message="File ${freidi.source.dir} does not exist" unless="freidi.source.dir.exists"/>
<fail message="File ${freidi.blueprint} does not exist, is empty or not readable" unless="freidi.blueprint.exists"/>
<xslt basedir="${freidi.source.dir}" destdir="${freidi.source.dir}_" extension=".xml" includes="**/*.xml"
force="true"
style="06.2 Include Music in Sources/includeMusic2source.xsl">
<param name="path" expression="${freidi.blueprint}"/>
<param name="movNo" expression="${freidi.mov.id}"/>
</xslt>
</target>
<target name="mergeCoreAndSources">
<available file="${freidi.source.dir}" property="freidi.source.dir.exists"/>
<available file="${freidi.core}" property="freidi.core.exists"/>
<fail unless="freidi.core" message="Parameter freidi.core is missing"/>
<fail unless="freidi.source.dir" message="Parameter freidi.source.dir is missing"/>
<fail unless="freidi.dest.dir" message="Parameter freidi.dest.dir is missing"/>
<fail message="File ${freidi.source.dir} does not exist" unless="freidi.source.dir.exists"/>
<fail message="File ${freidi.core} does not exist, is empty or not readable" unless="freidi.core.exists"/>
<xslt basedir="${freidi.source.dir}" destdir="${freidi.dest.dir}" extension=".xml" includes="**/*.xml"
force="true"
style="07 Merge Core and Sources/mergeCoreSource.xsl">
<param name="corePath" expression="${freidi.core}"/>
</xslt>
</target>
<target name="splitInPages">
<available file="${freidi.in}" property="freidi.in.exists"/>
<fail unless="freidi.in" message="Parameter freidi.in is missing"/>
<fail unless="freidi.dest.dir" message="Parameter freidi.dest.dir is missing"/>
<fail unless="freidi.mov.id" message="Parameter freidi.mov.id is missing"/>
<fail message="File ${freidi.in} does not exist, is empty or not readable" unless="freidi.in.exists"/>
<xslt in="${freidi.in}" out="${java.io.tmpdir}/splitInPages.xml"
force="true"
style="08 Split in pages/generateSystemFiles.xsl">
<param name="movement" expression="${freidi.mov.id}"/>
<param name="destdir" expression="${freidi.dest.dir}"/>
</xslt>
</target>
<target name="generateXarPackage">
<fail unless="freidi.src.dir" message="Parameter freidi.src.dir is missing"/>
<fail unless="freidi.source.mov" message="Parameter freidi.source.mov is missing"/>
<xmlproperty file="properties.xml" keeproot="false" collapseattributes="true" />
<substring-before text="${freidi.source.mov}" delimiter="_" property="freidi.source" />
<property name="freidi.exist.col" value="pitchtool-data/${freidi.source}/${freidi.source.mov}"/>
<property name="freidi.out" value="build-dir/FreiDi_PMD-pitchtool-${freidi.source.mov}-${FreiDi-Tools_version}.xar"/>
<property name="temp.dir" value="temp"/>
<mkdir dir="${temp.dir}"/>
<copy todir="${temp.dir}">
<fileset dir="${freidi.src.dir}"/>
</copy>
<copy todir="${temp.dir}">
<fileset dir="08 Split in pages">
<include name="**/*.xml"/>
<include name="**/*.xql"/>
</fileset>
<filterset>
<filter token="SOURCE_MOV" value="${freidi.source.mov}"/>
<filter token="TARGET_PATH" value="${freidi.exist.col}"/>
<filter token="OPERATOR" value="${transformationOperator}"/>
<filter token="VERSION" value="${FreiDi-Tools_version}"/>
</filterset>
</copy>
<zip basedir="${temp.dir}" destfile="${freidi.out}"/>
<delete dir="${temp.dir}"/>
</target>
</project>