This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
178 lines (142 loc) · 5.59 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<project name="AFrame" basedir=".">
<description>
AFrame - The Application Framework
</description>
<property name="major" value="0" />
<property name="minor" value="0" />
<property name="src" location="src" />
<property name="dist" location="dist" />
<property name="YUI" location="tools/yuicompressor-2.4.2.jar" />
<property name="docs" location="docs" />
<property name="site" location="site" />
<property name="docs_parse" location="docparse" />
<property file="per_user.properties" />
<property file="yuidoc.properties" />
<property file="includes.list" />
<property file="includes.node.list" />
<property file="adapters.list" />
<target name="get_build_number" >
<property file="build.number" />
<property name="build.version" value="${major}.${minor}.${build.number}" />
<property name="js_combined" location="${dist}/aframe-${build.version}" />
<property name="js_combined_current" location="${dist}/aframe-current" />
<echo level="info" message="AFrame Version: ${build.version}" />
</target>
<target name="init" depends="get_build_number">
<tstamp/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${peruser.antcontrib.location}" />
</classpath>
</taskdef>
</target>
<target name="increment_build_number">
<propertyfile file="build.number"
comment="Build Number for ANT. Edit not!">
<entry key="build.number" type="int"
operation="+"
default="1" />
</propertyfile>
<antcall target="get_build_number" />
</target>
<target name="lintfile">
<exec executable="tools/jsl" failonerror="true">
<arg line="-conf tools/jsl.default.conf -process ${filename}"/>
</exec>
</target>
<target name="lintadapter">
<antcall target="lintfile" >
<param name="filename" location="${src}/adapters/${filename}.js" />
</antcall>
</target>
<target name="jslint" depends="init">
<echo level="info" message="JSLint: running..." />
<foreach param="filename" target="lintfile" parallel="true">
<path>
<filelist dir="${src}" files="${includes.list}">
</filelist>
</path>
</foreach>
<foreach param="filename" target="lintadapter" inheritall="true" list="${adapters.list}" parallel="true">
</foreach>
<echo level="info" message="JSLint: finished running...." />
</target>
<target name="addadapter">
<echo message="Combining js files to ${js_combined}-${adapter}" />
<concat destfile="${js_combined}-${adapter}.js">
<fileset file="${js_combined}">
</fileset>
<fileset file="${src}/adapters/${adapter}.js">
</fileset>
</concat>
</target>
<target name="concat" depends="init"
description="concatinate the script">
<echo message="Combining js files to ${js_combined}" />
<concat destfile="${js_combined}">
<filelist dir="${src}" files="${includes.list}">
</filelist>
</concat>
<foreach param="adapter" target="addadapter" list="${adapters.list}" inheritall="true">
</foreach>
</target>
<target name="concat_node" depends="init"
description="concatinate the script for node">
<echo message="Combining js files to ${js_combined}.node" />
<concat destfile="${js_combined}-node.js">
<filelist dir="${src}" files="${includes.node.list}">
</filelist>
</concat>
</target>
<target name="compressfile">
<echo message="Building ${js_combined}-${adapter}.js" />
<apply executable="java" parallel="false" verbose="true" dest="${dist}">
<fileset file="${js_combined}-${adapter}.js">
</fileset>
<arg line="-jar" />
<arg path="${YUI}" />
<arg value="--charset" />
<arg value="ANSI" />
<arg value="-o" />
<mapper type="glob" from="*.js" to="*.min.js" />
<targetfile />
</apply>
<copy file="${js_combined}-${adapter}.js" tofile="${js_combined_current}-${adapter}.js" />
<copy file="${js_combined}-${adapter}.min.js" tofile="${js_combined_current}-${adapter}.min.js" />
<echo message="${js_combined}-${adapter}.js built." />
</target>
<target name="compress" depends="concat,concat_node"
description="Compress the script">
<foreach param="adapter" target="compressfile" list="${adapters.list}" inheritall="true">
</foreach>
<foreach param="adapter" target="compressfile" list="node" inheritall="true">
</foreach>
</target>
<target name="docs" depends="init,clean">
<exec executable="python" failonerror="true">
<arg line="${yuidoc.home}/bin/yuidoc.py ${yuidoc.parser_in} -p ${yuidoc.parser_out} -o ${yuidoc.generator_out} -t ${yuidoc.template} -v ${build.version} -Y ${yuidoc.yuiversion} -m ${yuidoc.projectname} -u ${yuidoc.projecturl} -C ${yuidoc.copyrighttag} -s"/>
</exec>
</target>
<target name="all" depends="init,clean,jslint,increment_build_number,compress,docs">
</target>
<target name="site" description="build the site" depends="docs">
<mkdir dir="${site}" />
<delete dir="${site}/docs" />
<delete dir="${site}/src" />
<delete dir="${site}/tests" />
<copy todir="${site}/docs" >
<fileset dir="${docs}" />
</copy>
<copy todir="${site}/src" >
<fileset dir="${src}" />
</copy>
<copy todir="${site}/tests" >
<fileset dir="tests" />
</copy>
</target>
<target name="clean"
description="clean up">
<delete dir="${docs}" />
<delete dir="${docs_parse}" />
</target>
</project>