forked from CoderLine/alphaTab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
160 lines (127 loc) · 5.23 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
<project name="alphaTab" default="haxe-js" basedir=".">
<description>
a buildfile for creating alphaTab releases
</description>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<!-- Main Properties -->
<property name="bin" location="bin"/>
<property name="lib" location="${bin}/lib/alphaTab"/>
<property name="src" location="src"/>
<property name="haxe-js" location="${lib}/alphaTab.js"/>
<property name="haxe-cpp" location="cpp"/>
<property name="release" location="releases"/>
<property name="tools" location="tools"/>
<!-- Java-Player Properties -->
<property name="player-base" location="subprojects/java-player"/>
<property name="player-src" location="${player-base}/src"/>
<property name="player-bin" location="${player-base}/bin"/>
<property name="player-jar" location="${lib}/alphaTab.jar"/>
<target name="global-init">
<tstamp/>
</target>
<!-- Java Player -->
<target name="java-player" depends="global-init">
<!-- Create Build Directory -->
<mkdir dir="${player-bin}" />
<!-- Compile Sources -->
<echo message="compiling midi player"/>
<javac srcdir="${player-src}" destdir="${player-bin}" classpath="C:/Program Files/Java/jre6/lib/plugin.jar" />
<!-- Package Jar -->
<echo message="create midi player jar"/>
<delete file="${player-jar}" />
<jar jarfile="${player-jar}" basedir="${player-bin}"/>
<!-- Remove Build Directory -->
<delete dir="${player-bin}" />
</target>
<!-- Haxe Builds -->
<target name="haxe-js" depends="global-init">
<delete file="${haxe-js}" />
<exec executable="haxe">
<arg value="-cp" />
<arg value="${src}"/>
<arg value="-main" />
<arg value="alphatab.Main" />
<arg value="-js" />
<arg value="${haxe-js}" />
</exec>
</target>
<target name="haxe-cpp" depends="global-init">
<delete file="${haxe-cpp}" />
<exec executable="haxe">
<arg value="-cp" />
<arg value="${src}"/>
<arg value="-main" />
<arg value="alphatab.Main" />
<arg value="-cpp" />
<arg value="${haxe-cpp}" />
</exec>
</target>
<target name="haxe-xml" depends="global-init">
<delete file="test.xml" />
<exec executable="haxe">
<arg value="-cp" />
<arg value="${src}"/>
<arg value="-main" />
<arg value="alphatab.Main" />
<arg value="-xml" />
<arg value="test.xml" />
</exec>
</target>
<!-- Release -->
<target name="release-init" depends="java-player">
<delete dir="${release}/${DSTAMP}" />
<mkdir dir="${release}/${DSTAMP}" />
</target>
<target name="release" depends="release-init">
<echo message="copying release files to ${release}/${DSTAMP}"/>
<!-- copy distribution files -->
<copy todir="${release}/${DSTAMP}" overwrite="true">
<fileset dir="${bin}" excludes=".svn" />
</copy>
<!-- minify javascripts -->
<echo message="minify alphaTab.js"/>
<java jar="${tools}\compiler.jar" fork="true">
<arg value="--compilation_level" />
<arg value="SIMPLE_OPTIMIZATIONS" />
<arg value="--js" />
<arg value="${release}/${DSTAMP}/lib/alphaTab/alphaTab.js" />
<arg value="--js_output_file" />
<arg value="${release}/${DSTAMP}/lib/alphaTab/alphaTab.min.js" />
</java>
<echo message="minify jquery.alphaTab.js"/>
<java jar="${tools}\compiler.jar" fork="true">
<arg value="--compilation_level" />
<arg value="SIMPLE_OPTIMIZATIONS" />
<arg value="--js" />
<arg value="${release}/${DSTAMP}/lib/alphaTab/jquery.alphaTab.js" />
<arg value="--js_output_file" />
<arg value="${release}/${DSTAMP}/lib/alphaTab/jquery.alphaTab.min.js" />
</java>
<!-- Remove Web files from demo -->
<echo message="deleting php files and .htaccess" />
<delete>
<fileset dir="${release}/${DSTAMP}/demo" includes="**/*.php" />
</delete>
<delete file="${release}/${DSTAMP}/demo/.htaccess" />
<!-- Retrieve all samples from webserver -->
<echo message="loading sample pages from webserver" />
<foreach target="receiveSample" param="samplepath">
<path>
<fileset dir="${bin}/demo/samples" includes="**/*.php" />
</path>
</foreach>
<!-- replace javascript include to minified javascript -->
<echo message="refreshing sample files"/>
<replace dir="${release}/${DSTAMP}" token="alphaTab.js" value="alphaTab.min.js">
<include name="**/*.html" />
<include name="**/*.php" />
</replace>
</target>
<target name="receiveSample" depends="global-init">
<basename property="samplename" file="${samplepath}"
suffix=".php"/>
<echo message="loading sample ${samplename}" />
<get src="http://haxedev/alphaTab/bin/demo/index.php?s=${samplename}.php"
dest="${release}/${DSTAMP}/demo/${samplename}.html" />
</target>
</project>