forked from recurser/jquery-simple-color
/
build.xml
55 lines (48 loc) · 2.18 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="jquery.simple-color" default="jquery.simple-color" basedir=".">
<tstamp />
<loadfile property="version" srcfile="VERSION"/>
<property description="Folder for jquery.simple-color and min target" name="dist" value="."/>
<property name="JQS" value="${dist}/jquery.simple-color.js"/>
<property name="JQS_MIN" value="${dist}/jquery.simple-color.min.js"/>
<target name="jquery.simple-color" description="Main jquery.simple-color build, concatenates source files and replaces @VERSION">
<echo message="Building ${JQS}"/>
<mkdir dir="${dist}"/>
<concat destfile="${JQS}">
<fileset file="src/jquery.simple-color.js"/>
</concat>
<replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JQS}"/>
<replaceregexp match="@DATE" replace="${DSTAMP}${TSTAMP}" file="${JQS}"/>
<echo message="${JQS} built."/>
</target>
<target name="min" depends="jquery.simple-color" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${JQS_MIN}"/>
<apply executable="java" parallel="false" verbose="true" dest="${dist}">
<fileset dir="${dist}">
<include name="jquery.simple-color.js"/>
</fileset>
<arg line="-jar"/>
<arg path="build/compiler.jar"/>
<arg value="--warning_level"/>
<arg value="QUIET"/>
<arg value="--js_output_file"/>
<targetfile/>
<arg value="--js"/>
<mapper type="glob" from="jquery.simple-color.js" to="tmpmin"/>
</apply>
<concat destfile="${JQS_MIN}">
<filelist files="${JQS}, tmpmin"/>
<filterchain>
<headfilter lines="11"/>
</filterchain>
</concat>
<concat destfile="${JQS_MIN}" append="yes">
<filelist files="tmpmin"/>
</concat>
<delete file="tmpmin"/>
<echo message="${JQS_MIN} built."/>
</target>
<target name="clean">
<delete dir="tmpmin"/>
</target>
</project>