forked from mapstraction/mxn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
119 lines (107 loc) · 3.99 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
117
118
119
<?xml version="1.0"?>
<project name="mapstraction" default="build">
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="tools/ant-contrib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- set global properties for this build -->
<property name="source" location="source"/>
<property name="build.base" location="build"/>
<property name="build.major" value="2"/>
<property name="build.minor" value="0"/>
<target name="build">
<!-- generate build number -->
<buildnumber/>
<tstamp>
<format property="YEAR" pattern="yyyy"/>
</tstamp>
<property name="build.ver" value="${build.major}.${build.minor}.${build.number}"/>
<property name="build.dir" location="${build.base}/${build.ver}"/>
<!-- make our build directory -->
<mkdir dir="${build.dir}"/>
<!-- copy our sources in -->
<echo>--- COPY SOURCES ---</echo>
<copy todir="${build.dir}" overwrite="true" flatten="true">
<resources>
<file file="${source}/mxn.js"/>
<file file="${source}/mxn.core.js"/>
<file file="${source}/mxn.(provider).core.js"/>
<file file="${source}/mxn.cloudmade.core.js"/>
<file file="${source}/mxn.google.core.js"/>
<file file="${source}/mxn.googlev3.core.js"/>
<file file="${source}/mxn.microsoft.core.js"/>
<file file="${source}/mxn.yahoo.core.js"/>
</resources>
</copy>
<!-- lint our sources -->
<echo>--- LINT ---</echo>
<!-- Hopefully get the whole lot linting eventually
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/*.js"/>
</java>
-->
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.js"/>
</java>
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.core.js"/>
</java>
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.(provider).core.js"/>
</java>
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.cloudmade.core.js"/>
</java>
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.google.core.js"/>
</java>
<java jar="tools/rhino/js.jar" fork="true" failonerror="true">
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.googlev3.core.js"/>
</java>
<!-- document our sources -->
<echo>--- DOC ---</echo>
<java jar="tools/jsdoc-toolkit/jsrun.jar" fork="true" failonerror="true">
<arg value="tools/jsdoc-toolkit/app/run.js"/>
<arg value="${build.dir}/mxn.js"/>
<arg value="${build.dir}/mxn.core.js"/>
<arg value="-c=tools/jsdoc-toolkit/mxn.conf"/>
<arg value="-d=${build.dir}/docs"/>
</java>
<!-- minify our sources -->
<echo>--- MIN ---</echo>
<for param="file">
<path>
<fileset dir="${build.dir}" includes="*.js"/>
</path>
<sequential>
<propertyregex override="yes" property="minfile" input="@{file}" regexp=".*[\/\\]([a-z\.\(\)]+)\.js" replace="\1-min.js"/>
<java jar="tools/yui-compressor/yuicompressor-2.4.2.jar" args="-o ${build.dir}/${minfile} @{file}" fork="true" failonerror="true"/>
</sequential>
</for>
<!-- prepend our copyright and license notice -->
<echo>--- COPYRIGHT ---</echo>
<for param="file">
<path>
<fileset dir="${build.dir}" includes="*.js"/>
</path>
<sequential>
<concat destfile="${build.dir}/temp.t">
<header file="license.js"/>
<fileset file="@{file}"/>
<filterchain>
<expandproperties/>
</filterchain>
</concat>
<move file="${build.dir}/temp.t" tofile="@{file}" overwrite="true"/>
</sequential>
</for>
</target>
</project>