-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
203 lines (186 loc) · 5.98 KB
/
Copy pathbuild.xml
File metadata and controls
203 lines (186 loc) · 5.98 KB
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
<project name="main.java.ruttunen" default="uploadandrun">
<description>
main.java.ruttunen.Main build file
</description>
<!-- set properties for this build -->
<property environment="env" />
<property file="build.properties" />
<property name="src" location="src" />
<property name="build" location="build" />
<property name="full.main.class" value="${package}.${main.class}" />
<property name="binary" value="${build}/${main.class}.nxj" />
<property name="debug" value="${build}/${main.class}.nxd" />
<path id="lejos.pc">
<fileset dir="${nxj.home}/lib/pc">
<include name="**/*.jar" />
</fileset>
</path>
<path id="lejos.nxt">
<fileset dir="${nxj.home}/lib/nxt">
<include name="**/*.jar" />
</fileset>
</path>
<condition property="d32Flag" value="-d32" else="-Dblank.dummy.arg=">
<and>
<os family="mac" />
</and>
</condition>
<!-- deletes generated files -->
<target name="clean" description="clean up all generated files">
<delete dir="${build}" />
</target>
<target name="compile" depends="clean" description="compile the source ">
<!-- Compile the java code from ${src} to ${build} -->
<mkdir dir="${build}" />
<javac srcdir="${src}" destdir="${build}" includeantruntime="false" verbose="false">
<bootclasspath refid="lejos.nxt" />
<!--
Without this, there are some JDK jars in the classpath.
Set verbose=true to check that the classpath is really clean.
-->
<compilerarg value="-extdirs" />
<compilerarg value="" />
</javac>
</target>
<target name="link" depends="compile" description="link the binary ">
<!-- Link the binary and create a signature file -->
<java classname="lejos.pc.tools.NXJLink" failonerror="true">
<classpath refid="lejos.pc" />
<arg value="--bootclasspath" />
<arg pathref="lejos.nxt" />
<arg value="--classpath" />
<arg path="${build}" />
<arg value="--writeorder" />
<arg value="LE" />
<arg value="-o" />
<arg file="${binary}" />
<arg value="-od" />
<arg file="${debug}" />
<arg value="-v" />
<arg value="${full.main.class}" />
</java>
</target>
<target name="debuglink" depends="compile" description="link the binary">
<!-- Link the binary and create a signature file -->
<java classname="lejos.pc.tools.NXJLink" failonerror="true">
<classpath refid="lejos.pc" />
<arg value="--bootclasspath" />
<arg pathref="lejos.nxt" />
<arg value="--classpath" />
<arg path="${build}" />
<arg value="--writeorder" />
<arg value="LE" />
<arg value="-o" />
<arg file="${binary}" />
<arg value="-od" />
<arg file="${debug}" />
<arg value="-gr" />
<arg value="-v" />
<arg value="${full.main.class}" />
</java>
</target>
<target name="upload" depends="link" description="upload the binary">
<java classname="lejos.pc.tools.NXJUpload" fork="true" failonerror="true">
<jvmarg value="-Dnxj.home=${nxj.home}" />
<jvmarg value="${d32Flag}" />
<classpath refid="lejos.pc" />
<arg value="${binary}" />
</java>
</target>
<target name="uploadandrun" depends="link" description="upload and run the binary">
<java classname="lejos.pc.tools.NXJUpload" fork="true" failonerror="true">
<jvmarg value="-Dnxj.home=${nxj.home}" />
<jvmarg value="${d32Flag}" />
<classpath refid="lejos.pc" />
<arg value="-r" />
<arg file="${binary}" />
</java>
</target>
<target name="debuguploadandrun" depends="debuglink" description="upload and run the binary">
<java classname="lejos.pc.tools.NXJUpload" fork="true" failonerror="true">
<jvmarg value="-Dnxj.home=${nxj.home}" />
<jvmarg value="${d32Flag}" />
<classpath refid="lejos.pc" />
<arg value="-r" />
<arg file="${binary}" />
</java>
</target>
<target name="console" depends="debuguploadandrun" description="run a console">
<sleep seconds="4" />
<java classname="lejos.pc.tools.NXJConsole" fork="true" failonerror="true">
<jvmarg value="-Dnxj.home=${nxj.home}" />
<jvmarg value="${d32Flag}" />
<classpath refid="lejos.pc" />
<arg value="-di" />
<arg file="${debug}" />
</java>
</target>
<target name="consoleviewer" depends="debuguploadandrun" description="run the GUI Console Viewer">
<sleep seconds="4" />
<java classname="lejos.pc.tools.NXJConsoleViewer" fork="true" failonerror="true">
<jvmarg value="-Dnxj.home=${nxj.home}" />
<jvmarg value="${d32Flag}" />
<classpath refid="lejos.pc" />
<arg value="-di" />
<arg file="${debug}" />
</java>
</target>
<target name="debugtool" description="run the debug tool">
<input
message="Exception class:"
addproperty="class"
/>
<input
message="Method number:"
addproperty="method"
/>
<input
message="PC value:"
addproperty="pc"
/>
<java classname="lejos.pc.tools.NXJDebugTool" fork="true" failonerror="true">
<jvmarg value="-Dnxj.home=${nxj.home}" />
<classpath refid="lejos.pc" />
<arg value="-di" />
<arg file="${debug}" />
<arg value="-c" />
<arg value="-m" />
<arg value="${class}" />
<arg value="${method}" />
<arg value="${pc}" />
</java>
</target>
<!-- generate javadocs -->
<target name="docs" description="generate javadocs">
<delete dir="${docs}" />
<mkdir dir="${docs}" />
<javadoc
destdir="${docs}"
charset="utf-8"
locale="en_US"
author="true"
access="protected"
windowtitle="Project documentation"
verbose="false"
>
<classpath refid="lejos.nxt" />
<arg value="-extdirs"/>
<arg value="-quiet"/>
<packageset
dir="${src}"
/>
</javadoc>
</target>
<!-- used only for modifying the Netbeans NXJPlugin -->
<target name="Zip for Netbeans" description="Zip the application to the sample project">
<property name="plugin" location="../NXJPlugin/src/nxjplugin/" />
<zip basedir="." destfile="${plugin}/NXJSampleProject.zip">
<exclude name="build/**" />
<exclude name="bin/**" />
<exclude name="dist/**" />
<exclude name="nbproject/private/**" />
<exclude name=".project" />
<exclude name=".classpath" />
</zip>
</target>
</project>