-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
89 lines (79 loc) · 3.09 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
<project name="phototopo" default="all" basedir=".">
<property file="project.properties"/>
<property name="PREFIX" value="." />
<property name="dists" value="${PREFIX}/dist/" />
<property name="dist" value="${dists}/${ant.project.name}-${version}" description="Folder for output and min target" />
<property name="src" value="${PREFIX}/src" />
<property name="lib" value="lib" />
<property name="docs" value="${PREFIX}/docs" />
<property name="zip" value="${dists}/${ant.project.name}-${version}.zip" />
<property name="JS" value="${dist}/${ant.project.name}.js" />
<property name="JS_MIN" value="${dist}/${ant.project.name}-min.js" />
<property name="CSS" value="${dist}/${ant.project.name}.css" />
<property name="CSS_MIN" value="${dist}/${ant.project.name}-min.css" />
<target name="all" depends="dist" />
<target name="docs" depends="jsdoc" />
<target name="build" depends="clean" description="Main build, concatenates source files and replaces @VERSION">
<echo message="Building ${JS}" />
<mkdir dir="${dist}" />
<concat destfile="${JS}">
<fileset file="${src}/phototopo.js" />
</concat>
<concat destfile="${CSS}">
<fileset file="${src}/phototopo.css" />
</concat>
<copy todir="${dist}/images">
<fileset dir="src/images" />
</copy>
<replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JS}" />
<echo message="Project built." />
</target>
<target name="dist" depends="min" description="Makes a zip ready for distribution">
<zip destfile="${zip}" basedir="${dists}" />
</target>
<target name="thecrag" depends="dist" description="Deploy files directly into thecrag">
<exec executable="scp">
<arg value="-r" />
<arg value="${dist}" />
<arg value="crag:/home/bheywood/CIDS/CIDS/application/frontend/thirdparty/static/bheywood" />
</exec>
</target>
<target name="lint" depends="" description="Check src against JSLint">
<exec executable="java">
<arg line="-jar ${lib}/js.jar ${lib}/jslint-check.js" />
</exec>
</target>
<target name="min" depends="build" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${JS_MIN}" />
<java fork="true" jar="${lib}/yuicompressor-2.4.2.jar">
<arg line="--type=js" />
<arg path="${JS}" />
<arg line="-v" />
<arg line="-o" />
<arg path="${JS_MIN}" />
</java>
<java fork="true" jar="${lib}/yuicompressor-2.4.2.jar">
<arg line="--type=css" />
<arg path="${CSS}" />
<arg line="-v" />
<arg line="-o" />
<arg path="${CSS_MIN}" />
</java>
<echo message="${JS_MIN} and ${CSS_MIN} built." />
</target>
<target name="jsdoc" depends="build" description="Build JSDocs">
<delete dir="docs" />
<mkdir dir="docs" />
<echo message="Building JSDocs" />
<java fork="true" jar="${jsdoc.home}/jsrun.jar">
<arg line="${jsdoc.home}/app/run.js" />
<arg line=" -a" />
<arg line="-t=${jsdoc.home}/templates/jsdoc" />
<arg line="${src}/phototopo.js" />
<arg line="-d=docs" />
</java>
</target>
<target name="clean">
<delete dir="${dists}" />
</target>
</project>