/
build.xml
59 lines (53 loc) · 2.3 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="jquery.multipleselectbox" default="deploy" basedir=".">
<property name="version" value="0.8.2" />
<!-- Google Closure Compiler (http://dl.google.com/closure-compiler/compiler-latest.zip) -->
<property name="compressorPath" location="../../ex_js/compiler-20140513/compiler.jar" />
<tstamp>
<format property="today" pattern="yyyy/MM/dd" />
</tstamp>
<!-- =================================
target: clean
================================= -->
<target name="clean" description="clean">
<delete file="${ant.project.name}-${version}.zip" />
<delete file="js/${ant.project.name}-tmp.js" />
<delete file="js/${ant.project.name}-min.js" />
</target>
<!-- =================================
target: replace
================================= -->
<target name="replace" description="replace">
<delete file="js/${ant.project.name}-tmp.js" />
<copy file="js/${ant.project.name}.js" tofile="js/${ant.project.name}-tmp.js" overwrite="true" />
<replace file="js/${ant.project.name}-tmp.js">
<replacefilter token="%Revision%" value="${version}" />
<replacefilter token="%BuiltDate%" value="${today}" />
</replace>
</target>
<!-- =================================
target: compress
================================= -->
<target name="compress" description="compress">
<java jar="${compressorPath}" fork="true" failonerror="true">
<arg line="--js ${basedir}/js/${ant.project.name}-tmp.js --js_output_file ${basedir}/js/${ant.project.name}-min.js" />
</java>
</target>
<!-- =================================
target: deploy
================================= -->
<target name="deploy" description="deploy">
<antcall target="clean" />
<antcall target="replace" />
<antcall target="compress" />
<delete file="js/${ant.project.name}-tmp.js" />
<zip destfile="${ant.project.name}-${version}.zip" update="true">
<zipfileset prefix="${ant.project.name}-${version}" dir="${basedir}">
<include name="js/${ant.project.name}-*.js" />
<include name="*.html" />
<include name="*.css" />
<include name="ChangeLog.txt" />
</zipfileset>
</zip>
</target>
</project>