-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.xml
230 lines (193 loc) · 8.05 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!--+
|
| +===========================+
| | Timeline Build System |
| +===========================+
|
| This is just for bundling and minifying javascript and CSS files.
|
+-->
<project default="compile" basedir="." name="Timeline">
<property name="version" value="pre_2.4.0" /> <!-- For trunk versions, use style pre_2.4.0 -->
<property name="local_example_ver" value="1.0" />
<property name="full_dest" value="dist/timeline_${version}" />
<property name="min_dest" value="htdocs/timeline_${version}" />
<property name="timeline_api" value="src/webapp/api" />
<property name="ajax_api" value="src/ajax/api" />
<property name="timeline_compilations" value="src/webapp/api/compilations" />
<target name="tasks">
<taskdef name="jsmin"
classname="edu.mit.simile.jsminTask.JSMinTask"
classpath="tools/jsmin-task/jsminTask.jar"/>
</target>
<target name="parameterized-bundle" depends="tasks">
<!-- SimileAjax -->
<jsmin output="src/ajax/api/simile-ajax-bundle${suffix}.js" obfuscate="${obfuscate}">
<fileset dir="src/ajax/api/scripts">
<include name="jquery*.js" />
<include name="platform.js" />
</fileset>
<fileset dir="src/ajax/api/scripts">
<include name="**/*.js" />
<exclude name="signal.js" />
<exclude name="jquery*.js" />
<exclude name="platform.js" />
</fileset>
</jsmin>
<!-- Timeline -->
<jsmin output="src/webapp/api/timeline-bundle${suffix}.js" obfuscate="${obfuscate}">
<fileset dir="src/webapp/api/scripts">
<include name="*.js" />
</fileset>
</jsmin>
<concat destfile="src/webapp/api/timeline-bundle${suffix}.css">
<fileset dir="src/webapp/api/styles">
<include name="**/*.css" />
</fileset>
</concat>
</target>
<target name="bundle" depends="tasks">
<antcall target="parameterized-bundle">
<param name="obfuscate" value="true" />
<param name="suffix" value="" />
</antcall>
<antcall target="parameterized-bundle">
<param name="obfuscate" value="false" />
<param name="suffix" value="-debug" />
</antcall>
</target>
<target name="compile-ajax">
<jsmin output="${ajax_api}/compilations/simile-ajax-compilation${suffix}.js" obfuscate="${obfuscate}">
<fileset file="${ajax_api}/compile-prolog.js" />
<fileset file="${ajax_api}/simile-ajax-api.js" />
<fileset file="${ajax_api}/simile-ajax-bundle${suffix}.js" />
<fileset file="${ajax_api}/compile-epilog.js" />
</jsmin>
<concat destfile="${ajax_api}/compilations/simile-ajax-compilation${suffix}.css">
<fileset dir="${ajax_api}/styles">
<include name="**/*.css" />
</fileset>
</concat>
</target>
<target name="compile-timeline">
<jsmin output="${timeline_compilations}/timeline-${locale}-compilation${suffix}.js" obfuscate="${obfuscate}">
<fileset file="${timeline_api}/compile-prolog.js" />
<fileset file="${timeline_api}/timeline-api.js" />
<fileset file="${timeline_api}/timeline-bundle${suffix}.js" />
<fileset dir="${timeline_api}/scripts/l10n/${locale}">
<include name="*.js" />
</fileset>
<fileset file="${timeline_api}/compile-epilog.js" />
</jsmin>
<copy file="${timeline_api}/timeline-bundle${suffix}.css" tofile="${timeline_compilations}/timeline-${locale}-compilation${suffix}.css" />
</target>
<target name="compile-timeline-locale">
<antcall target="compile-timeline">
<param name="locale" value="${locale}" />
<param name="suffix" value="" />
<param name="obfuscate" value="true" />
</antcall>
<antcall target="compile-timeline">
<param name="locale" value="${locale}" />
<param name="suffix" value="-debug" />
<param name="obfuscate" value="false" />
</antcall>
</target>
<target name="compile" depends="bundle">
<!-- SimileAjax -->
<antcall target="compile-ajax">
<param name="suffix" value="" />
<param name="obfuscate" value="true" />
</antcall>
<antcall target="compile-ajax">
<param name="suffix" value="-debug" />
<param name="obfuscate" value="false" />
</antcall>
<!-- Timeline -->
<antcall target="compile-timeline-locale"><param name="locale" value="en" /></antcall>
</target>
<!-- Create full distribution -->
<target name="prepare_full_dist" depends="bundle">
<mkdir dir="${full_dest}"/>
<copy todir="${full_dest}/lib">
<fileset dir="lib" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy todir="${full_dest}/src">
<fileset dir="src" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy todir="${full_dest}/tools">
<fileset dir="tools" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy file=".project" todir="${full_dest}" />
<copy file="build.xml" todir="${full_dest}" />
<copy file="CHANGES.txt" todir="${full_dest}" />
<copy file="jetty.xml" todir="${full_dest}" />
<copy file="LICENSE.txt" todir="${full_dest}" />
<copy file="README.txt" todir="${full_dest}" />
<copy file="run" todir="${full_dest}" />
<copy file="run.bat" todir="${full_dest}" />
</target>
<target name="full_dist" depends="prepare_full_dist">
<zip destfile="timeline_${version}.zip"
basedir="."
update="yes"
duplicate="fail"
includes="${full_dest}/**"
/>
<tar destfile="timeline_${version}.tar.gz" compression="gzip" longfile="gnu"
basedir="."
includes="${full_dest}/**"
/>
</target>
<!-- Create versioned timeline dir with just bundled libraries and support files -->
<target name="prepare_minimal_dist" depends="bundle">
<!-- timeline files -->
<copy file="${timeline_api}/timeline-api.js" todir="${min_dest}" />
<copy file="${timeline_api}/timeline-bundle.js" todir="${min_dest}" />
<copy file="${timeline_api}/timeline-bundle.css" todir="${min_dest}" />
<copy todir="${min_dest}/images">
<fileset dir="${timeline_api}/images" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy todir="${min_dest}/scripts/l10n">
<fileset dir="${timeline_api}/scripts/l10n" excludes="**/.svn/**, **/*.bak" />
</copy>
<!-- ajax files -->
<copy file="${ajax_api}/simile-ajax-api.js" todir="${min_dest}/ajax" />
<copy file="${ajax_api}/simile-ajax-bundle.js" todir="${min_dest}/ajax" />
<copy todir="${min_dest}/ajax/images">
<fileset dir="${ajax_api}/images" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy todir="${min_dest}/ajax/styles">
<fileset dir="${ajax_api}/styles" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy todir="${min_dest}/ajax/content">
<fileset dir="${ajax_api}/content" excludes="**/.svn/**, **/*.bak" />
</copy>
<copy file="${ajax_api}/scripts/signal.js" todir="${min_dest}/ajax/scripts" />
<!-- release files -->
<copy file="CHANGES.txt" todir="${min_dest}" />
<copy file="LICENSE.txt" todir="${min_dest}" />
<copy file="MIN_README.txt" todir="${min_dest}" />
</target>
<target name="minimal_dist" depends="prepare_minimal_dist">
<zip destfile="timeline_${version}_minimal.zip"
basedir="."
update="yes"
duplicate="fail"
includes="${min_dest}/**"
/>
<tar destfile="timeline_${version}_minimal.tar.gz" compression="gzip" longfile="gnu"
basedir="."
includes="${min_dest}/**"
/>
</target>
<target name="dist" depends="full_dist, minimal_dist" />
<target name="distclean">
<delete dir="dist"/>
<delete dir="htdocs"/>
<delete>
<fileset dir="." includes="*.gz"/>
<fileset dir="." includes="*.zip"/>
</delete>
</target>
</project>