forked from kwhat/jnativehook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
634 lines (515 loc) · 25.4 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
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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
<?xml version="1.0" encoding="UTF-8"?>
<!--
JNativeHook: Global keyboard and mouse hooking for Java.
Copyright (C) 2006-2013 Alexander Barker. All Rights Received.
http://code.google.com/p/jnativehook/
JNativeHook is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JNativeHook is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="JNativeHook" default="all" basedir=".">
<!-- Project Settings -->
<property file="build.num" />
<property name="ant.project.vendor" value="Alexander Barker ([email protected])" />
<property name="ant.project.version" value="${ant.build.major}.${ant.build.minor}.${ant.build.revision}" />
<property file="build.properties" />
<property name="ant.build.debug" value="true" />
<property name="ant.build.javac.compiler" value="modern" />
<property name="ant.build.javac.source" value="1.5" />
<property name="ant.build.javac.target" value="1.5" />
<property name="ant.build.javac.args" value="" />
<!-- Set the compiler flags. -->
<condition property="ant.build.native.cflags" value="${env.CFLAGS}" else="-O2 -g -pipe">
<isset property="${env.CFLAGS}" />
</condition>
<!-- Set the linker flags. -->
<condition property="ant.build.native.ldflags" value="${env.LDFLAGS}" else="-Wl,-O1">
<isset property="${env.LDFLAGS}" />
</condition>
<property name="ant.build.native.toolchain" value="gcc" />
<property name="ant.build.native.jobs" value="auto" />
<property environment="env" />
<!-- Path Settings -->
<property name="dir.src" value="${basedir}/src" />
<property name="dir.doc" value="${basedir}/doc" />
<property name="dir.jar" value="${basedir}/jar" />
<property name="dir.dist" value="${basedir}/dist" />
<property name="dir.lib" value="${basedir}/lib" />
<property name="dir.bin" value="${basedir}/bin" />
<!-- Class Path Settings -->
<!-- NOTE Gentoo requires `CLASSPATH="$(java-config -p ant-junit,junit-4)" ant test` -->
<path id="ant.project.class.path">
<pathelement location="${dir.bin}/class/java" />
<pathelement location="${dir.bin}/class/test" />
<pathelement location="${dir.jar}" />
<pathelement location="${dir.lib}" />
<pathelement path="${java.class.path}" />
</path>
<target name="clean" description="Removes generated bytecode and object files.">
<echo>Cleaning build structure...</echo>
<delete includeEmptyDirs="true" verbose="true" failonerror="false">
<fileset dir="${dir.bin}" includes="**/*" />
<fileset file="build.properties" />
</delete>
</target>
<target name="mostlyclean" depends="clean" description="Removes all items except previously built libs.">
<echo>Cleaning all build related items...</echo>
<delete includeEmptyDirs="true" verbose="true" failonerror="false">
<fileset dir="${dir.dist}" />
<fileset dir="${dir.doc}" />
<fileset dir="${dir.jar}" />
<fileset dir="${dir.src}/libuiohook" casesensitive="yes">
<include name="autom4te.cache" />
<include name="config" />
<include name="include/*" />
<exclude name="include/uiohook.h"/>
<include name="m4/*" />
<exclude name="m4/ax_pthread.m4"/>
<include name="pc/*" />
<exclude name="pc/uiohook.pc.in" />
<include name="Makefile" />
<include name="Makefile.in" />
<include name="aclocal.m4" />
<include name="config.log" />
<include name="config.status" />
<include name="configure" />
</fileset>
<fileset file="${dir.src}/jni/include/org_jnativehook_GlobalScreen.h" />
</delete>
</target>
<target name="distclean" depends="mostlyclean" description="Removes all items generated by the build system.">
<echo>Cleaning all build related items...</echo>
<delete includeEmptyDirs="true" verbose="true" failonerror="false">
<!-- Brilliant!
<fileset dir="${dir.src}/jnitasks" />
<fileset dir="${dir.src}/libuiohook" />
-->
<fileset dir="${dir.lib}" />
</delete>
</target>
<target name="init" description="Initialize local build environment.">
<echo>Initializing local build environment...</echo>
<mkdir dir="${dir.bin}" />
<fail message="Could not determine ${ant.project.name} version. Please check the build.num file.">
<condition>
<not>
<and>
<isset property="ant.build.major" />
<isset property="ant.build.minor" />
<isset property="ant.build.revision" />
</and>
</not>
</condition>
</fail>
<echo level="info">${ant.project.name} version ${ant.project.version}</echo>
<!-- Try to locate the include folder for java headers -->
<condition property="ant.build.javac.include" value="${env.JDK_HOME}/include">
<available file="${env.JDK_HOME}/include" type="dir" />
</condition>
<condition property="ant.build.javac.include" value="${env.JAVA_HOME}/include">
<available file="${env.JAVA_HOME}/include" type="dir" />
</condition>
<condition property="ant.build.javac.include" value="${java.home}/include">
<available file="${java.home}/include" type="dir" />
</condition>
<condition property="ant.build.javac.include" value="${java.home}/../include">
<available file="${java.home}/../include" type="dir" />
</condition>
<condition property="ant.build.javac.include" value="${java.home}/../Headers">
<available file="${java.home}/../Headers" type="dir" />
</condition>
<condition property="ant.build.javac.include" value="/System/Library/Frameworks/JavaVM.framework/Headers">
<available file="/System/Library/Frameworks/JavaVM.framework/Headers" type="dir" />
</condition>
<condition property="ant.build.javac.include" value="${java.home}/Headers">
<available file="${java.home}${file.separator}Headers" type="dir" />
</condition>
<fail message="Could not determine ant.build.javac.include. Please set your JDK_HOME / JAVA_HOME environment variable or manually set the ant.build.javac.include property to the location of your java header files.">
<condition>
<not>
<or>
<isset property="ant.build.javac.include" />
<available file="${ant.build.javac.include}" type="dir" />
</or>
</not>
</condition>
</fail>
<echo level="info">Found Java include location: ${ant.build.javac.include}</echo>
<!-- Try to locate the rt.jar location for ant.build.javac.bootclasspath -->
<condition property="ant.build.javac.bootclasspath" value="${env.JDK_HOME}/lib/rt.jar">
<available file="${env.JDK_HOME}/lib/rt.jar" type="dir" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${env.JAVA_HOME}/lib/rt.jar">
<available file="${env.JAVA_HOME}/lib/rt.jar" type="dir" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${java.home}/lib/rt.jar">
<available file="${java.home}/lib/rt.jar" type="file" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${env.JDK_HOME}/bundle/Classes/classes.jar">
<available file="${env.JDK_HOME}/bundle/Classes/classes.jar" type="dir" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${env.JAVA_HOME}/bundle/Classes/classes.jar">
<available file="${env.JAVA_HOME}/bundle/Classes/classes.jar" type="dir" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${java.home}/bundle/Classes/classes.jar">
<available file="${java.home}/bundle/Classes/classes.jar" type="file" />
</condition>
<fail message="Could not determine ant.build.javac.bootclasspath location. Please set your JDK_HOME / JAVA_HOME environment variable or manually set the ant.build.javac.bootclasspath property to the location of your rt.jar file.">
<condition>
<not>
<or>
<isset property="ant.build.javac.bootclasspath" />
<available file="${ant.build.javac.bootclasspath}" type="file" />
</or>
</not>
</condition>
</fail>
<echo level="info">Found Java lib location: ${ant.build.javac.bootclasspath}</echo>
<!-- Preform jnitasks target checks. -->
<available file="${dir.src}/jnitasks" property="project.check.jnitasks.download" />
<!-- Preform libuiohook target checks. -->
<available file="${dir.src}/libuiohook" property="project.check.libuiohook.download" />
<available file="${dir.src}/libuiohook/configure" property="project.check.libuiohook.bootstrap" />
<available file="${dir.bin}/libuiohook/Makefile" property="project.check.libuiohook.configure" />
<available file="${dir.jar}/${ant.project.name}.jar" property="project.check.jar" />
<available file="${dir.doc}/" property="project.check.javadoc" />
<!-- Set the operating system name used for organizing native libraries -->
<condition property="ant.build.native.os" value="freebsd">
<os family="unix" name="FreeBSD" />
</condition>
<condition property="ant.build.native.os" value="openbsd">
<os family="unix" name="OpenBSD" />
</condition>
<condition property="ant.build.native.os" value="darwin">
<and>
<os family="mac" />
<os family="unix" />
</and>
</condition>
<condition property="ant.build.native.os" value="solaris">
<or>
<os family="unix" name="Solaris" />
<os family="unix" name="SunOS" />
</or>
</condition>
<condition property="ant.build.native.os" value="linux">
<os family="unix" name="Linux" />
</condition>
<condition property="ant.build.native.os" value="windows">
<os family="winnt" />
</condition>
<!-- Set the system arch name used for organizing native libraries -->
<condition property="ant.build.native.arch" value="x86">
<or>
<os arch="x86" />
<os arch="i386" />
<os arch="i486" />
<os arch="i586" />
<os arch="i686" />
</or>
</condition>
<condition property="ant.build.native.arch" value="x86_64">
<or>
<os arch="x86-64" />
<os arch="x86_64" />
<os arch="amd64" />
<os arch="k8" />
</or>
</condition>
<condition property="ant.build.native.arch" value="ppc">
<or>
<os arch="ppc" />
<os arch="PowerPC" />
</or>
</condition>
<condition property="ant.build.native.arch" value="ppc64">
<or>
<os arch="ppc64" />
<os arch="PowerPC64" />
</or>
</condition>
<property name="ant.build.native.arch" value="${os.arch}" />
<!-- TODO Testing Needed
<condition property="native.arch" value="sparc">
<os arch="sparc" />
</condition>
-->
<!-- Figure out the operating system we are building for. -->
<condition property="native.os.isApple" value="true">
<equals arg1="${ant.build.native.os}" arg2="darwin" />
</condition>
<condition property="native.os.isUnix" value="true">
<or>
<equals arg1="${ant.build.native.os}" arg2="freebsd" />
<equals arg1="${ant.build.native.os}" arg2="openbsd" />
<equals arg1="${ant.build.native.os}" arg2="solaris" />
<equals arg1="${ant.build.native.os}" arg2="linux" />
</or>
</condition>
<condition property="native.os.isWindows" value="true">
<equals arg1="${ant.build.native.os}" arg2="windows" />
</condition>
<!-- Set system specific library name -->
<condition property="ant.build.native.executable" value="lib${ant.project.name}.dylib">
<equals arg1="${ant.build.native.os}" arg2="darwin" />
</condition>
<condition property="ant.build.native.executable" value="${ant.project.name}.dll">
<equals arg1="${ant.build.native.os}" arg2="windows" />
</condition>
<property name="ant.build.native.executable" value="lib${ant.project.name}.so" />
<!-- Create property file for the descovered values
<propertyfile file="ant.build.properties" comment="auto-generated by ant configure">
<entry key="ant.build.debug" value="${ant.build.debug}" />
<entry key="ant.build.javac.args" value="${ant.build.javac.args}" />
</propertyfile -->
</target>
<target name="download-jnitasks" depends="init" unless="project.check.jnitasks.download" description="Download and initialize the native library.">
<echo>Downloading JNITasks source...</echo>
<mkdir dir="${dir.src}/jnitasks" />
<get src="https://github.com/kwhat/jnitasks/archive/master.zip" dest="${dir.bin}/jnitasks-master.zip" verbose="true" />
<unzip src="${dir.bin}/jnitasks-master.zip" dest="${dir.src}/jnitasks">
<mapper type="glob" from="jnitasks-master/*" to="*"/>
</unzip>
</target>
<target name="compile-jnitasks" depends="download-jnitasks" description="Download and initialize the native library.">
<echo>Compiling JNITasks source...</echo>
<ant antfile="${dir.src}/jnitasks/build.xml" dir="${dir.src}/jnitasks" target="compile">
<property name="dir.bin" value="${dir.bin}/jnitasks" />
<property name="dir.src" value="${dir.src}/jnitasks/src" />
</ant>
<typedef file="${dir.src}/jnitasks/src/org/jnitasks/antlib.xml" classpath="${dir.bin}/jnitasks" />
</target>
<target name="download-libuiohook" depends="init" unless="project.check.libuiohook.download" description="Download the native library source code.">
<echo>Downloading libUIOHook source...</echo>
<mkdir dir="${dir.src}/libuiohook" />
<get src="https://github.com/kwhat/libuiohook/archive/master.zip" dest="${dir.bin}/libuiohook-master.zip" verbose="true" />
<unzip src="${dir.bin}/libuiohook-master.zip" dest="${dir.src}/libuiohook">
<mapper type="glob" from="libuiohook-master/*" to="*"/>
</unzip>
</target>
<target name="bootstrap-libuiohook" depends="compile-jnitasks,download-libuiohook" unless="project.check.libuiohook.bootstrap" description="Initialize the native library build system.">
<echo>Bootstrapping libUIOHook...</echo>
<autoreconf dir="${dir.src}/libuiohook" force="true" install="true">
<include path="/opt/local/share/aclocal" if="native.os.isApple" />
</autoreconf>
</target>
<target name="configure-libuiohook" depends="bootstrap-libuiohook" unless="project.check.libuiohook.configure" description="Configure platform dependent features for native library.">
<echo>Configuring libUIOHook source...</echo>
<mkdir dir="${dir.bin}/libuiohook" />
<configure dir="${dir.bin}/libuiohook" path="${dir.src}/libuiohook" prefix="${dir.bin}">
<enable if="ant.build.debug">debug</enable>
<enable>quiet</enable>
<enable>static</enable>
<disable>shared</disable>
<with>pic</with>
</configure>
</target>
<target name="compile-libuiohook" depends="configure-libuiohook" description="Compile the native library.">
<echo>Compiling libUIOHook source...</echo>
<make dir="${dir.bin}/libuiohook" jobs="${ant.build.native.jobs}" target="install" />
</target>
<target name="compile-java" depends="init" description="Compiles Java source files.">
<echo>Compiling Java source...</echo>
<mkdir dir="${dir.bin}/class/java" />
<javac
destdir="${dir.bin}/class/java"
debug="${ant.build.debug}"
debuglevel="lines,vars,source"
optimize="true"
deprecation="false"
includeantruntime="false"
listfiles="true"
verbose="false"
>
<compilerarg line="${ant.build.javac.args}"/>
<src path="${dir.src}/java" />
<classpath refid="ant.project.class.path" />
<bootclasspath path="${ant.build.javac.bootclasspath}" />
</javac>
</target>
<target name="compile-jni" depends="compile-libuiohook,compile-java" description="Compiles JNI source files.">
<echo>Creating JNI Headers...</echo>
<javah destdir="${dir.src}/jni/include" verbose="true">
<class name="org.jnativehook.GlobalScreen"/>
<classpath refid="ant.project.class.path" />
<bootclasspath path="${ant.build.javac.bootclasspath}" />
</javah>
<!-- Call pkg-config to determin what libraries to link against. -->
<pkgconfig libs="true" packages="uiohook" outputproperty="ant.build.native.ld.libs">
<dirset dir="${dir.bin}">
<include name="lib/pc"/>
<include name="bin/pc"/>
</dirset>
</pkgconfig>
<echo>Compiling C source...</echo>
<!-- Create required directories for compiling -->
<mkdir dir="${dir.bin}/obj/jni" />
<!--
TODO Test without -fno-strict-aliasing
Darwin
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-I${dir.bin}/obj/native/include -I${dir.src}/jni/include -I/usr/lib -I${java.include} -I${java.include}/darwin
-c ${native.cc.flags} -fPIC -Wall -Wextra ${native.cc.flags.debug} ${native.cc.includes}
-dynamiclib -Wl,-dead_strip,-dead_strip_dylibs,-install_name,${native.executable}.${ant.build.major}.${ant.build.minor},-compatibility_version,${ant.build.major}.${ant.build.minor},-current_version,${ant.build.major}.${ant.build.minor}.${ant.build.revision}
Unix
-I${dir.bin}/include -I${dir.src}/jni/include -I${java.include} -I${java.include}/linux
-c ${native.cc.flags} -fPIC -Wall -Wextra ${native.cc.flags.debug} ${native.cc.includes}
-shared -Wl,- -as-needed
Windows
-I${dir.bin}/include -I${dir.src}/jni/include -I${java.include} -I${java.include}/win32
-c ${native.cc.flags} -Wall -Wextra ${native.cc.flags.debug} ${native.cc.includes}
-shared -Wl,- -as-needed,- -kill-at
-->
<!-- Execute the native compiler on the soruce files -->
<cc toolchain="gcc" jobs="${ant.build.native.jobs}" objdir="${dir.bin}/obj/jni">
<arg value="-Wall -Wextra -Wno-unused-parameter" />
<arg value="-fPIC" unless="native.os.isWindows" />
<arg value="${ant.build.native.cflags}" />
<define name="DEBUG" if="ant.build.debug"/>
<define name="__int64" value="int64_t" if="native.os.isWindows" />
<include path="${dir.bin}/include" />
<include path="${dir.src}/jni/include" />
<include path="${ant.build.javac.include}" />
<include path="${ant.build.javac.include}/win32" if="native.os.isWindows"/>
<include path="${ant.build.javac.include}/${ant.build.native.os}" unless="native.os.isWindows"/>
<fileset dir="${dir.src}/jni">
<include name="**/*.c" />
</fileset>
</cc>
<echo>Linking C objects...</echo>
<!-- Create required directory for linking -->
<mkdir dir="${dir.lib}/${ant.build.native.os}/${ant.build.native.arch}" />
<ld toolchain="gcc" outfile="${dir.lib}/${ant.build.native.os}/${ant.build.native.arch}/${ant.build.native.executable}">
<!-- weak linker options for darwin: -Wl,-flat_namespace,-undefined,dynamic_lookup -->
<arg value="-dynamiclib" if="native.os.isApple" />
<arg value="-shared" unless="native.os.isApple" />
<arg value="${ant.build.native.ldflags}" />
<fileset dir="${dir.bin}">
<include name="obj/jni/**/*.o" />
</fileset>
<!-- Linking order matters and libraries should come after obj files. -->
<arg value="${ant.build.native.ld.libs}" />
</ld>
</target>
<target name="compile" depends="compile-java,compile-jni" description="Compiles both Java and C source files.">
</target>
<target name="test" depends="init" description="Compile and perform JUnit tests.">
<echo>Compiling JUnit source...</echo>
<mkdir dir="${dir.bin}/class/test" />
<javac
destdir="${dir.bin}/class/test"
debug="${ant.build.debug}"
debuglevel="lines,vars,source"
optimize="true"
deprecation="false"
includeantruntime="false"
listfiles="true"
verbose="false"
>
<src path="${dir.src}/test" />
<classpath refid="ant.project.class.path" />
<bootclasspath path="${ant.build.javac.bootclasspath}" />
<compilerarg value="-Xlint:unchecked" />
</javac>
<echo>Performing JUnit tests...</echo>
<junit fork="true" printsummary="true" haltonerror="true">
<jvmarg value="-Djava.library.path=${dir.lib}/${ant.build.native.os}/${ant.build.native.arch}" />
<classpath refid="ant.project.class.path" />
<formatter type="brief" usefile="false" />
<!-- test name="TestExample" / -->
<batchtest> <!-- todir="${reports.tests}" -->
<fileset dir="${dir.src}/test">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="jar" unless="project.check.jar" description="Creates the jar library.">
<echo>Copying libs...</echo>
<mkdir dir="${dir.bin}/class/java/org/jnativehook/lib" />
<copy overwrite="true" todir="${dir.bin}/class/java/org/jnativehook/lib">
<fileset dir="${dir.lib}" includes="**/*" />
</copy>
<echo>Creating ${ant.project.name}.jar...</echo>
<mkdir dir="${dir.jar}" />
<jar jarfile="${dir.jar}/${ant.project.name}.jar" basedir="${dir.bin}/class/java">
<include name="org/jnativehook/**" />
<!-- <exclude name="org/jnativehook/example/NativeHookDemo.class" /> -->
<manifest>
<attribute name="Main-Class" value="org.jnativehook.example.NativeHookDemo" />
<section name="org/jnativehook">
<attribute name="Implementation-Title" value="${ant.project.name} Library" />
<attribute name="Implementation-Version" value="${ant.project.version}" />
<attribute name="Implementation-Vendor" value="${ant.project.vendor}" />
</section>
</manifest>
</jar>
</target>
<target name="run" depends="compile" description="Execute the bundled example.">
<java classname="org.jnativehook.example.NativeHookDemo" fork="true" failonerror="true">
<jvmarg value="-Djava.library.path=${dir.lib}/${ant.build.native.os}/${ant.build.native.arch}" />
<classpath>
<pathelement location="${dir.jar}/${ant.project.name}.jar" />
<pathelement path="${dir.bin}/class/java" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
</target>
<target name="javadoc" unless="project.check.javadoc" description="Generates javadoc api documentation.">
<echo level="info">Generating API Documenation...</echo>
<mkdir dir="${dir.doc}" />
<javadoc destdir="${dir.doc}" windowtitle="${ant.project.name}" author="true" version="true" use="true">
<packageset dir="${dir.src}/java" defaultexcludes="yes">
<include name="org/jnativehook/**" />
<exclude name="org/jnativehook/example/**" />
</packageset>
<doctitle><![CDATA[<h1>${ant.project.name} API Documentation</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2006-2013 ${project.vendor}. All Rights Received.</i>]]></bottom>
<!--
<tag name="to.do" scope="all" description="To Do:" />
<tag name="fix.me" scope="all" description="Fix Needed:" />
-->
<link href="http://download.oracle.com/javase/1.5.0/docs/api/" />
</javadoc>
</target>
<target name="package" depends="init,jar,javadoc" description="Creates zip files for distribution.">
<!-- Copy Files To Dist Locations -->
<echo>Creating Distribution Archive...</echo>
<mkdir dir="${dir.dist}" />
<zip destfile="${dir.dist}/${ant.project.name}-${ant.project.version}.zip" level="9">
<zipfileset dir="${dir.doc}" prefix="${ant.project.name}/doc">
<include name="**/*" />
</zipfileset>
<zipfileset dir="${dir.jar}" prefix="${ant.project.name}/jar">
<include name="*.jar" />
</zipfileset>
<zipfileset dir="${dir.src}" prefix="${ant.project.name}/src">
<include name="**/*" />
<exclude name="JNativeHook.iml" />
<exclude name="jni/include/org_jnativehook_GlobalScreen.h" />
<exclude name="jnitasks/" />
<exclude name="libuiohook/" />
</zipfileset>
<zipfileset dir="${basedir}" prefix="${ant.project.name}">
<include name="build.*" />
<include name="*.md" />
</zipfileset>
</zip>
<!-- Increment and write out the build numbers
<propertyfile file="build.num" comment="Build Number for ANT. Do not edit!">
<entry key="ant.build.major" type="int" value="${ant.build.major}" />
<entry key="ant.build.minor" type="int" value="${ant.build.minor}" />
<entry key="ant.build.revision" type="int" value="1" operation="+" />
</propertyfile>
-->
</target>
<target name="all" depends="compile,jar" description="Compile all source files and create the jar library.">
</target>
</project>