-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
149 lines (131 loc) · 4.53 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Naoji" default="all">
<property file="user.properties" />
<property file="build.properties" />
<path id="build.classpath">
<pathelement path="${build.home}" />
<fileset dir="${basedir}/lib">
<include name="**/*.jar" />
</fileset>
</path>
<target name="all" depends="javah,compile,jar,jar.test" />
<target name="clean">
<delete dir="${javadoc.home}" />
<delete dir="${build.home}" />
<delete dir="${build.test.home}" />
<delete file="${build.jar}" />
<delete file="${build.test.jar}" />
<mkdir dir="${build.home}" />
<mkdir dir="${build.test.home} " />
<mkdir dir="${javadoc.home}" />
</target>
<target name="jar" depends="compile">
<jar destfile="${build.jar}" duplicate="fail">
<fileset dir="${build.home}">
<include name="**/*.*" />
</fileset>
</jar>
</target>
<target name="jar.test" depends="compile.test">
<jar destfile="${build.test.jar}">
<fileset dir="${build.test.home}">
<include name="**/*.*" />
</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 refid="build.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>
<!-- Linux host only. -->
<target name="compile.native" depends="javah">
<exec executable="make" dir="${build.native}" failonerror="true">
<arg value="-j" />
<arg value="${build.native.jobs}" />
<arg value="${build.native.cross}" />
<arg value="${build.native.debug}" />
<arg value="libnaoji.so" />
<arg value="libnaojin.so" />
<arg value="libnaojiv4l2.so" />
<arg value="naoji_main" />
</exec>
</target>
<target name="compile.test" depends="compile">
<mkdir dir="${build.test.home}" />
<javac srcdir="${build.test.src}" destdir="${build.test.home}" debug="${build.debug}" target="${build.target}" source="${build.source}" optimize="${build.optimize}" encoding="${build.encoding}">
<include name="**/*.java" />
<classpath refid="build.classpath" />
</javac>
<copy todir="${build.test.home}">
<fileset dir="${build.test.src}">
<include name="**/*.*" />
<exclude name="**/*.java" />
</fileset>
<fileset dir="${basedir}">
<include name="License*" />
</fileset>
</copy>
</target>
<target name="javah" description="create JNI C/C++ header" depends="compile">
<mkdir dir="${build.native}/include" />
<javah destdir="${build.native}/include" verbose="yes">
<class name="${native.naoji1}" />
<class name="${native.naoji2}" />
<class name="${native.naoji3}" />
<class name="${native.naoji4}" />
<class name="${native.naoji5}" />
<class name="${native.naoji6}" />
<class name="${native.naoji7}" />
<class name="${native.naoji8}" />
<class name="${native.naoji.v4l2}" />
<class name="${native.naoji.i2c}" />
<classpath refid="build.classpath" />
</javah>
</target>
<target name="javadoc">
<javadoc sourcepath="${build.src}" packagenames="${javadoc.packages}" destdir="${javadoc.home}" Encoding="UTF-8" Private="true" charset="UTF-8" />
</target>
<target name="deploy" depends="deploy.jar, deploy.native" />
<target name="deploy.jar" depends="jar">
<fail message="target.ip is required." unless="target.ip" />
<exec executable="scp">
<arg line="${build.jar}" />
<arg value="root@${target.ip}:${target.libdir}" />
</exec>
</target>
<target name="deploy.native" depends="compile.native">
<fail message="target.ip is required." unless="target.ip" />
<exec executable="scp" dir="${build.native}">
<arg line="${build.native.files}" />
<arg value="root@${target.ip}:${target.libdir}" />
</exec>
</target>
<target name="deploy.test" depends="jar.test">
<fail message="target.ip is required." unless="target.ip" />
<exec executable="scp">
<arg value="${build.test.jar}" />
<arg value="${build.lib}/${junit.jar}" />
<arg value="root@${target.ip}:${target.libdir}" />
</exec>
<exec executable="rsync">
<arg value="--ignore-existing" />
<arg value="naoji.modules" />
<arg value="run_cameratest.sh" />
<arg value="run_i2ctest.sh" />
<arg value="run_v4l2test.sh" />
<arg value="root@${target.ip}:${target.libdir}" />
</exec>
</target>
</project>