-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
179 lines (148 loc) · 5.93 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
<!--+
|
| +===========================+
| | Timeline Build System |
| +===========================+
|
| This is just for bundling and minifying javascript and CSS files.
|
+-->
<project default="publish-local" basedir="." name="Timeline">
<!-- For trunk versions, use style pre_2.4.0 -->
<property name="version" value="3.0.0" />
<property name="webapp.dir" value="src/webapp"/>
<property name="api.dir" value="${webapp.dir}/api"/>
<property name="site.dir" value="${webapp.dir}/site"/>
<property name="scripts.dir" value="${api.dir}/scripts"/>
<property name="rjs.dir" value="optimize"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="full.dir" value="${dist.dir}/full/timeline-${version}" />
<property name="min.dir" value="${dist.dir}/minimal/timeline-${version}" />
<property name="ajax.dir" value="src/ajax/api"/>
<target name="bundle">
<fileset dir="${api.dir}/nls/" includes="**/*.js" id="locales"/>
<pathconvert dirsep="/" refid="locales" property="localelist" pathsep=",">
<map from="${basedir}/${api.dir}/" to=""/>
<globmapper from="*.js" to="*"/>
</pathconvert>
<exec dir="." executable="node">
<arg line="${rjs.dir}/r.js -o ${rjs.dir}/build.js deps=${localelist}"/>
</exec>
</target>
<target name="bundle-debug">
<fileset dir="${api.dir}/nls/" includes="**/*.js" id="locales"/>
<pathconvert dirsep="/" refid="locales" property="localelist" pathsep=",">
<map from="${basedir}/${api.dir}/" to=""/>
<globmapper from="*.js" to="*"/>
</pathconvert>
<exec dir="." executable="node">
<arg line="${rjs.dir}/r.js -o ${rjs.dir}/build.js optimize=none out=build/timeline-api-debug.js paths.simile-ajax=../../ajax/api/simile-ajax-api-debug deps=${localelist}"/>
</exec>
<copy file="${build.dir}/timeline-api-debug.js" todir="${api.dir}"/>
</target>
<target name="bundle-require">
<exec dir="." executable="node">
<arg line="${rjs.dir}/r.js -o ${rjs.dir}/build-require.js"/>
</exec>
</target>
<target name="bundle-css">
<exec dir="." executable="node">
<arg line="${rjs.dir}/r.js -o ${rjs.dir}/build-css.js"/>
</exec>
</target>
<target name="bundle-all" depends="bundle,bundle-require,bundle-css" />
<target name="publish-local" depends="bundle-all">
<copy file="${build.dir}/timeline-api.js" todir="${api.dir}"/>
<copy file="${build.dir}/timeline-bundle.js" todir="${api.dir}"/>
<copy file="${build.dir}/timeline-bundle.css" todir="${api.dir}/styles"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete file="${api.dir}/timeline-api.js"/>
<delete file="${api.dir}/timeline-bundle.js"/>
<delete file="${api.dir}/styles/timeline-bundle.css"/>
</target>
<!-- Create full distribution -->
<target name="prepare-full-dist" depends="bundle-debug,publish-local">
<mkdir dir="${full.dir}"/>
<copy todir="${full.dir}/lib">
<fileset dir="lib" />
</copy>
<copy todir="${full.dir}/src">
<fileset dir="src" />
</copy>
<copy todir="${full.dir}/tools">
<fileset dir="tools" />
</copy>
<copy todir="${full.dir}/optimize">
<fileset dir="optimize" />
</copy>
<copy file="${build.dir}/timeline-api-debug.js" todir="${full.dir}/${api.dir}" />
<copy file=".project" todir="${full.dir}" />
<copy file="build.xml" todir="${full.dir}" />
<copy file="jetty.xml" todir="${full.dir}" />
<copy file="LICENSE.txt" todir="${full.dir}" />
<copy file="README.md" todir="${full.dir}" />
<copy file="run" todir="${full.dir}" />
<copy file="run.bat" todir="${full.dir}" />
</target>
<target name="full-dist" depends="prepare-full-dist">
<zip destfile="timeline-${version}.zip"
basedir="${dist.dir}/full"
update="yes"
duplicate="fail"
/>
<tar destfile="timeline-${version}.tar.gz"
compression="gzip"
longfile="gnu"
basedir="${dist.dir}/full"
/>
</target>
<!-- Create versioned timeline dir with just bundled libraries and support files -->
<target name="prepare-minimal-dist" depends="bundle-debug,publish-local">
<!-- timeline files -->
<copy file="${api.dir}/timeline-api.js" todir="${min.dir}/timeline" />
<copy file="${api.dir}/timeline-bundle.js" todir="${min.dir}/timeline" />
<copy file="${build.dir}/timeline-api-debug.js" todir="${min.dir}/timeline" />
<copy file="${api.dir}/styles/timeline-bundle.css" todir="${min.dir}/timeline/styles" />
<copy todir="${min.dir}/timeline/images">
<fileset dir="${api.dir}/images" />
</copy>
<!-- ajax files -->
<copy file="${ajax.dir}/simile-ajax-api.js" todir="${min.dir}/ajax" />
<copy file="${ajax.dir}/simile-ajax-bundle.js" todir="${min.dir}/ajax" />
<copy todir="${min.dir}/ajax/images">
<fileset dir="${ajax.dir}/images" />
</copy>
<copy todir="${min.dir}/ajax/styles">
<fileset dir="${ajax.dir}/styles" />
</copy>
<copy todir="${min.dir}/ajax/content">
<fileset dir="${ajax.dir}/content" />
</copy>
<!-- release files -->
<copy file="LICENSE.txt" todir="${min.dir}" />
</target>
<target name="minimal-dist" depends="prepare-minimal-dist">
<zip destfile="timeline-${version}-minimal.zip"
basedir="${dist.dir}/minimal"
update="yes"
duplicate="fail"
/>
<tar destfile="timeline-${version}-minimal.tar.gz"
compression="gzip"
longfile="gnu"
basedir="${dist.dir}/minimal"
/>
</target>
<target name="dist" depends="full-dist,minimal-dist" />
<target name="distclean">
<delete dir="${dist.dir}"/>
<delete>
<fileset dir="." includes="*.gz"/>
<fileset dir="." includes="*.zip"/>
</delete>
</target>
<target name="clean-all" depends="clean,distclean"/>
</project>