blob: c74489eb703f0cdcd91a6574684653ee22c2ef75 (
plain)
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
<?xml version="1.0"?>
<project name="Sun Games Initiative Client Technologies" basedir="." default="all" xmlns:artifact="urn:maven-artifact-ant">
<target name="init">
<!-- If we are running in windows, set dx8 property to true -->
<condition property="windows" >
<os family="windows" />
</condition>
<!-- If we are running in linux, set linux property to true -->
<condition property="linux" >
<!--<os family="unix" />-->
<os name="linux" />
</condition>
<!-- If we are running in Mac OS X, set osx property to true -->
<condition property="osx" >
<and>
<os family="mac" />
<os family="unix" />
</and>
</condition>
</target>
<target name="runtest" depends="dist">
<java classname="${mainclass}"
fork="true" failonerror="true" dir=".">
<classpath>
<pathelement location="dist/jinput.jar"/>
<pathelement location="dist/jinput-test.jar"/>
</classpath>
<jvmarg value="-Djava.library.path=dist"/>
</java>
</target>
<target name="texttest">
<antcall target="runtest">
<param name="mainclass" value="net.java.games.input.test.ControllerTextTest"/>
</antcall>
</target>
<target name="readtest" depends="init,all" description="Try running it.">
<antcall target="runtest">
<param name="mainclass" value="net.java.games.input.test.ControllerReadTest"/>
</antcall>
</target>
<target name="eventtest" depends="init,all" description="Try running it.">
<antcall target="runtest">
<param name="mainclass" value="net.java.games.input.test.ControllerEventTest"/>
</antcall>
</target>
<target name="rumbletest" depends="init,all" description="Try running it.">
<antcall target="runtest">
<param name="mainclass" value="net.java.games.input.test.RumbleTest"/>
</antcall>
</target>
<target name="versiontest" depends="init,all" description="Try running it.">
<antcall target="runtest">
<param name="mainclass" value="net.java.games.input.test.VersionTest"/>
</antcall>
</target>
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<fileset file="coreAPI/build.xml"/>
<fileset file="plugins/linux/build.xml"/>
<fileset file="plugins/windows/build.xml"/>
<fileset file="plugins/wintab/build.xml"/>
<fileset file="plugins/OSX/build.xml"/>
<fileset file="plugins/awt/build.xml"/>
</subant>
</sequential>
</macrodef>
<target name="clean">
<iterate target="clean"/>
<delete dir="dist" failonerror="no"/>
</target>
<target name="all" depends="dist">
</target>
<target name="javadoc" depends="init">
<iterate target="javadoc"/>
</target>
<target name="pluginTest" depends="dist" description="Build plugin version">
<mkdir dir="dist"/>
<mkdir dir="dist/controller"/>
<copy todir="dist">
<fileset file="coreAPI/bin/jinput-core.jar"/>
<fileset file="coreAPI/bin/jinput-test.jar"/>
<fileset file="plugins/DX8/lib/jutils.jar"/>
</copy>
<copy todir="dist/controller">
<fileset dir="plugins/awt/bin"/>
<fileset dir="plugins/linux/bin"/>
<fileset dir="plugins/OSX/bin"/>
<fileset dir="plugins/windows/bin"/>
<fileset dir="plugins/wintab/bin"/>
</copy>
</target>
<target name="dist" depends="init" description="Build the distribution file for this system">
<iterate target="all"/>
<mkdir dir="dist"/>
<jar jarfile="dist/jinput.jar" compress="true" duplicate="preserve">
<fileset dir="coreAPI/classes">
<include name="**/*.class"/>
<exclude name="**/test/*.class"/>
<exclude name="**/example/*.class"/>
</fileset>
<fileset dir="plugins/linux/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/OSX/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/awt/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/windows/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/wintab/classes">
<include name="**/*.class"/>
</fileset>
<zipfileset src="lib/jutils.jar" includes="**/*.class"/>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<copy todir="dist">
<fileset file="coreAPI/bin/jinput-test.jar"/>
<fileset dir="plugins/linux/bin" includes="*so"/>
<fileset dir="plugins/OSX/bin" includes="*jnilib"/>
<fileset dir="plugins/windows/bin" includes="*dll"/>
<fileset dir="plugins/wintab/bin" includes="*dll"/>
</copy>
</target>
<target name="simple_dist" depends="dist,simple_windows,simple_wintab,simple_linux,simple_osx" description="Build the simple jars for each platform"/>
<target name="simple_linux" depends="dist" description="Build the simple linux jar" if="linux">
<jar jarfile="dist/jinput-linux.jar" compress="true">
<fileset dir="coreAPI/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/linux/classes">
<include name="**/*.class"/>
</fileset>
<zipfileset src="lib/jutils.jar" includes="**/*.class"/>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<tar destfile="dist/jinput_linux.tgz" compression="gzip">
<tarfileset dir=".">
<include name="dist/jinput-linux.jar"/>
</tarfileset>
<tarfileset dir="plugins/linux/bin">
<include name="*.so"/>
</tarfileset>
</tar>
</target>
<target name="simple_windows" depends="dist" description="Build the simple windows jar" if="windows">
<jar jarfile="dist/jinput-windows.jar" compress="true">
<fileset dir="coreAPI/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/windows/classes">
<include name="**/*.class"/>
</fileset>
<zipfileset src="lib/jutils.jar" includes="**/*.class"/>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<zip destfile="dist/jinput_windows.zip">
<zipfileset dir=".">
<include name="dist/jinput-windows.jar"/>
</zipfileset>
<zipfileset dir="plugins/windows/bin">
<include name="*.dll"/>
</zipfileset>
</zip>
</target>
<target name="simple_wintab" depends="dist" description="Build the simple windows jar" if="windows">
<jar jarfile="dist/jinput-wintab.jar" compress="true">
<fileset dir="coreAPI/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/wintab/classes">
<include name="**/*.class"/>
</fileset>
<zipfileset src="lib/jutils.jar" includes="**/*.class"/>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<zip destfile="dist/jinput_wintab.zip">
<zipfileset dir=".">
<include name="dist/jinput-wintab.jar"/>
</zipfileset>
<zipfileset dir="plugins/wintab/bin">
<include name="*.dll"/>
</zipfileset>
</zip>
</target>
<target name="simple_osx" depends="dist" description="Build the simple osx jar" if="osx">
<jar jarfile="dist/jinput-osx.jar" compress="true">
<fileset dir="coreAPI/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="plugins/OSX/classes">
<include name="**/*.class"/>
</fileset>
<zipfileset src="lib/jutils.jar" includes="**/*.class"/>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<tar destfile="dist/jinput_osx.tgz" compression="gzip">
<tarfileset dir=".">
<include name="dist/jinput-osx.jar"/>
</tarfileset>
<tarfileset dir="plugins/OSX/bin">
<include name="*.jnilib"/>
</tarfileset>
</tar>
</target>
<target name="install" description="Installs jinput in to local mvn repo">
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.0.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath"/>
<artifact:pom id="jinputpom" groupId="net.java.games" artifactId="jinput" version="2.0.2-SNAPSHOT">
</artifact:pom>
<artifact:writepom pomRefId="jinputpom" file="dist/pom.xml"/>
<artifact:pom id="jinputpomfile" file="dist/pom.xml" />
<delete file="dist/jinput-windows-natives.zip"/>
<zip destfile="dist/jinput-windows-natives.zip">
<fileset dir="dist/">
<include name="**/*.dll"/>
</fileset>
</zip>
<delete file="dist/jinput-linux-natives.zip"/>
<zip destfile="dist/jinput-linux-natives.zip">
<fileset dir="dist/">
<include name="**/*.so"/>
</fileset>
</zip>
<delete file="dist/jinput-osx-natives.jar"/>
<zip destfile="dist/jinput-osx-natives.zip" >
<fileset dir="dist/">
<include name="**/*.jnilib"/>
</fileset>
</zip>
<artifact:install file="dist/jinput.jar">
<pom refid="jinputpomfile" />
<attach file="dist/jinput-windows-natives.zip" classifier="windows-natives" type="zip"/>
<attach file="dist/jinput-linux-natives.zip" classifier="linux-natives" type="zip"/>
<attach file="dist/jinput-osx-natives.zip" classifier="osx-natives" type="zip"/>
</artifact:install>
</target>
<target name="mvndeploy" depends="install" description="Installs jinput in to local mvn repo">
<artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
<artifact:pom id="jinputpom" groupId="net.java.games" artifactId="jinput" version="2.0.1">
</artifact:pom>
<artifact:writepom pomRefId="jinputpom" file="dist/pom.xml"/>
<artifact:pom id="jinputpomfile" file="dist/pom.xml" />
<artifact:deploy file="dist/jinput.jar">
<remoteRepository url="${repository.url}">
<authentication username="${repository.username}" password="${repository.password}"/>
</remoteRepository>
<pom refid="jinputpomfile" />
<attach file="dist/jinput-windows-natives.zip" classifier="windows-natives" type="zip"/>
<attach file="dist/jinput-linux-natives.zip" classifier="linux-natives" type="zip"/>
<attach file="dist/jinput-osx-natives.zip" classifier="osx-natives" type="zip"/>
</artifact:deploy>
</target>
</project>
|