-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.xml
More file actions
45 lines (41 loc) · 1.68 KB
/
build.xml
File metadata and controls
45 lines (41 loc) · 1.68 KB
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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="spn" basedir="." default="build">
<property name="version" value="0.1" />
<property name="root.dir" location="." />
<property name="src.dir" location="${root.dir}/src/js" />
<property name="build.dir" location="${root.dir}/build" />
<property name="compressor" location="/usr/share/yui-compressor/yui-compressor.jar"/>
<loadfile property="license" srcfile="../license.txt" />
<target name="build">
<apply executable="java" parallel="false" dest="${build.dir}" taskname="yui">
<fileset dir="${src.dir}">
<patternset>
<include name="spn.js"/>
</patternset>
</fileset>
<arg line="-jar"></arg>
<arg path="${compressor}"></arg>
<arg line="--charset UTF-8"/>
<arg line="--type js"/>
<srcfile/>
<arg line="-o"></arg>
<mapper type="glob" from="spn.js" to="spn.compressed.js"></mapper>
<targetfile/>
</apply>
<concat destfile="${build.dir}/spn.min.js" encoding="UTF-8" >
<header trimleading="yes">/* ${license} */
</header>
<filelist dir="${build.dir}" files= "spn.compressed.js">
</filelist>
</concat>
<delete>
<filelist dir="${build.dir}" files= "spn.compressed.js">
</filelist>
</delete>
<!-- Update version on source files -->
<replaceregexp match="@version ([\d\.]+)" replace="@version ${version}" flags="g" byline="true">
<fileset dir="${src.dir}" includes="**/*" />
</replaceregexp>
</target>
</project>