forked from yacy/yacy_search_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
706 lines (637 loc) · 29.6 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
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
<project name="YaCy" default="all" basedir=".">
<description>
YaCy - a Peer to Peer Web Search Engine
</description>
<!--
# THIS IS THE YACY BUILD SCRIPT
# YOU CAN USE IT TO COMPILE YOUR OWN RELEASE
# THE TARGET OF THE COMPILATION CAN BE FOUND
# IN THE 'RELEASE' DIRECTORY AFTERWARDS
# YOU NEED APACHE ANT TO USE THIS SCRIPT
# ==========================================
# This Software is Copyrighted
# (C) by Michael Peter Christen; [email protected]
# first published on http://yacy.net
# Frankfurt, Germany, 2005-2009
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program 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 General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<!-- defining the timestamp format -->
<tstamp>
<format property="REPL_DATE_FORMAT" pattern="yyyymmdd" />
</tstamp>
<!-- defining all needed directory names -->
<property name="yacyroot" location="."/>
<property name="addon" location="addon"/>
<property name="src" location="source"/>
<property name="data" location="DATA"/>
<property name="lib" location="lib"/>
<property name="libt" location="libt"/>
<property name="libbuild" location="libbuild"/>
<property name="build" location="classes"/>
<property name="javadoc" location="javadoc"/>
<property name="htroot" location="htroot"/>
<property name="test" location="test/java"/>
<property name="langdetect" location="langdetect"/>
<property name="locales" location="locales"/>
<property name="skins" location="skins"/>
<property name="release" location="RELEASE"/>
<property name="htdocsWWW" location="${data}/HTDOCS/www"/>
<property name="release_main" location="${release}/MAIN"/>
<property name="release_windows" location="${release}/WINDOWS"/>
<property name="release_mac" location="${release}/MAC"/>
<property name="git" location=".git"/>
<property name="defaults" location="defaults"/>
<property name="RDFaParser" location="RDFaParser"/>
<!-- pseudo default branch as fallback -->
<property name="branch" value="" />
<!-- pseudo default releaseNr as fallback -->
<property name="releaseNr" value="9000" />
<!-- defining all needed directory names for packing search widget-->
<property name="jquery" location="htroot/jquery/"/>
<property name="portalsearch" location="htroot/portalsearch/"/>
<property name="img-2" location="htroot/yacy/ui/img-2"/>
<!-- variables for installonlinux target-->
<property name="DESTDIR" value="DESTDIR"/>
<property name="PKGMANAGER" value="false"/>
<property name="RESTARTCMD" value="/etc/init.d/yacy restart"/>
<!-- determining if the .git directory exists -->
<condition property="isGit">
<available file="${git}" />
</condition>
<target name="buildGitRevTask">
<delete file="${libbuild}/GitRevTask.jar" failonerror="false" />
<javac srcdir="${libbuild}/GitRevTask" includeantruntime="true" encoding="UTF-8">
<classpath>
<pathelement location="${libbuild}/org.eclipse.jgit-4.5.0.201609210915-r.jar" />
<!-- Next are the jgit dependencies -->
<pathelement location="${libbuild}/httpclient-4.3.6.jar" />
<pathelement location="${libbuild}/JavaEWAH-0.7.9.jar" />
<pathelement location="${libbuild}/jsch-0.1.53.jar" />
<pathelement location="${libbuild}/slf4j-api-1.7.2.jar" />
</classpath>
</javac>
<jar destfile="${libbuild}/GitRevTask.jar" basedir="${libbuild}/GitRevTask">
<manifest>
<attribute name="Main-Class" value="GitRevTask"/>
</manifest>
</jar>
</target>
<target name="determineGitRevision" if="isGit" depends="buildGitRevTask">
<taskdef resource="GitRevTask.properties">
<classpath>
<pathelement location="${libbuild}/GitRevTask.jar" />
<pathelement location="${libbuild}/org.eclipse.jgit-4.5.0.201609210915-r.jar" />
<!-- Next are the jgit dependencies -->
<pathelement location="${libbuild}/httpclient-4.3.6.jar" />
<pathelement location="${libbuild}/JavaEWAH-0.7.9.jar" />
<pathelement location="${libbuild}/jsch-0.1.53.jar" />
<pathelement location="${libbuild}/slf4j-api-1.7.2.jar" />
</classpath>
</taskdef>
<gitRev repoPath="${yacyroot}" branchprop="branch" revprop="releaseNr" dateprop="DSTAMP" />
</target>
<!-- reading the build properties from file -->
<target name="readBuildProperties" depends="determineGitRevision">
<!-- loading some property values from file -->
<loadproperties srcFile="build.properties" />
</target>
<!-- initializing all needed variables -->
<target name="init" depends="readBuildProperties">
<mkdir dir="${data}"/>
<mkdir dir="${release}"/>
<!-- YaCy Release Date -->
<filter token="REPL_DATE" value="${DSTAMP}"/>
<filter token="REPL_RELEASE" value="${stdReleaseFile}"/>
<!-- YaCy Brach -->
<echo message="YaCy Branch: ${branch}" />
<!-- YaCy Release Version number -->
<echo message="YaCy Version number: ${releaseVersion}" />
<filter token="REPL_VERSION" value="${releaseVersion}" />
<!-- YaCy Release <revision number -->
<echo message="YaCy Release number: ${releaseNr}" />
<filter token="REPL_REVISION_NR" value="${releaseNr}"/>
<!-- YaCy root directory -->
<filter token="REPL_YACY_ROOT_DIR" value="${yacyroot}"/>
<filter token="REPL_PKGMANAGER" value="${PKGMANAGER}"/>
<filter token="REPL_RESTARTCMD" value="${RESTARTCMD}"/>
<!-- apply replacments -->
<delete file="${build}/net/yacy/peers/operation/yacyBuildProperties.java" failonerror="false"/>
<copy file="${src}/net/yacy/peers/operation/yacyBuildProperties.java" tofile="${build}/net/yacy/peers/operation/yacyBuildProperties.java" overwrite="true" filtering="true" />
<!-- copy log4j config file -->
<copy file="${src}/log4j.properties" tofile="${build}/log4j.properties" overwrite="true" filtering="true" />
</target>
<target name="javadoc" depends="init" description="make javadoc for YaCy core">
<javadoc destdir="${javadoc}"
windowtitle="YaCy API: javadoc documentation"
encoding="UTF-8"
charset="UTF-8"
access="private">
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
<!-- define the classpath that should be used for compiling -->
<!-- when changing paths here, please also update the paths in /addon/YaCy.app/Contents/Info.plist -->
<path id="project.class.path">
<pathelement location="${build}" />
<pathelement location="${lib}/org.restlet.jar" />
<pathelement location="${lib}/J7Zip-modified.jar" />
<pathelement location="${lib}/apache-mime4j-0.6.jar" />
<pathelement location="${lib}/avatica-core-1.13.0.jar" />
<pathelement location="${lib}/bcmail-jdk15on-1.69.jar" />
<pathelement location="${lib}/bcpkix-jdk15on-1.69.jar" />
<pathelement location="${lib}/bcprov-jdk15on-1.69.jar" />
<pathelement location="${lib}/calcite-core-1.18.0.jar" />
<pathelement location="${lib}/calcite-linq4j-1.18.0.jar" />
<pathelement location="${lib}/chardet.jar" />
<pathelement location="${lib}/common-image-3.3.2.jar" />
<pathelement location="${lib}/common-io-3.3.2.jar" />
<pathelement location="${lib}/common-lang-3.3.2.jar" />
<pathelement location="${lib}/commons-codec-1.14.jar" />
<pathelement location="${lib}/commons-collections4-4.4.jar" />
<pathelement location="${lib}/commons-compress-1.21.jar" />
<pathelement location="${lib}/commons-fileupload-1.4.jar" />
<pathelement location="${lib}/commons-io-2.7.jar" />
<pathelement location="${lib}/commons-lang-2.6.jar" />
<pathelement location="${lib}/commons-lang3-3.12.0.jar" />
<pathelement location="${lib}/commons-logging-1.2.jar" />
<pathelement location="${lib}/commons-math3-3.4.1.jar" />
<pathelement location="${lib}/fontbox-2.0.15.jar" />
<pathelement location="${lib}/guava-25.1-jre.jar" />
<pathelement location="${lib}/hazelcast-4.2.jar" />
<pathelement location="${lib}/http2-client-9.4.34.v20201102.jar" />
<pathelement location="${lib}/http2-common-9.4.34.v20201102.jar" />
<pathelement location="${lib}/http2-http-client-transport-9.4.34.v20201102.jar" />
<pathelement location="${lib}/httpclient-4.5.12.jar" />
<pathelement location="${lib}/httpcore-4.4.13.jar" />
<pathelement location="${lib}/httpmime-4.5.12.jar" />
<pathelement location="${lib}/icu4j-63.1.jar" />
<pathelement location="${lib}/imageio-bmp-3.3.2.jar" />
<pathelement location="${lib}/imageio-core-3.3.2.jar" />
<pathelement location="${lib}/imageio-metadata-3.3.2.jar" />
<pathelement location="${lib}/imageio-tiff-3.3.2.jar" />
<pathelement location="${lib}/jackson-annotations-2.11.2.jar" />
<pathelement location="${lib}/jackson-core-2.11.2.jar" />
<pathelement location="${lib}/jackson-databind-2.11.2.jar" />
<pathelement location="${lib}/jakarta-oro-2.0.8.jar" />
<pathelement location="${lib}/jaudiotagger-2.2.5.jar" />
<pathelement location="${lib}/javax.servlet-api-3.1.0.jar" />
<pathelement location="${lib}/jcifs-1.3.17.jar" />
<pathelement location="${lib}/jcl-over-slf4j-1.7.25.jar" />
<pathelement location="${lib}/jetty-client-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-continuation-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-deploy-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-http-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-io-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-jmx-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-proxy-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-security-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-server-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-servlet-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-servlets-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-util-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-webapp-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jetty-xml-9.4.35.v20201120.jar" />
<pathelement location="${lib}/jsch-0.1.54.jar" />
<pathelement location="${lib}/json-simple-1.1.1.jar" />
<pathelement location="${lib}/jsonic-1.3.10.jar" />
<pathelement location="${lib}/jsoup-1.12.1.jar" />
<pathelement location="${lib}/jwat-archive-common-1.1.1.jar" />
<pathelement location="${lib}/jwat-common-1.1.1.jar" />
<pathelement location="${lib}/jwat-gzip-1.1.1.jar" />
<pathelement location="${lib}/jwat-warc-1.1.1.jar" />
<pathelement location="${lib}/langdetect.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.25.jar" />
<pathelement location="${lib}/lucene-analyzers-common-8.8.1.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-8.8.1.jar" />
<pathelement location="${lib}/lucene-backward-codecs-8.8.1.jar" />
<pathelement location="${lib}/lucene-classification-8.8.1.jar" />
<pathelement location="${lib}/lucene-codecs-8.8.1.jar" />
<pathelement location="${lib}/lucene-core-8.8.1.jar" />
<pathelement location="${lib}/lucene-grouping-8.8.1.jar" />
<pathelement location="${lib}/lucene-highlighter-8.8.1.jar" />
<pathelement location="${lib}/lucene-join-8.8.1.jar" />
<pathelement location="${lib}/lucene-memory-8.8.1.jar" />
<pathelement location="${lib}/lucene-misc-8.8.1.jar" />
<pathelement location="${lib}/lucene-queries-8.8.1.jar" />
<pathelement location="${lib}/lucene-queryparser-8.8.1.jar" />
<pathelement location="${lib}/lucene-spatial-extras-8.8.1.jar" />
<pathelement location="${lib}/lucene-suggest-8.8.1.jar" />
<pathelement location="${lib}/opentracing-api-0.33.0.jar" />
<pathelement location="${lib}/opentracing-noop-0.33.0.jar" />
<pathelement location="${lib}/opentracing-util-0.33.0.jar" />
<pathelement location="${lib}/metadata-extractor-2.11.0.jar" />
<pathelement location="${lib}/metrics-core-3.2.2.jar" />
<pathelement location="${lib}/metrics-jmx-4.1.5.jar" />
<pathelement location="${lib}/pdfbox-2.0.15.jar" />
<pathelement location="${lib}/poi-3.17.jar" />
<pathelement location="${lib}/poi-scratchpad-3.17.jar" />
<pathelement location="${lib}/rrd4j-3.2.jar" />
<pathelement location="${lib}/slf4j-api-1.7.25.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.25.jar" />
<pathelement location="${lib}/solr-core-8.8.1.jar" />
<pathelement location="${lib}/solr-solrj-8.8.1.jar" />
<pathelement location="${lib}/spatial4j-0.6.jar" />
<pathelement location="${lib}/stax2-api_3.1.4.jar" />
<pathelement location="${lib}/weupnp-0.1.4.jar" />
<pathelement location="${lib}/woodstox-core-asl-4.4.1.jar" />
<pathelement location="${lib}/xml-apis.jar" />
<pathelement location="${lib}/xmpcore-5.1.3.jar" />
<pathelement location="${lib}/xz-1.8.jar" />
<pathelement location="${lib}/zookeeper-3.4.14.jar" />
</path>
<target name="compile-core" depends="init" description="compile YaCy core">
<!-- compile yacyBuildProperties.java -->
<javac srcdir="${build}" destdir="${build}" sourcepath="${src}"
debug="true" debuglevel="lines,vars,source" includeantruntime="false"
includes="net/yacy/peers/operation/yacyBuildProperties.java"
source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
<delete file="${build}/BuildProperties.java" />
<!-- compile the core sources -->
<javac srcdir="${src}/" destdir="${build}"
debug="true" debuglevel="lines,vars,source" includeantruntime="false"
excludes="net/yacy/peers/operation/yacyBuildProperties.java"
source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
<!-- prepare classpath for MANIFEST (manifest cp is relative to jar) -->
<path id="project.classpath.runtime">
<fileset dir="./lib">
<include name="**/*.jar" />
<exclude name="yacycore.jar"/>
</fileset>
</path>
<pathconvert property="manifest.classpath" pathsep=" " refid="project.classpath.runtime">
<flattenmapper/>
</pathconvert>
<!-- make the jacycore jar -->
<jar destfile="${lib}/yacycore.jar" basedir="${build}/">
<manifest>
<attribute name="Main-Class" value="net.yacy.yacy"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
</target>
<target name="compile" depends="compile-core" description="compile YaCy core and YaCy servlets">
<!-- compile htroot, htroot/yacy and htroot/htdocsdefault -->
<javac srcdir="${htroot}/"
excludes="processing/**"
source="${javacSource}" target="${javacTarget}"
debug="true" debuglevel="lines,vars,source" includeantruntime="false" encoding="UTF-8">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="all" depends="compile">
</target>
<target name="copyMain4Dist" depends="compile">
<!-- copy all libs -->
<copy todir="${release_main}/lib">
<fileset dir="${lib}"
includes="**/*"/>
</copy>
<!-- copy build libs -->
<copy todir="${release_main}/libbuild">
<fileset dir="${libbuild}"
includes="**/*"
excludes="**/target/**"/>
</copy>
<!-- copy configuration files -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="yacy.yellow"/>
<include name="yacy.badwords.example"/>
<include name="yacy.stopwords"/>
<include name="yacy.parser"/>
</fileset>
</copy>
<!-- copy defaults -->
<copy todir="${release_main}/defaults">
<fileset dir="${defaults}"
includes="**/*"/>
</copy>
<!-- copy Unix wrappers -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="startYACY.sh"/>
<include name="stopYACY.sh"/>
<include name="killYACY.sh"/>
<include name="updateYACY.sh"/>
<include name="restart.sh"/>
<include name="reconfigureYACY.sh"/>
<include name="startYACY.command"/>
<include name="stopYACY.command"/>
</fileset>
</copy>
<!-- copy other wrappers -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="startYACY.bat"/>
<include name="startYACY_debug.bat"/>
<include name="stopYACY.bat"/>
<include name="getWin32MaxHeap.bat"/>
<include name="installYaCyWindowsService.bat" />
<include name="uninstallYaCyWindowsService.bat" />
</fileset>
</copy>
<!-- copy locales -->
<copy todir="${release_main}/locales">
<fileset dir="${locales}">
<include name="*"/>
</fileset>
</copy>
<!-- copy skins -->
<copy todir="${release_main}/skins">
<fileset dir="${skins}">
<include name="*"/>
</fileset>
</copy>
<!-- copy language statistics files -->
<copy todir="${release_main}/langdetect">
<fileset dir="${langdetect}">
<include name="*"/>
</fileset>
</copy>
<!-- copy documentation -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="readme.txt"/>
<include name="gpl.txt"/>
<include name="ChangeLog"/>
<include name="AUTHORS"/>
<include name="COPYRIGHT"/>
<include name="NOTICE"/>
</fileset>
</copy>
<!-- copy source code -->
<copy todir="${release_main}/source">
<fileset dir="${src}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- copy server pages -->
<copy todir="${release_main}/htroot">
<fileset dir="${htroot}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy add-on's -->
<copy todir="${release_main}/addon">
<fileset dir="${addon}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy development tools -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="build.xml"/>
<include name="build.properties"/>
</fileset>
</copy>
<!-- copy searchtest -->
<copy todir="${release_main}/bin">
<fileset dir="bin">
<include name="**/*.sh"/>
<include name="searchtest*"/>
</fileset>
</copy>
</target>
<!-- run unittests-->
<target name="compileTest" depends="compile" description="run unittests">
<javac srcdir="${test}" destdir="${test}"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<fileset dir="${libt}" includes="**/*.jar" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="test" depends="compileTest" description="run some unittests">
<junit printsummary="yes" haltonfailure="no" fork="true" dir="${yacyroot}">
<formatter type="plain"/>
<batchtest>
<fileset dir="${test}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
<classpath>
<pathelement location="${test}"/>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<fileset dir="${libt}" includes="**/*.jar" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
</junit>
</target>
<!-- =======================================================================================================
making a release file for yacy
======================================================================================================= -->
<target name="dist" depends="copyMain4Dist" description="make for standard YaCy">
<tar destfile="${release}/${stdReleaseFile}" compression="gzip" defaultexcludes="yes" longfile="fail">
<!-- packing all files into a gzipped tar -->
<tarfileset dir="${release_main}" prefix="${releaseFileParentDir}/" dirmode="${accessRightsDir}" mode="${accessRightsExecutable}">
<include name="**/*.sh"/>
<include name="**/*.command"/>
</tarfileset>
<tarfileset dir="${release_main}" prefix="${releaseFileParentDir}/" dirmode="${accessRightsDir}" mode="${accessRightsFile}" >
<include name="**/*"/>
<exclude name="**/*.sh"/>
<exclude name="**/*.command"/>
</tarfileset>
</tar>
<delete dir="${release_main}"/>
<delete dir="${release_windows}" failonerror="false" />
<delete dir="${release}/SPECS" failonerror="false" />
</target>
<!-- packing YaCy search widget for static hosting -->
<target name="portalsearch" description="pack YaCy search widget for static hosting">
<tar destfile="${release}/yacy-portalsearch.tar.gz" compression="gzip" defaultexcludes="yes" longfile="fail">
<tarfileset dir="${portalsearch}" prefix="yacy/portalsearch/">
<include name="*.*"/>
</tarfileset>
<tarfileset dir="${jquery}" prefix="yacy/jquery/">
<include name="**/*"/>
</tarfileset>
<tarfileset dir="${img-2}" prefix="yacy/ui/img-2/">
<include name="magnify.png"/>
<include name="cancel_round.png"/>
<include name="stop.png"/>
</tarfileset>
</tar>
</target>
<!-- make clean -->
<target name="clean" description="make clean">
<delete dir="${release_main}" failonerror="false"/>
<delete file="${build}/net/yacy/peers/operation/yacyBuildProperties.java" failonerror="false"/>
<delete file="${build}/log4j.properties" failonerror="false"/>
<delete file="${lib}/yacycore.jar" failonerror="false"/>
<delete file="${lib}/svnRevNr.jar" failonerror="false"/>
<delete file="${libbuild}/svnRevNr.jar" failonerror="false"/>
<delete file="${libbuild}/GitRevTask.jar" failonerror="false"/>
<delete failonerror="false">
<fileset dir="${src}" includes="**/*.class" />
<fileset dir="${build}" includes="**/*.class" />
<fileset dir="${htroot}" includes="**/*.class" />
<fileset dir="test/" includes="**/*.class" />
<fileset dir="${libbuild}/svnRevNr" includes="**/*.class" />
<fileset dir="${libbuild}/GitRevTask" includes="**/*.class" />
<fileset dir="." includes="TEST-*" />
</delete>
<delete dir="test/DATA" failonerror="false"/>
</target>
<!-- run YaCy (needed for NetBeans4) -->
<target name="run" description="Run YaCy">
<!-- debug options:
java -Xrunhprof:help
Hprof usage: -Xrunhprof[:help]|[:<option>=<value>, ...]
Option Name and Value Description Default
_____________________ ___________ _______
heap=dump|sites|all heap profiling all
cpu=samples|times|old CPU usage off
monitor=y|n monitor contention n
format=a|b ascii or binary output a
file=<file> write data to file java.hprof(.txt for ascii)
net=<host>:<port> send data over a socket write to file
depth=<size> stack trace depth 4
cutoff=<value> output cutoff point 0.0001
lineno=y|n line number in traces? y
thread=y|n thread in traces? n
doe=y|n dump on exit? y
gc_okay=y|n GC okay during sampling y
Example: java -Xrunhprof:cpu=samples,file=log.txt,depth=3 FooClass
Note: format=b cannot be used with cpu=old|times
-->
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<!--<arg value="-Xrunhprof"/>-->
<arg line="-start"/>
<jvmarg line="-Xmx800m"/>
<!-- <arg line="-migratewords"/>-->
<!-- <arg line="-start ${user.dir}"/>-->
</java>
</target>
<!-- run a single file (selected in NetBeans4) -->
<target name="run-single" depends="compile" description="Run Single File">
<fail unless="classname">Must set property 'classname'</fail>
<java classname="net.yacy.yacy" fork="yes">
<classpath refid="run.classpath"/>
<classpath>
<pathelement location="${build}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<arg line=""/>
</java>
</target>
<!-- run YaCy with remote debugging enabled on port 8000 -->
<target name="debug" description="Debug YaCy">
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<arg line="-start"/>
<jvmarg line="-Xdebug"/>
<jvmarg line="-Xnoagent"/>
<jvmarg line="-Djava.compiler=none"/>
<jvmarg line="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
<!-- Dump memory heap when an OutOfMemoryError occurs -->
<!-- <jvmarg line="-XX:+HeapDumpOnOutOfMemoryError"/> -->
<!-- Dump path -->
<!-- <jvmarg line="-XX:HeapDumpPath=/your_path/"/> -->
<!-- Display an error popup when the JVM crashes, allowing to plug a debugger before its termination -->
<!-- <jvmarg line="-XX:+ShowMessageBoxOnError"/> -->
<!-- Log JAXP XML parsers Debug information -->
<!-- <jvmarg line="-Djaxp.debug=1"/> -->
</java>
</target>
<!-- stop YaCy again -->
<target name="stop" description="Stop YaCy">
<java classname="net.yacy.yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<arg line="-stop"/>
</java>
</target>
<!-- create the html-documentation from javadoc -->
<target name="create-doc" description="Create the javadoc-HTML-Pages">
<javadoc destdir="doc/api"
author="true"
version="true"
use="false"
encoding="iso-8859-1"
windowtitle="YaCy API Documentation">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build}"/>
</classpath>
<fileset dir="source" defaultexcludes="yes">
<include name="**/*.java" />
</fileset>
<fileset dir="htroot" defaultexcludes="yes">
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
<target name="distWinInstaller" depends="copyMain4Dist" description="Creates an NSIS Windows installer">
<!-- http://nsisant.sourceforge.net/ -->
<mkdir dir="${release_windows}" />
<copy file="build.nsi" tofile="${release_windows}/build.nsi" overwrite="true" filtering="true" />
<taskdef name="nsis" classname="net.sf.nsisant.Task">
<classpath location="${libbuild}/nsisant-1.2.jar"/>
</taskdef>
<nsis script="${release_windows}/build.nsi" nocd="yes" verbosity="2" />
<move file="${release_windows}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.exe"
tofile="${release}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.exe" />
<delete dir="${release_main}"/>
<delete dir="${release_windows}" failonerror="false" />
</target>
<target name="distMacApp" depends="copyMain4Dist" description="Creates a YaCy.app">
<copy todir="${release_mac}/YaCy.app">
<fileset dir="${addon}/YaCy.app"></fileset>
</copy>
<copy file="${addon}/YaCy.app/Contents/Info.plist" tofile="${release_mac}/YaCy.app/Contents/Info.plist" filtering="true" overwrite="true" />
<move file="${release_main}" tofile="${release_mac}/YaCy.app/Contents/MacOS" verbose="false" />
<!-- startYACY.sh and startYACYMacOS.sh will be the main entry points : we set permissions to make it executable files -->
<chmod file="${release_mac}/YaCy.app/Contents/MacOS/startYACYMacOS.sh" perm="755"/>
<chmod file="${release_mac}/YaCy.app/Contents/MacOS/startYACY.sh" perm="755"/>
<exec executable="hdiutil">
<arg line="create -srcfolder ${release_mac}/YaCy.app ${release}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.dmg"/>
</exec>
<delete dir="${release_mac}" failonerror="false" verbose="false" />
</target>
<target name="deleteData" description="start with a fresh yacy installation">
<delete dir="${data}"/>
</target>
</project>