Project: Apache Solr
Code Location: http://svn.apache.org/repos/asf/lucene/dev/trunk/solr//lucene/dev/trunk/solr
Browse
/
Download File
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
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
<?xml version="1.0"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<project name="solr" default="usage" xmlns:ivy="antlib:org.apache.ivy.ant">
  <description>Solr</description>
  
  <target name="usage" description="Prints out instructions">
    <echo message="Welcome to the Solr project!" />
    <echo message="Use 'ant example' to create a runnable example configuration." />
    <echo message="Use 'ant run-example' to create and run the example." />
    <echo message="And for developers:"/>
    <echo message="Use 'ant clean' to clean compiled files." />
    <echo message="Use 'ant compile' to compile the source code." />
    <echo message="Use 'ant dist' to build the project JAR files." />
    <echo message="Use 'ant documentation' to build documentation." />
    <echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
    <echo message="Use 'ant package' to generate zip, tgz for distribution." />
    <!--<echo message="Use 'ant luke' to start luke.  see: http://luke.googlecode.com" />-->
    <echo message="Use 'ant test' to run unit tests." />
  </target>

  <import file="common-build.xml"/>
  
  <!-- ========================================================================= -->
  <!-- ============================== USER TASKS =============================== -->
  <!-- ========================================================================= -->
 
  <target name="example" description="Creates a runnable example configuration."
          depends="dist-contrib,dist-war">
    <copy file="${dist}/${fullnamever}.war"
          tofile="${example}/webapps/${ant.project.name}.war"/>
    <jar destfile="${example}/exampledocs/post.jar"
         basedir="${dest}/solr-core/classes/java"
         includes="org/apache/solr/util/SimplePostTool*.class">
      <manifest>
        <attribute name="Main-Class" value="org.apache.solr.util.SimplePostTool"/>
      </manifest>
    </jar>
    <delete includeemptydirs="true">
      <fileset dir="${example}/solr-webapp" includes="**/*"/>
    </delete>
    <echo>See ${example}/README.txt for how to run the Solr example configuration.</echo>
  </target>
  
  <target name="run-example" depends="example"
          description="Run Solr interactively, via Jetty.  -Dexample.debug=true to enable JVM debugger">
    <property name="example.solr.home" location="example/solr"/>
    <property name="example.debug.suspend" value="n"/>
    <property name="example.jetty.port" value="8983"/>
    <condition property="example.jvm.line" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${example.debug.suspend},address=5005">
      <isset property="example.debug"/>
    </condition>
    <property name="example.jvm.line" value=""/>
    <property name="example.heap.size" value="512M"/>
    <java jar="${example}/start.jar" fork="true" dir="${example}" maxmemory="${example.heap.size}">
      <jvmarg line="${example.jvm.line}"/>
      <sysproperty key="solr.solr.home" file="${example.solr.home}"/>
      <sysproperty key="jetty.port" value="${example.jetty.port}"/>
    </java>
  </target>
 
  <!-- setup proxy for download tasks -->
  <condition property="proxy.specified">
    <or>
      <isset property="proxy.host"/>
      <isset property="proxy.port"/>
      <isset property="proxy.user"/>
    </or>
  </condition>
 
  <target name="proxy.setup" if="proxy.specified">
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
  </target>

  <!--LUCENE-3286: Luke is incompatible with new XML QP location and target is not flexible
  when it comes to incompatible changes.  Update when Luke has updated.
  <target name="compile-xml-query-parser">
  	<ant dir="${common.dir}/queryparser" target="compile-core" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <property  name="luke.version" value="1.0.1"/>
  <available file="luke/luke-${luke.version}.jar" property="luke.jar.exists" />
  <target name="luke-download" unless="luke.jar.exists" depends="proxy.setup,compile-xml-query-parser">
    <mkdir dir="luke"/>
    <get src="http://luke.googlecode.com/files/luke-${luke.version}.jar"
         dest="luke/luke-${luke.version}.jar"/>
  </target>
  <path id="luke.classpath">
    <pathelement location="${common.dir}/build/core/classes/java" />
    <pathelement location="${common.dir}/queryparser/build/classes/java" />
  </path>
  <target name="luke" depends="luke-download">
    <java fork="true"
          classname="org.getopt.luke.Luke"
          logError="true"
          failonerror="true">
      <classpath>
        <fileset dir="luke">
          <include name="luke-${luke.version}.jar"/>
        </fileset>
        <path refid="classpath"/>
        <path refid="luke.classpath"/>
        <path refid="test.classpath"/>
      </classpath>
    </java>
  </target>-->
  
  <!-- ========================================================================= -->
  <!-- ========================== BUILD/TEST TASKS ============================= -->
  <!-- ========================================================================= -->

  <!-- solr/test-framework is excluded from compilation -->
  <target name="compile" description="Compile the source code."
          depends="compile-core, compile-contrib"/>

  <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
          depends="-init-totals, test-core, test-contrib, -check-totals"/>
  <!-- "-clover.load" is *not* a useless dependency. do not remove -->
  <target name="test-core" description="Runs the core and solrj unit tests."
          depends="-clover.load, test-solr-core, test-solrj"/>
  <target name="pitest" description="Validate, then run core, solrj, and contrib unit tests."
          depends="pitest-core, pitest-contrib"/>
  <target name="compile-test" description="Compile core, solrj, and contrib unit tests, and solr-test-framework."
          depends="compile-solr-test-framework, compile-test-solr-core, compile-test-solrj, compile-test-contrib"/>
  <target name="javadocs" description="Calls javadocs-all, javadocs-solrj, and javadocs-test-framework"
          depends="define-lucene-javadoc-url,javadocs-solr-core,javadocs-solrj,javadocs-test-framework,javadocs-contrib"/>
  <target name="documentation" description="Generate all documentation"
    depends="javadocs,changes-to-html,process-webpages"/>
  <target name="compile-core" depends="compile-solr-core" unless="solr.core.compiled"/>
  
  <target name="process-webpages" depends="define-lucene-javadoc-url,resolve-groovy,resolve-pegdown">
    <makeurl property="process-webpages.buildfiles" separator="|">
      <fileset dir="." includes="core/build.xml,test-framework/build.xml,solrj/build.xml,contrib/**/build.xml"/>
    </makeurl>
    <!--
      The XSL input file is ignored completely, but XSL expects one to be given,
      so we pass ourself (${ant.file}) here. The list of module build.xmls is given
      via string parameter, that must be splitted by the XSL at '|'.
    --> 
    <xslt in="${ant.file}" out="${javadoc.dir}/index.html" style="site/xsl/index.xsl" force="true">
      <outputproperty name="method" value="html"/>
      <outputproperty name="version" value="4.0"/>
      <outputproperty name="encoding" value="UTF-8"/>
      <outputproperty name="indent" value="yes"/>
      <param name="buildfiles" expression="${process-webpages.buildfiles}"/>
      <param name="version" expression="${version}"/>
      <param name="luceneJavadocUrl" expression="${lucene.javadoc.url}"/>
    </xslt>
    
    <pegdown todir="${javadoc.dir}">
      <fileset dir="." includes="SYSTEM_REQUIREMENTS.txt"/>
      <globmapper from="*.txt" to="*.html"/>
    </pegdown>

    <copy todir="${javadoc.dir}">
      <fileset dir="site/html" includes="**/*"/>
    </copy>
  </target>

  <target name="jar" depends="jar-core,jar-solrj,jar-solr-test-framework,jar-contrib"
          description="Jar solr core, solrj, solr-test-framework, and all contribs"/>

  <target name="jar-src" 
          description="Create source jars for solr core, solrj, solr-test-framework, and all contribs">
    <ant dir="core" target="jar-src" inheritAll="false"/>
    <ant dir="solrj" target="jar-src" inheritAll="false"/>
    <ant dir="test-framework" target="jar-src" inheritAll="false"/>
    <contrib-crawl target="jar-src"/>
  </target>

  <!-- Solr core targets -->
  <target name="test-solr-core" description="Test solr core">
    <ant dir="core" target="test" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <target name="jar-core">
    <ant dir="${common-solr.dir}/core" target="jar-core" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>
  
  <!-- Solrj targets -->
  <target name="test-solrj" description="Test java client">
    <ant dir="solrj" target="test" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <!-- Solr contrib targets -->
  <target name="test-contrib" description="Run contrib unit tests.">
    <contrib-crawl target="test" failonerror="true"/>
  </target>

  <!-- Pitest targets -->
  <target name="pitest-core" description="PiTest solr core">
    <ant dir="core" target="pitest" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <target name="pitest-solrj" description="PiTest java client">
    <ant dir="solrj" target="pitest" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <target name="pitest-contrib" description="Run contrib PiTests.">
    <contrib-crawl target="pitest" failonerror="false"/>
  </target>
  
  <!-- test-framework targets -->
  <target name="javadocs-test-framework">
    <ant dir="test-framework" target="javadocs" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>
    
  <!-- Validation (license/notice/api checks). -->
  <target name="validate" depends="check-example-lucene-match-version,check-licenses,rat-sources,check-forbidden-apis" description="Validate stuff." />

  <target name="check-example-lucene-match-version">
    <fail message="Some example solrconfig.xml files do not refer to the correct luceneMatchVersion: ${tests.luceneMatchVersion}">
      <condition>
        <resourcecount when="greater" count="0">
          <fileset dir="${example}" includes="**/solrconfig.xml">
            <not>
              <contains text="&lt;luceneMatchVersion&gt;${tests.luceneMatchVersion}&lt;" casesensitive="no"/>
            </not>
          </fileset>
        </resourcecount>
      </condition>
    </fail>
  </target>

  <target name="check-licenses" depends="compile-tools,resolve,load-custom-tasks" description="Validate license stuff.">
    <license-check-macro dir="${basedir}" licensedir="${common-solr.dir}/licenses">
      <additional-excludes>
        <!-- Exclude start.jar only (it'd be weird to have a license file there?) -->
        <exclude name="example/start.jar" />
        <exclude name="example/exampledocs/post.jar" />
        <exclude name="example/solr-webapp/**" />
        <exclude name="package/**"/>
      </additional-excludes>
      <additional-filters>
        <replaceregex pattern="jetty([^/]+)$" replace="jetty" flags="gi" />
        <replaceregex pattern="slf4j-([^/]+)$" replace="slf4j" flags="gi" />
        <replaceregex pattern="(bcmail|bcprov)-([^/]+)$" replace="\1" flags="gi" />
      </additional-filters>
    </license-check-macro>
  </target>
  
  <target name="check-forbidden-apis" depends="-install-forbidden-apis" description="Check forbidden API calls in compiled class files.">
    <subant target="check-forbidden-apis" inheritall="false" >
      <propertyset refid="uptodate.and.compiled.properties"/>
      <fileset dir="core" includes="build.xml"/>
      <fileset dir="solrj" includes="build.xml"/>
      <fileset dir="test-framework" includes="build.xml"/>
    </subant>
    <contrib-crawl target="check-forbidden-apis" failonerror="true"/>
  </target>

  <!-- rat sources -->
  <!-- rat-sources-typedef is *not* a useless dependency. do not remove -->
  <target name="rat-sources" depends="rat-sources-typedef,common.rat-sources">
    <subant target="rat-sources" inheritall="false" >
      <propertyset refid="uptodate.and.compiled.properties"/>
      <fileset dir="core" includes="build.xml"/>
      <fileset dir="solrj" includes="build.xml"/>
      <fileset dir="test-framework" includes="build.xml"/>
      <fileset dir="webapp" includes="build.xml"/>
    </subant>
    <contrib-crawl target="rat-sources" failonerror="true"/>
  </target>
  
  <!-- Clean targets -->
  <target name="clean" description="Cleans compiled files and other temporary artifacts.">
    <delete dir="build" />
    <delete dir="dist" />
    <delete dir="package" />
    <delete dir="example/solr/lib" />
    <delete includeemptydirs="true">
      <fileset dir="example">
        <include name="**/data/**/*" />
        <include name="webapps/**/*" />
        <include name="solr-webapp/**/*" />
        <exclude name="**/.gitignore" />
      </fileset>
    </delete>
  </target>
  
  <target name="clean-dest"
          description="Cleans out build/ but leaves build/docs/, dist/ and package/ alone.  This allows us to run nightly and clover together in Hudson">
    <delete includeemptydirs="true" >
      <fileset dir="build">
        <exclude name="docs/"/>
      </fileset>
    </delete>
  </target>

  <!-- ========================================================================= -->
  <!-- ===================== DISTRIBUTION-RELATED TASKS ======================== -->
  <!-- ========================================================================= -->
 
  <target name="copy-to-stage">
    <copy-to-stage-macro artifacts.dir="${package.dir}"/>
  </target>
  
  <target name="dist"
          description="Creates the Solr distribution files."
          depends="dist-solrj, dist-core, dist-test-framework, dist-contrib, dist-war" />
 
  <target name="dist-test-framework" depends="init-dist"
          description="Creates the Solr test-framework JAR.">
    <ant dir="test-framework" target="dist" inheritall="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>
  
  <target name="dist-contrib" depends="init-dist"
          description="Make the contribs ready for distribution">
    <contrib-crawl target="dist" failonerror="true" />
  </target>
  
  <target name="dist-war"
          description="Creates the Solr WAR Distribution file.">
    <ant dir="webapp" target="dist" inheritall="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>
  
  <target name="prepare-release-no-sign" depends="clean, package, generate-maven-artifacts"/>
  <target name="prepare-release" depends="prepare-release-no-sign, sign-artifacts"/>
 
  <!-- make a distribution -->
  <target name="package" depends="package-src-tgz,create-package,-dist-changes,-dist-keys"/>

  <!-- copy changes/ to the release folder -->
  <target name="-dist-changes">
   <copy todir="${package.dir}/changes">
     <fileset dir="build/docs/changes"/>
   </copy>
  </target>

  <!-- copy KEYS to the release folder -->
  <target name="-dist-keys">
   <get src="http://people.apache.org/keys/group/lucene.asc" 
        dest="${package.dir}/KEYS"/>
  </target>
 
  <!-- Makes a tarball from running "svn export" at the root level.    -->
  <!-- Copies NOTICE.txt and LICENSE.txt from solr/ to the root level. -->
  <target name="package-src-tgz" depends="init-dist"
          description="Packages the Solr Source Distribution">
    <property name="source.package.file"
              value="${package.dir}/${fullnamever}-src.tgz"/>
    <delete file="${source.package.file}" failonerror="false" />
    <svn-export-source source.dir=".."/>

    <!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->
    <delete dir="${svn.export.dir}/lucene/tools/javadoc/java7"/>
    <!-- Exclude clover license files incompatible with the ASL -->
    <delete dir="${svn.export.dir}/lucene/tools/clover"/>

    <build-changes changes.src.file="${svn.export.dir}/solr/CHANGES.txt"
                   changes.target.dir="${svn.export.dir}/solr/docs/changes"
                   changes.product="SOLR"/>

    <tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
      <tarfileset dir="${svn.export.dir}"
                  prefix="${fullnamever}"
                  excludes="solr/example/**/*.sh solr/example/**/bin/ solr/scripts/**"/>
      <tarfileset dir="${svn.export.dir}"
                  prefix="${fullnamever}"
                  filemode="755"
                  includes="solr/example/**/*.sh solr/example/**/bin/ solr/scripts/**"/>
      <tarfileset dir="${svn.export.dir}/solr" prefix="${fullnamever}"
                  includes="NOTICE.txt,LICENSE.txt"/>
    </tar>
    <make-checksums file="${source.package.file}"/>
  </target>
 
  <target name="package-local-src-tgz"
          description="Packages the Solr and Lucene sources from the local working copy">
    <mkdir dir="${common-solr.dir}/build"/>
    <property name="source.package.file"
              value="${common-solr.dir}/build/${fullnamever}-src.tgz"/>
    <delete file="${source.package.file}" failonerror="false" />

    <!-- includes/excludes requires a relative path -->
    <property name="dist.rel" location="${dist}" relative="yes"/>
    <property name="package.dir.rel" location="${package.dir}" relative="yes"/>

    <tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
      <tarfileset dir=".." prefix="${fullnamever}" includes="*.txt *.xml dev-tools/" />
      <tarfileset dir="." prefix="${fullnamever}" includes="LICENSE.txt NOTICE.txt"/>
      <tarfileset dir="." prefix="${fullnamever}/solr"
                  excludes="build/** ${package.dir.rel}/** ${dist.rel}/**
                            example/webapps/*.war example/lib/**
                            **/*.jar 
                            lib/README.committers.txt **/data/ **/logs/*
                            **/*.sh **/bin/ scripts/ 
                            .idea/ **/*.iml **/pom.xml" />
      <tarfileset dir="." prefix="${fullnamever}/solr"
                  includes="core/src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
      <tarfileset dir="." filemode="755" prefix="${fullnamever}/solr"
                  includes="**/*.sh **/bin/ scripts/"
                  excludes="build/**"/>
      <tarfileset dir="../lucene" prefix="${fullnamever}/lucene">
        <patternset refid="lucene.local.src.package.patterns"/>
      </tarfileset>
    </tar>
  </target>

  <target name="create-package"
          description="Packages the Solr Binary Distribution">
    <antcall inheritall="true">
      <param name="called.from.create-package" value="true"/>
      <target name="init-dist"/>
      <target name="dist"/>
      <target name="example"/>
      <target name="documentation"/>
    </antcall>
    <mkdir dir="${dest}/${fullnamever}"/>
    <delete includeemptydirs="true">
      <fileset dir="${example}/solr-webapp" includes="**/*"/>
      <fileset dir="${dest}/${fullnamever}" includes="**/*"/>
    </delete>
 
    <delete file="${package.dir}/${fullnamever}.tgz" failonerror="false" />
    <delete file="${package.dir}/${fullnamever}.zip" failonerror="false" />
 
    <mkdir dir="${dest}/contrib-lucene-libs-to-package"/>
    <delete dir="${dest}/contrib-lucene-libs-to-package" includes="**/*"/>
    <contrib-crawl target="add-lucene-libs-to-package"/>
 
    <tar destfile="${package.dir}/${fullnamever}.tgz" compression="gzip" longfile="gnu">
      <tarfileset dir="."
                  prefix="${fullnamever}"
                  includes="LICENSE.txt NOTICE.txt CHANGES.txt README.txt SYSTEM_REQUIREMENTS.txt
                            example/** contrib/**/lib/** contrib/**/README.txt 
                            licenses/**"
                  excludes="licenses/README.committers.txt **/data/ **/logs/* 
                            **/classes/ **/*.sh **/ivy.xml **/build.xml
                            **/bin/ **/*.iml **/*.ipr **/*.iws **/pom.xml 
                            **/*pom.xml.template" />
      <tarfileset dir="${dest}/contrib-lucene-libs-to-package"
                  prefix="${fullnamever}"
                  includes="**" />
      <tarfileset dir="."
                  filemode="755"
                  prefix="${fullnamever}"
                  includes="example/**/*.sh example/**/bin/" />
      <tarfileset dir="."
                  prefix="${fullnamever}"
                  includes="dist/*.jar
                            dist/solrj-lib/*
                            dist/test-framework/**"
                  excludes="**/*.tgz **/*.zip **/*.md5 **/*src*.jar **/*docs*.jar **/*.sha1" />
      <tarfileset dir="${javadoc.dir}"
                  prefix="${fullnamever}/docs" />
    </tar>
    <make-checksums file="${package.dir}/${fullnamever}.tgz"/>
 
    <untar compression="gzip" src="${package.dir}/${fullnamever}.tgz" dest="${dest}"/>
 
    <!--
        This is a list of text file patterns to convert to CRLF line-ending style.
        Shell scripts and files included in shell scripts should not be converted.
        NB: The line-ending conversion process will mangle non-UTF8-encoded files.
       -->
    <fixcrlf srcdir="${dest}/${fullnamever}"
             encoding="UTF-8"
             eol="crlf"
             includes="**/*.alg **/*.cfg **/*.cgi **/*.cpp **/*.css **/*.csv **/*.dtd
                        **/*.erb **/*.fcgi **/.htaccess **/*.htm **/*.html **/*.incl
                        **/*.java **/*.javacc **/*.jflex **/*.jflex-macro **/*.jj
                        **/*.js **/*.json **/*.jsp **/*LICENSE **/package-list **/*.pl
                        **/*.pom **/*pom.xml.template **/*.properties **/*.py
                        **/*.rake **/Rakefile **/*.rb **/*.rbbi **/README* **/*.rhtml
                        **/*.rslp **/*.rxml **/*.script **/*.svg **/*.tsv **/*.txt
                        **/UPGRADING **/USAGE **/*.uxf **/*.vm **/*.xcat **/*.xml
                        **/*.xsl **/*.xslt **/*.yml"
             excludes="**/stopwordsWrongEncoding.txt **/gb18030-example.xml"
        />
 
    <zip destfile="${package.dir}/${fullnamever}.zip">
      <zipfileset dir="${dest}/${fullnamever}"
                  prefix="${fullnamever}"
                  excludes="**/*.sh **/bin/ src/scripts/" />
      <zipfileset dir="${dest}/${fullnamever}"
                  prefix="${fullnamever}"
                  includes="**/*.sh **/bin/ src/scripts/"
                  filemode="755" />
    </zip>
    <make-checksums file="${package.dir}/${fullnamever}.zip"/>
  </target>

  <target name="changes-to-html">
    <build-changes changes.product="SOLR"/>
  </target>
 
  <target name="sign-artifacts">
    <sign-artifacts-macro artifacts.dir="${package.dir}"/>
  </target>
 
  <target name="resolve" depends="resolve-example">
     <sequential>
     <ant dir="core" target="resolve" inheritall="false">
         <propertyset refid="uptodate.and.compiled.properties"/>
      </ant>
     <ant dir="solrj" target="resolve" inheritall="false">
         <propertyset refid="uptodate.and.compiled.properties"/>
      </ant>
     <ant dir="test-framework" target="resolve" inheritall="false">
         <propertyset refid="uptodate.and.compiled.properties"/>
      </ant>
     <contrib-crawl target="resolve"/>
    </sequential>
  </target>

  <target name="documentation-lint" depends="-ecj-javadoc-lint,-documentation-lint-unsupported" if="documentation-lint.supported"
          description="Validates the generated documentation (HTML errors, broken links,...)">
    <!-- we use antcall here, otherwise ANT will run all dependent targets: -->
    <antcall target="-documentation-lint"/>
  </target>

  <!-- TODO: does solr have any other docs we should check? -->
  <!-- TODO: also integrate checkJavaDocs.py, which does more checks -->
  <target name="-documentation-lint" depends="documentation">
    <jtidy-macro>
       <!-- NOTE: must currently exclude deprecated-list due to a javadocs bug (as of 1.7.0_09)
            javadocs generates invalid XML if you deprecate a method that takes a parameter
            with a generic type -->
      <fileset dir="build/docs" includes="**/*.html" excludes="**/deprecated-list.html"/>
    </jtidy-macro>
    <echo message="Checking for broken links..."/>
    <check-broken-links dir="${javadoc.dir}"/>
    <echo message="Checking for malformed docs..."/>
    <!-- TODO: add missing docs for all classes and bump this to level=class -->
    <check-missing-javadocs dir="${javadoc.dir}" level="package"/>
  </target>
 
  <target name="-ecj-javadoc-lint" depends="compile,compile-test,jar-test-framework,-ecj-javadoc-lint-unsupported,-ecj-resolve" if="ecj-javadoc-lint.supported">
    <subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
      <fileset dir="core" includes="build.xml"/>
      <fileset dir="solrj" includes="build.xml"/>
      <fileset dir="test-framework" includes="build.xml"/>
    </subant>
    <contrib-crawl target="-ecj-javadoc-lint"/>
  </target>

  <!-- define-lucene-javadoc-url is *not* a useless dependencies. Do not remove! -->
  <target name="-dist-maven" depends="install-maven-tasks,define-lucene-javadoc-url">
    <sequential>
      <m2-deploy pom.xml="${filtered.pom.templates.dir}/solr/pom.xml"/>    <!-- Solr parent POM -->
      <subant target="-dist-maven" inheritall="false" >
        <propertyset refid="uptodate.and.compiled.properties"/>
        <fileset dir="core" includes="build.xml"/>
        <fileset dir="solrj" includes="build.xml"/>
        <fileset dir="test-framework" includes="build.xml"/>
        <fileset dir="webapp" includes="build.xml"/>
      </subant>
      <contrib-crawl target="-dist-maven"/>
    </sequential>
  </target>
  
  <target name="generate-maven-artifacts" depends="-unpack-solr-tgz">
    <sequential>
      <ant dir=".." target="resolve" inheritall="false"/>
      <antcall target="-filter-pom-templates" inheritall="false"/>
      <antcall target="-dist-maven" inheritall="false">
        <propertyset refid="uptodate.and.compiled.properties"/>
      </antcall>
    </sequential>
  </target>
 
  <target name="-validate-maven-dependencies" depends="compile-tools, install-maven-tasks, load-custom-tasks">
    <sequential>
      <subant target="-validate-maven-dependencies" failonerror="true" inheritall="false">
        <propertyset refid="uptodate.and.compiled.properties"/>
        <fileset dir="core" includes="build.xml"/>
        <fileset dir="solrj" includes="build.xml"/>
        <fileset dir="test-framework" includes="build.xml"/>
        <fileset dir="webapp" includes="build.xml"/>
      </subant>
      <contrib-crawl target="-validate-maven-dependencies"/>
    </sequential>
  </target>
	 
  <!-- ========================================================================= -->
  <!-- ========================= COMMITTERS' HELPERS =========================== -->
  <!-- ========================================================================= -->
  
  <property name="analysis-common.res.dir"  value="../lucene/analysis/common/src/resources/org/apache/lucene/analysis"/>
  <property name="analysis-kuromoji.res.dir"  value="../lucene/analysis/kuromoji/src/resources/org/apache/lucene/analysis"/>
  <property name="analysis.conf.dest" value="${example}/solr/collection1/conf/lang"/>

  <target name="sync-analyzers"
          description="Committers' Helper: synchronizes analysis resources (e.g. stoplists) to the example">
    <!-- arabic -->
    <copy verbose="true" file="${analysis-common.res.dir}/ar/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_ar.txt"/>
    <!-- bulgarian -->
    <copy verbose="true" file="${analysis-common.res.dir}/bg/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_bg.txt"/>
    <!-- catalan -->
    <copy verbose="true" file="${analysis-common.res.dir}/ca/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_ca.txt"/>
    <!-- kurdish -->
    <copy verbose="true" file="${analysis-common.res.dir}/ckb/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_ckb.txt"/>
    <!-- czech -->
    <copy verbose="true" file="${analysis-common.res.dir}/cz/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_cz.txt"/>
    <!-- danish -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/danish_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_da.txt"/>
    <!-- german -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/german_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_de.txt"/>
    <!-- greek -->
    <copy verbose="true" file="${analysis-common.res.dir}/el/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_el.txt"/>
    <!-- spanish -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/spanish_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_es.txt"/>
  	<!-- basque -->
    <copy verbose="true" file="${analysis-common.res.dir}/eu/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_eu.txt"/>
  	<!-- persian -->
    <copy verbose="true" file="${analysis-common.res.dir}/fa/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_fa.txt"/>
  	<!-- finnish -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/finnish_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_fi.txt"/>
  	<!-- french -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/french_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_fr.txt"/>
        <!-- irish -->
    <copy verbose="true" file="${analysis-common.res.dir}/ga/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_ga.txt"/>
  	<!-- galician -->
    <copy verbose="true" file="${analysis-common.res.dir}/gl/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_gl.txt"/>
  	<!-- hindi -->
    <copy verbose="true" file="${analysis-common.res.dir}/hi/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_hi.txt"/>
  	<!-- hungarian -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/hungarian_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_hu.txt"/>
  	<!-- armenian -->
    <copy verbose="true" file="${analysis-common.res.dir}/hy/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_hy.txt"/>
  	<!-- indonesian -->
    <copy verbose="true" file="${analysis-common.res.dir}/id/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_id.txt"/>
  	<!-- italian -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/italian_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_it.txt"/>
    <!-- japanese -->
    <copy verbose="true" file="${analysis-kuromoji.res.dir}/ja/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_ja.txt"/>
    <copy verbose="true" file="${analysis-kuromoji.res.dir}/ja/stoptags.txt"
                         tofile="${analysis.conf.dest}/stoptags_ja.txt"/>
  	<!-- latvian -->
    <copy verbose="true" file="${analysis-common.res.dir}/lv/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_lv.txt"/>
  	<!-- dutch -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/dutch_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_nl.txt"/>
  	<!-- norwegian -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/norwegian_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_no.txt"/>
  	<!-- portuguese -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/portuguese_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_pt.txt"/>
  	<!-- romanian -->
    <copy verbose="true" file="${analysis-common.res.dir}/ro/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_ro.txt"/>
  	<!-- russian -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/russian_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_ru.txt"/>
  	<!-- swedish -->
    <copy verbose="true" file="${analysis-common.res.dir}/snowball/swedish_stop.txt"
                         tofile="${analysis.conf.dest}/stopwords_sv.txt"/>
  	<!-- thai -->
    <copy verbose="true" file="${analysis-common.res.dir}/th/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_th.txt"/>
  	<!-- turkish -->
    <copy verbose="true" file="${analysis-common.res.dir}/tr/stopwords.txt"
                         tofile="${analysis.conf.dest}/stopwords_tr.txt"/>
  </target>

  <target name="jar-checksums" depends="resolve">
    <jar-checksum-macro srcdir="${common-solr.dir}" dstdir="${common-solr.dir}/licenses"/>
  </target>

  <target name="-append-module-dependencies-properties">
    <ant dir="core" target="-append-module-dependencies-properties" inheritAll="false"/>
    <ant dir="solrj" target="-append-module-dependencies-properties" inheritAll="false"/>
    <ant dir="test-framework" target="-append-module-dependencies-properties" inheritAll="false"/>
    <contrib-crawl target="-append-module-dependencies-properties"/>
  </target>
</project>