forked from edankwan/PerspectiveTransform.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
74 lines (60 loc) · 2.74 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
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="Hasher" default="all" basedir="./">
<description>
Build Task. Unify files, compress, validate, generate documentation and distribution files.
</description>
<!-- properties -->
<property file="dev/build/build.properties"/>
<!-- targets -->
<target name="purge" description="Delete destination directories.">
<delete dir="${deploy.dir}" />
</target>
<target name="-mkdirs" description="Make required dirs.">
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="-purgeJS">
<delete dir="${dist.dir}" />
</target>
<target name="concat" depends="-purgeJS, -mkdirs" description="Concatenate Files and outputs uncompressed version.">
<echo message="Building ${dist.name}" />
<tstamp>
<format property="build.date" pattern="yyyy/MM/dd hh:mm aa" unit="hour"/>
</tstamp>
<loadfile property="PerspectiveTransform.js" srcFile="${src.dir}/PerspectiveTransform.js"/>
<loadfile property="license.txt" srcFile="${src.dir}/license.txt"/>
<copy file="${src.dir}/wrapper.js" tofile="${dist.dir}/${dist.name}" />
<replace>
<fileset dir="${dist.dir}" includes="${dist.name}" />
<replacefilter token="//::LICENSE:://" value="${license.txt}" />
<replacefilter token="//::PERSPECTIVE_TRANSFORM:://" value="${PerspectiveTransform.js}" />
<!-- version number, build number/date should come after other replaces -->
<replacefilter token="::VERSION_NUMBER::" value="${version.number}"/>
<replacefilter token="::BUILD_DATE::" value="${build.date}"/>
<replacefilter token="::BUILD_NUMBER::" value="${build.number}" />
</replace>
<echo message="${dist.name} built" />
</target>
<target name="minify" description="Build minified version of Hasher.">
<echo message="Building ${dist.min.name}" />
<apply executable="java" parallel="false" verbose="true" dest="${dist.dir}">
<fileset dir="${dist.dir}">
<include name="*.js" />
</fileset>
<arg line="-jar" />
<arg path="${yuicompressor.jar}" />
<arg value="--charset" />
<arg value="ANSI" />
<arg value="-o" />
<targetfile />
<mapper type="glob" from="*.js" to="*.min.js" />
</apply>
<echo message="${dist.min.name} built." />
</target>
<target name="compile" depends="concat, minify">
<echo message="Compiled." />
</target>
<target name="deploy" depends="purge, -mkdirs, compile">
<echo message="Build Complete." />
</target>
</project>