forked from ericmmartin/simplemodal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
60 lines (53 loc) · 2.15 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
<project name="SimpleModal" default="all" basedir=".">
<loadfile property="version" srcfile="version.txt" />
<property name="PREFIX" value="." />
<property description="Folder for SimpleModal and min target" name="dist" value="${PREFIX}/dist" />
<property description="Source Folder" name="src" value="${PREFIX}/src" />
<property name="SM" value="${dist}/jquery.simplemodal-${version}.js" />
<property name="SM_MIN" value="${dist}/jquery.simplemodal.${version}.min.js" />
<target name="all" depends="clean,full,min" />
<tstamp><format property="build.time" pattern="EEE, MMM d yyyy HH:mm:ss Z" /></tstamp>
<target name="full" description="Main build, replaces @VERSION">
<echo message="Building ${SM}" />
<mkdir dir="${dist}" />
<concat destfile="${SM}">
<fileset dir="${src}" includes="jquery.simplemodal.js" />
</concat>
<replaceregexp match="@VERSION" replace="${version}" flags="g" file="${SM}" />
<replaceregexp match="Date:" replace="Date: ${build.time}" file="${SM}" />
<echo message="${SM} built." />
</target>
<target name="min" depends="full" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${SM_MIN}" />
<apply executable="java" parallel="false" verbose="true" dest="${dist}">
<fileset dir="${dist}">
<include name="jquery.simplemodal-${version}.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.simplemodal-${version}.js" to="tmpmin" />
</apply>
<concat destfile="${SM_MIN}">
<filelist files="${SM}, ${dist}/tmpmin" />
<filterchain>
<headfilter lines="7" />
</filterchain>
</concat>
<concat destfile="${SM_MIN}" append="yes">
<filelist files="${dist}/tmpmin" />
</concat>
<concat destfile="${dist}/jquery.simplemodal.js" append="yes">
<filelist files="${SM_MIN}" />
</concat>
<delete file="${dist}/tmpmin" />
<echo message="${SM_MIN} built." />
</target>
<target name="clean">
<delete dir="${dist}" />
</target>
</project>