-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.xml
215 lines (190 loc) · 6.42 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="glow" default="all" basedir=".">
<!-- Build -->
<property file="build.properties" />
<property name="NAME" value="glow" />
<property name="ROOT_DIR" value="." />
<property name="SRC_DIR" value="${ROOT_DIR}/src" />
<property name="TEMP_DIR" value="${ROOT_DIR}/temp" />
<property name="TEMP_PKG_DIR" value="${TEMP_DIR}/${NAME}/${VERSION}" />
<property name="DIST_DIR" value="${ROOT_DIR}/dist" />
<property name="DIST_PKG_DIR" value="${DIST_DIR}/${NAME}/${VERSION}" />
<property name="DIST_ZIP" value="${ROOT_DIR}/${NAME}-${VERSION}.zip" />
<property name="DIST_TGZ" value="${ROOT_DIR}/${NAME}-${VERSION}.tgz" />
<property name="YUI_JAR" value="build/lib/yuicompressor-2.4.2.jar" />
<!-- Files -->
<property name="HEADER" value="${SRC_DIR}/header.js" />
<property name="MAP" value="${SRC_DIR}/map.js" />
<property name="BASE_CORE" value="core/core" />
<property name="BASE_WIDGETS" value="widgets/widgets" />
<property name="PKG_CORE" value="${BASE_CORE}.js" />
<property name="PKG_WIDGETS" value="${BASE_WIDGETS}.js" />
<property name="CSS_WIDGETS" value="${BASE_WIDGETS}.css" />
<filelist id="FILES_PROJECT"
dir="${ROOT_DIR}">
<file name="CONTRIBUTORS" />
<file name="LICENCE" />
<file name="README" />
<file name="CHANGES" />
</filelist>
<!-- File order is important -->
<filelist id="FILES_CORE"
dir="${SRC_DIR}">
<file name="glow/glow.js" />
<file name="cc-open.js" />
<file name="i18n/i18n.js" />
<file name="dom/dom.js" />
<file name="events/events.js" />
<file name="data/data.js" />
<file name="net/net.js" />
<file name="tweens/tweens.js" />
<file name="anim/anim.js" />
<file name="forms/forms.js" />
<file name="embed/embed.js" />
<file name="dragdrop/dragdrop.js" />
<file name="cc-close.js" />
</filelist>
<!-- File order is important -->
<filelist id="FILES_WIDGETS"
dir="${SRC_DIR}">
<file name="cc-open.js" />
<file name="widgets/widgets.js" />
<file name="widgets/mask/mask.js" />
<file name="widgets/overlay/overlay.js" />
<file name="widgets/panel/panel.js" />
<file name="widgets/sortable/sortable.js" />
<file name="widgets/infopanel/infopanel.js" />
<file name="widgets/slider/slider.js" />
<file name="widgets/autosuggest/autosuggest.js" />
<file name="widgets/autocomplete/autocomplete.js" />
<file name="widgets/carousel/carousel.js" />
<file name="widgets/editor/editor.js" />
<file name="widgets/timetable/timetable.js" />
<file name="cc-close.js" />
</filelist>
<filelist id="FILES_WIDGETS_CSS"
dir="${SRC_DIR}">
<file name="widgets/widgets.core.css" />
<file name="widgets/widgets.overlay.css" />
<file name="widgets/widgets.panel.css" />
<file name="widgets/widgets.infopanel.css" />
<file name="widgets/widgets.autosuggest.css" />
<file name="widgets/widgets.carousel.css" />
<file name="widgets/widgets.slider.css" />
<file name="widgets/widgets.timetable.css" />
<file name="widgets/widgets.editor.css" />
</filelist>
<fileset id="FILES_IMG"
dir="${SRC_DIR}"
includes="**/*.gif,**/*.png,**/*.jpg" />
<fileset id="FILES_CSS"
dir="${SRC_DIR}"
includes="**/*.css"
excludes="widgets/*.css" />
<!-- Filterchains -->
<filterchain id="FILTER_VERSION">
<fixcrlf eol="lf" />
<replacetokens>
<token key="VERSION" value="${VERSION}"/>
</replacetokens>
<tokenfilter>
<replacestring from="CSSVERSION" to="${CSSVERSION}"/>
</tokenfilter>
</filterchain>
<filterchain id="FILTER_HEADER">
<concatfilter prepend="${HEADER}" />
</filterchain>
<!-- Targets -->
<target name="clean">
<delete dir="${TEMP_DIR}" />
<delete dir="${DIST_DIR}" />
<delete file="${DIST_ZIP}" />
<delete file="${DIST_TGZ}" />
</target>
<target name="setup" depends="clean">
<mkdir dir="${TEMP_PKG_DIR}" />
<mkdir dir="${DIST_PKG_DIR}" />
</target>
<target name="temp" depends="setup">
<echo message="Creating temp files"/>
<concat destfile="${TEMP_PKG_DIR}/${PKG_CORE}">
<filelist refid="FILES_CORE" />
<filterchain refid="FILTER_VERSION" />
</concat>
<concat destfile="${TEMP_PKG_DIR}/${PKG_WIDGETS}">
<filelist refid="FILES_WIDGETS" />
<filterchain refid="FILTER_VERSION" />
</concat>
<concat destfile="${TEMP_PKG_DIR}/${CSS_WIDGETS}">
<filelist refid="FILES_WIDGETS_CSS" />
<filterchain refid="FILTER_VERSION" />
</concat>
<copy todir="${TEMP_PKG_DIR}">
<fileset refid="FILES_CSS" />
<filterchain refid="FILTER_VERSION" />
</copy>
<copy todir="${TEMP_PKG_DIR}">
<fileset refid="FILES_IMG" />
</copy>
<copy todir="${TEMP_DIR}">
<filelist refid="FILES_PROJECT" />
</copy>
<copy todir="${TEMP_DIR}/${NAME}" file="${MAP}" />
</target>
<target name="debug" depends="temp">
<echo message="Creating debug files"/>
<copy todir="${DIST_DIR}">
<fileset dir="${TEMP_DIR}">
<include name="**/*.js" />
</fileset>
<filterchain refid="FILTER_HEADER" />
<globmapper from="*.js" to="*.debug.js" />
</copy>
<copy todir="${DIST_DIR}">
<fileset dir="${TEMP_DIR}">
<include name="**/*.css" />
</fileset>
<filterchain refid="FILTER_HEADER" />
<globmapper from="*.css" to="*.debug.css" />
</copy>
</target>
<target name="min" depends="temp">
<echo message="Creating minified files"/>
<apply executable="java" parallel="false" failonerror="true">
<arg line="-jar"/>
<arg path="${YUI_JAR}"/>
<arg value="--preserve-semi" />
<srcfile/>
<fileset dir="${TEMP_DIR}" includes="**/*.js,**/*.css"/>
<redirector>
<outputmapper type="glob" from="*" to="${DIST_DIR}/*" />
<outputfilterchain refid="FILTER_HEADER" />
</redirector>
</apply>
</target>
<target name="assets" depends="temp">
<echo message="Creating asset files"/>
<copy todir="${DIST_DIR}">
<fileset dir="${TEMP_DIR}" includes="**/*.gif,**/*.png,**/*.jpg" />
</copy>
<copy todir="${DIST_DIR}">
<fileset dir="${TEMP_DIR}" includes="CONTRIBUTORS,LICENCE,README,CHANGES" />
</copy>
</target>
<target name="dist" depends="debug,min,assets">
<delete dir="${TEMP_DIR}" />
<echo message="Creating dist files" />
<zip destfile="${DIST_ZIP}"
basedir="${DIST_DIR}" />
<tar destfile="${DIST_TGZ}"
basedir="${DIST_DIR}"
compression="gzip" />
</target>
<target name="all" depends="dist">
<echo message="" />
<echo message="**************************************" />
<echo message="Glow version ${VERSION} build complete" />
<echo message="**************************************" />
<echo message="" />
</target>
</project>