-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
171 lines (152 loc) · 6.39 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
<!--+
|
| +===========================+
| | Exhibit Build System |
| +===========================+
|
| This is just for bundling and minifying javascript and CSS files.
|
+-->
<project default="build" basedir="." name="Exhibit">
<property name="exhibit_api" value="src/webapp/api" />
<property name="ajax_api" value="src/ajax/api" />
<property name="exhibit_compilations" value="src/webapp/api/compilations" />
<target name="tasks">
<taskdef name="jsmin"
classname="edu.mit.simile.jsminTask.JSMinTask"
classpath="tools/jsmin-task/jsminTask.jar"/>
<taskdef
resource="net/sf/antcontrib/antcontrib.properties"
classpath="tools/ant-contrib-1.0b3.jar"/>
</target>
<target name="bundle-locale" depends="tasks">
<echo message="Bundling locale ${locale}"/>
<jsmin output="src/webapp/api/locales/${locale}/exhibit-${locale}-bundle.js">
<fileset dir="src/webapp/api/locales/${locale}/scripts">
<include name="**/*.js" />
</fileset>
</jsmin>
</target>
<target name="bundle-extension" depends="tasks">
<echo message="Bundling extension ${extension}"/>
<jsmin output="src/webapp/api/extensions/${extension}/${extension}-extension-bundle${suffix}.js" obfuscate="${obfuscate}">
<fileset dir="src/webapp/api/extensions/${extension}/scripts">
<include name="**/*.js" />
</fileset>
</jsmin>
<concat destfile="src/webapp/api/extensions/${extension}/${extension}-extension-bundle.css">
<fileset dir="src/webapp/api/extensions/${extension}/styles" erroronmissingdir="false">
<include name="**/*.css" />
</fileset>
</concat>
</target>
<target name="bundle-extensions" depends="tasks">
<antcall target="bundle-extension">
<param name="extension" value="time" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="map" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="chart" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="timeplot" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="calendar" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="curate" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="editing" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extension">
<param name="extension" value="freebase" />
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
</target>
<target name="bundle-ajax" depends="tasks">
<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>
</target>
<target name="bundle-exhibit" depends="tasks">
<jsmin output="src/webapp/api/exhibit-bundle${suffix}.js" obfuscate="${obfuscate}">
<fileset dir="src/webapp/api/scripts">
<include name="**/*.js" />
<exclude name="create.js" />
</fileset>
</jsmin>
<concat destfile="src/webapp/api/exhibit-bundle.css">
<fileset dir="src/webapp/api/styles">
<include name="**/*.css" />
</fileset>
</concat>
</target>
<target name="build-locale" depends="tasks">
<antcall target="bundle-locale"><param name="locale" value="${locale}" /></antcall>
</target>
<target name="build-locales" depends="tasks">
<antcall target="build-locale"><param name="locale" value="en" /></antcall>
<antcall target="build-locale"><param name="locale" value="es" /></antcall>
<antcall target="build-locale"><param name="locale" value="fr" /></antcall>
<antcall target="build-locale"><param name="locale" value="sv" /></antcall>
<antcall target="build-locale"><param name="locale" value="zh" /></antcall>
<antcall target="build-locale"><param name="locale" value="de" /></antcall>
<antcall target="build-locale"><param name="locale" value="nl" /></antcall>
</target>
<target name="build-suffix" depends="tasks">
<echo message="[[[ Building profile ${profile} ]]]"/>
<antcall target="bundle-ajax">
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-exhibit">
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
<antcall target="bundle-extensions">
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
</target>
<target name="build" depends="tasks">
<antcall target="build-suffix">
<param name="profile" value="release" />
<param name="obfuscate" value="true" />
<param name="suffix" value="" />
</antcall>
<antcall target="build-suffix">
<param name="profile" value="debug" />
<param name="obfuscate" value="false" />
<param name="suffix" value="-debug" />
</antcall>
<antcall target="build-locales" />
</target>
</project>