-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
231 lines (204 loc) · 8.68 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?xml version="1.0" encoding="UTF-8"?>
<project name="asura-j" default="all">
<property file="user.properties" />
<property file="build.properties" />
<taskdef resource="proguard/ant/task.properties" classpath="${build.lib}/${proguard.jar}" />
<path id="build.classpath">
<fileset dir="${build.lib}">
<include name="${jscheme.jar}" />
<include name="${jetty.jar}" />
<include name="${jetty-util.jar}" />
<include name="${servlet-api.jar}" />
<include name="${log4j.jar}" />
<include name="${vecmath.jar}" />
<include name="${vecmathx.jar}" />
<include name="${commons-io.jar}" />
</fileset>
</path>
<path id="build.naoji.classpath">
<path refid="build.classpath" />
<fileset dir="${build.lib}">
<include name="${naoji.jar}" />
</fileset>
</path>
<target name="all" depends="deploy.webots" />
<target name="target.naoji" depends="jar, jar.naoji">
</target>
<target name="clean">
<delete dir="${javadoc.home}" />
<delete dir="${build.home}" />
<delete file="${build.jar}" />
<mkdir dir="${build.home}" />
<mkdir dir="${javadoc.home}" />
</target>
<target name="jar" depends="compile">
<jar destfile="${build.jar}" update="no" duplicate="fail">
<fileset dir="${build.home}">
<include name="**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>
<target name="naoji.manifest.classpath">
<pathconvert property="build.lib.path">
<path path="${build.lib}" />
</pathconvert>
<pathconvert pathsep=" " dirsep="/" property="naoji.manifest.classpath" refid="build.naoji.classpath">
<map from="${build.lib.path}" to="lib" />
</pathconvert>
</target>
<target name="jar.naoji" depends="compile.naoji, naoji.manifest.classpath">
<jar destfile="${build.naoji.jar}" update="no" duplicate="fail">
<fileset dir="${build.naoji.home}">
<include name="**/*.*" />
</fileset>
<manifest>
<attribute name="Class-Path" value="${build.jar} ${naoji.manifest.classpath}" />
</manifest>
</jar>
</target>
<target name="jar.webots" depends="compile.webots">
<jar destfile="${build.webots.jar}" update="no" duplicate="fail">
<fileset dir="${build.webots.home}">
<include name="**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>
<target name="compile">
<mkdir dir="${build.home}" />
<javac srcdir="${build.src}" destdir="${build.home}" debug="${build.debug}" target="${build.target}" source="${build.source}" optimize="${build.optimize}" encoding="${build.encoding}">
<include name="**/*.java" />
<classpath>
<path refid="build.classpath" />
</classpath>
</javac>
<copy todir="${build.home}">
<fileset dir="${build.src}">
<include name="**/*.*" />
<exclude name="**/*.java" />
</fileset>
<fileset dir="${basedir}">
<include name="License*" />
</fileset>
</copy>
</target>
<target name="compile.naoji" depends="compile">
<mkdir dir="${build.naoji.home}" />
<javac srcdir="${build.naoji.src}" destdir="${build.naoji.home}" debug="${build.debug}" target="${build.target}" source="${build.source}" optimize="${build.optimize}" encoding="${build.encoding}">
<include name="**/*.java" />
<classpath>
<path refid="build.naoji.classpath" />
<pathelement path="${build.home}" />
</classpath>
</javac>
<copy todir="${build.naoji.home}">
<fileset dir="${build.naoji.src}">
<include name="**/*.*" />
<exclude name="**/*.java" />
</fileset>
<fileset dir="${basedir}">
<include name="License*" />
</fileset>
</copy>
</target>
<target name="compile.webots" depends="compile">
<mkdir dir="${build.webots.home}" />
<javac srcdir="${build.webots.src}" destdir="${build.webots.home}" debug="${build.debug}" target="${build.target}" source="${build.source}" optimize="${build.optimize}" encoding="${build.encoding}">
<include name="**/*.java" />
<classpath>
<fileset dir="${webots.home}/lib">
<include name="**/*.jar" />
</fileset>
<path refid="build.classpath" />
<pathelement path="${build.home}" />
</classpath>
</javac>
<copy todir="${build.webots.home}">
<fileset dir="${build.webots.src}">
<include name="**/*.*" />
<exclude name="**/*.java" />
</fileset>
<fileset dir="${basedir}">
<include name="License*" />
</fileset>
</copy>
</target>
<target name="javadoc">
<javadoc packagenames="${javadoc.packages}" destdir="${javadoc.home}" Encoding="UTF-8" Private="true" charset="UTF-8">
<fileset dir="${build.src}">
<include name="**/*.java" />
</fileset>
<fileset dir="${build.naoji.src}">
<include name="**/*.java" />
</fileset>
<fileset dir="${build.webots.src}">
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
<target name="proguard" depends="jar">
<delete file="${build.proguard.jar}" />
<proguard configuration="${proguard.pro}">
</proguard>
</target>
<target name="deploy.naoji" depends="jar, jar.naoji">
<fail message="target.ip is required." unless="target.ip" />
<exec executable="${cygwin.home}/bin/rsync">
<env key="PATH" path="${java.library.path}:${build.path}"/>
<arg value="-rRvce" />
<arg value="ssh -o 'StrictHostKeyChecking no'" />
<arg value="${build.jar}" />
<arg value="${build.scheme}" />
<arg value="${build.lib}" />
<arg value="${build.naoji.jar}" />
<arg value="${build.naoji.modules}" />
<arg value="root@${target.ip}:${target.asura-j}/" />
</exec>
</target>
<target name="deploy.webots" depends="deploy.webots.red, deploy.webots.blue, deploy.webots.red.scheme, deploy.webots.blue.scheme" />
<target name="deploy.webots.red.scheme">
<mkdir dir="${build.webots}/controllers/nao_team_0/" />
<copy todir="${build.webots}/controllers/nao_team_0/">
<fileset dir="${build.scheme}">
<include name="**/*.scm" />
</fileset>
</copy>
</target>
<target name="deploy.webots.blue.scheme">
<mkdir dir="${build.webots}/controllers/nao_team_1/" />
<copy todir="${build.webots}/controllers/nao_team_1/">
<fileset dir="${build.scheme}">
<include name="**/*.scm" />
</fileset>
</copy>
</target>
<target name="deploy.webots.red" depends="compile,jar,compile.webots,jar.webots">
<mkdir dir="${build.webots}/controllers/nao_team_0/snapshot/" />
<copy file="${build.webots.jar}" tofile="${build.webots}/controllers/nao_team_0/${build.webots.jar}" />
<copy file="${build.jar}" tofile="${build.webots}/controllers/nao_team_0/${build.jar}" />
<copy file="${build.webots.home}/nao_team_0.class" todir="${build.webots}/controllers/nao_team_0/" />
<copy file="${build.lib}/${jscheme.jar}" tofile="${build.webots}/controllers/nao_team_0/${jscheme.jar}" />
<copy file="${build.lib}/${jetty.jar}" tofile="${build.webots}/controllers/nao_team_0/${jetty.jar}" />
<copy file="${build.lib}/${jetty-util.jar}" tofile="${build.webots}/controllers/nao_team_0/${jetty-util.jar}" />
<copy file="${build.lib}/${servlet-api.jar}" tofile="${build.webots}/controllers/nao_team_0/${servlet-api.jar}" />
<copy file="${build.lib}/${log4j.jar}" tofile="${build.webots}/controllers/nao_team_0/${log4j.jar}" />
<copy file="${build.lib}/${vecmath.jar}" tofile="${build.webots}/controllers/nao_team_0/${vecmath.jar}" />
<copy file="${build.lib}/${vecmathx.jar}" tofile="${build.webots}/controllers/nao_team_0/${vecmathx.jar}" />
<copy file="${build.lib}/${commons-io.jar}" tofile="${build.webots}/controllers/nao_team_0/${commons-io.jar}" />
</target>
<target name="deploy.webots.blue" depends="compile,jar,compile.webots,jar.webots">
<mkdir dir="${build.webots}/controllers/nao_team_1/snapshot/" />
<copy file="${build.webots.jar}" tofile="${build.webots}/controllers/nao_team_1/${build.webots.jar}" />
<copy file="${build.jar}" tofile="${build.webots}/controllers/nao_team_1/${build.jar}" />
<copy file="${build.webots.home}/nao_team_1.class" todir="${build.webots}/controllers/nao_team_1/" />
<copy file="${build.lib}/${jscheme.jar}" tofile="${build.webots}/controllers/nao_team_1/${jscheme.jar}" />
<copy file="${build.lib}/${jetty.jar}" tofile="${build.webots}/controllers/nao_team_1/${jetty.jar}" />
<copy file="${build.lib}/${jetty-util.jar}" tofile="${build.webots}/controllers/nao_team_1/${jetty-util.jar}" />
<copy file="${build.lib}/${servlet-api.jar}" tofile="${build.webots}/controllers/nao_team_1/${servlet-api.jar}" />
<copy file="${build.lib}/${log4j.jar}" tofile="${build.webots}/controllers/nao_team_1/${log4j.jar}" />
<copy file="${build.lib}/${vecmath.jar}" tofile="${build.webots}/controllers/nao_team_1/${vecmath.jar}" />
<copy file="${build.lib}/${vecmathx.jar}" tofile="${build.webots}/controllers/nao_team_1/${vecmathx.jar}" />
<copy file="${build.lib}/${commons-io.jar}" tofile="${build.webots}/controllers/nao_team_1/${commons-io.jar}" />
</target>
</project>