This repository has been archived by the owner on Aug 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
91 lines (74 loc) · 3.34 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
<project name="simples" default="simples" basedir=".">
<loadfile property="version" srcfile="version.txt" />
<loadfile property="filelist" srcfile="filelist.txt" />
<property description="Folder for simples and min target" name="dist" value="./dist" />
<property description="Folder for simples src" name="src" value="./src" />
<tstamp>
<format property="current.year" pattern="yyyy"/>
</tstamp>
<property name="SIMPLE" value="${dist}/simples.js" />
<property name="SIMPLE_MIN" value="${dist}/simples.min.js" />
<available property="qunit" file="test/qunit" />
<target name="qunit-clone" unless="qunit">
<exec executable="git" outputproperty="git-qunit" >
<arg line="clone git://github.com/jquery/qunit.git test/qunit"/>
</exec>
<echo message="git clone qunit: ${git-qunit}" />
</target>
<target name="qunit-pull" if="qunit">
<exec executable="git" outputproperty="git-qunit" dir="test/qunit" >
<arg line="pull origin master"/>
</exec>
<echo message="git pull qunit: ${git-qunit}" />
</target>
<target name="simples" depends="qunit-clone,qunit-pull" description="Main simples build, concatenates source files and replaces @VERSION">
<echo message="Building ${SIMPLE}" />
<mkdir dir="${dist}" />
<delete dir="${dist}"/>
<mkdir dir="${dist}"/>
<exec executable="git" outputproperty="last.commit">
<arg line="log -1 --pretty='%cd'"/>
</exec>
<concat destfile="${SIMPLE}" fixlastline="yes">
<filelist dir="${src}" files="${filelist}"/>
</concat>
<replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${SIMPLE}" />
<replaceregexp match="@CURRENT_YEAR" replace="${current.year}" flags="g" byline="true" file="${SIMPLE}" />
<replaceregexp match="Date: " replace="Date: ${last.commit}" file="${SIMPLE}" />
<echo message="${SIMPLE} built." />
</target>
<target name="docs" description="Creates documentation for the js">
<exec executable="java">
<arg line="-jar build/jsdoc-toolkit/jsrun.jar build/jsdoc-toolkit/app/run.js src/core.js src/support.js src/data.js src/ajax.js src/selector.js src/dom.js src/css.js src/events.js src/position.js src/animation.js -a -t=build/jsdoc-toolkit/templates/jsdoc -d=docs/" />
</exec>
</target>
<target name="lint" depends="simples" description="Check Simples against JSLint">
<exec executable="java">
<arg line="-jar build/js.jar build/jslint-check.js" />
</exec>
</target>
<target name="min" depends="simples, lint" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${SIMPLE_MIN}" />
<apply executable="java" parallel="false" verbose="true" dest="${dist}">
<fileset dir="${dist}">
<include name="simples.js" />
</fileset>
<arg line="-jar" />
<arg path="build/google-compiler-20100330.jar" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<mapper type="glob" from="simples.js" to="tmpmin" />
</apply>
<concat destfile="${SIMPLE_MIN}" append="yes">
<filelist files="dist/tmpmin"/>
</concat>
<delete file="dist/tmpmin"/>
<echo message="${SIMPLE_MIN} built." />
</target>
<target name="clean">
<delete dir="${dist}" />
</target>
</project>