-
Notifications
You must be signed in to change notification settings - Fork 172
/
build.xml
116 lines (105 loc) · 4.26 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
<project name="jQuery Address" default="release" basedir=".">
<property file="build.properties" />
<path id="classpath">
<fileset dir="lib" includes="*.jar" />
</path>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath" />
<target name="release">
<antcall target="dist" />
<antcall target="test" />
<antcall target="samples" />
<antcall target="bundle" />
</target>
<target name="bundle">
<copy todir="${name}-${version}">
<fileset dir="${dist.dir}">
<include name="${name}-${version}.js" />
<include name="${name}-${version}.min.js" />
</fileset>
<fileset dir="${basedir}">
<include name="${samples.dir}/**/*" />
</fileset>
</copy>
<zip destfile="./../${name}-${version}.zip"
basedir="${basedir}"
includes="${name}-${version}/" />
<delete dir="${name}-${version}" />
</target>
<target name="dist">
<mkdir dir="${dist.dir}" />
<delete includeemptydirs="true">
<fileset dir="${dist.dir}" includes="**/*" />
</delete>
<antcall target="validate">
<param name="file" value="${src.dir}/${name}" />
</antcall>
<copy todir="${dist.dir}">
<fileset dir="${src.dir}"/>
</copy>
<replaceregexp match="\$\{version\}" file="${dist.dir}/${name}.js">
<substitution expression="${version}"/>
</replaceregexp>
<move file="${dist.dir}/${name}.js" tofile="${dist.dir}/${name}-${version}.js" />
<concat destfile="${dist.dir}/${name}-${version}.lic">
<filelist files="${dist.dir}/${name}-${version}.js" />
<filterchain>
<headfilter lines="1" />
</filterchain>
</concat>
<java jar="${lib.dir}/compiler.jar"
failonerror="true" fork="true">
<arg line="--js=${dist.dir}/${name}-${version}.js --js_output_file=${dist.dir}/${name}-${version}.tmp" />
</java>
<concat destfile="${dist.dir}/${name}-${version}.min.js">
<filelist files="${dist.dir}/${name}-${version}.lic,${dist.dir}/${name}-${version}.tmp" />
</concat>
<delete>
<filelist files="${dist.dir}/${name}-${version}.lic,${dist.dir}/${name}-${version}.tmp" />
</delete>
</target>
<target name="validate">
<java classpath="lib/js.jar"
classname="org.mozilla.javascript.tools.shell.Main"
failonerror="true" fork="true">
<arg line="${lib.dir}/rhino.js ${file}.js" />
</java>
</target>
<target name="sample">
<delete>
<fileset dir="${dir}" includes="${name}-\d.\d+.min.js" />
</delete>
<copy file="${dist.dir}/${name}-${version}.min.js" todir="${dir}" overwrite="true" />
</target>
<target name="samples">
<antcall target="sample">
<param name="dir" value="${samples.dir}/accordion" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/api" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/events" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/express/public" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/form" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/state" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/subtabs" />
</antcall>
<antcall target="sample">
<param name="dir" value="${samples.dir}/tabs" />
</antcall>
</target>
<target name="test">
<delete>
<fileset dir="${test.dir}" includes="${name}-\d.\d+.min.js" />
</delete>
<copy file="${dist.dir}/${name}-${version}.min.js" todir="${test.dir}" overwrite="true" />
</target>
</project>