forked from broadinstitute/picard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·565 lines (517 loc) · 28.1 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
<?xml version="1.0"?>
<!--
~ The MIT License
~
~ Copyright (c) 2009 The Broad Institute
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->
<project name="picard-public" basedir="." default="all">
<property name="src" value="src/java"/>
<property name="src.scripts" value="src/scripts"/>
<property name="src.test" value="src/tests"/>
<property name="src.test.java" value="${src.test}/java"/>
<property name="src.www" value="src/www"/>
<property name="lib" value="lib"/>
<property name="dist" value="dist"/>
<property name="dist.tmp" value="dist/tmp"/>
<property name="classes" value="classes"/>
<property name="classes.test" value="testclasses"/>
<property name="scripts" value="src/scripts"/>
<property name="reports" value="dist/test"/>
<property name="test.output" value="dist/test"/>
<property name="htsjdk_lib_dir" value="${dist}/htsjdk_lib_dir"/>
<property name="htsjdk_git_url" value="[email protected]:samtools/htsjdk.git"/>
<!-- TODO: get this from the build.xml in htsjdk -->
<property name="htsjdk-classes" value="htsjdk/classes"/>
<property name="javac.target" value="1.6"/>
<property name="javac.debug" value="true"/>
<!-- Get GIT hash, if available, otherwise leave it blank. -->
<exec executable="git" outputproperty="repository.revision" failifexecutionfails="true" errorproperty="">
<arg value="log"/>
<arg value="-1"/>
<arg value="--pretty=format:%H_%at"/>
</exec>
<property name="repository.revision" value=""/>
<property name="picard-version" value="1.140"/>
<property name="command-line-html-dir" value="${dist}/html"/>
<property name="testng.verbosity" value="2"/>
<property name="test.debug.port" value="5005"/>
<!-- override on the command line if desired -->
<property environment="env"/>
<property name="htsjdk" value="htsjdk"/>
<property name="htsjdk_src" value="${htsjdk}/src/java"/>
<property name="jar_opt" value=".jar_opt"/>
<condition property="isUnix">
<os family="unix"/>
</condition>
<target name="set_excluded_test_groups_unix" if="isUnix">
<property name="excludedTestGroups" value="slow, broken"/>
</target>
<target name="set_excluded_test_groups_non_unix" unless="isUnix">
<property name="excludedTestGroups" value="slow, broken, unix"/>
</target>
<target name="set_excluded_test_groups" depends="set_excluded_test_groups_unix,set_excluded_test_groups_non_unix"/>
<!-- INIT -->
<target name="init">
<path id="classpath">
<fileset dir="${htsjdk_lib_dir}">
<include name="*.jar"/>
<include name="**/*.jar"/>
</fileset>
<!-- for the specific HTSJDK library JARs -->
<fileset dir="${htsjdk}/lib">
<include name="*.jar"/>
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="metrics.classpath">
<pathelement path="${classpath}"/>
<pathelement location="${classes}"/>
<pathelement location="${htsjdk}/classes"/>
</path>
</target>
<!-- CLEAN -->
<target name="clean-local" description="Delete local build products but not nested project" depends="clean-jar-opt">
<delete dir="${classes}"/>
<delete dir="${classes.test}"/>
<delete dir="${test.output}"/>
<delete dir="${dist}"/>
<delete dir="javadoc"/>
</target>
<target name="clean" description="Clean local build products and also nested project" depends="clean-local, clean-htsjdk"/>
<!-- HTS-JDK -->
<target name="set-htsjdk-version">
<!-- set the htsjdk version -->
<ant antfile="build.xml" dir="${htsjdk}" target="write-version-property" inheritall="false"/>
<loadfile property="htsjdk-version" srcFile="${htsjdk}/htsjdk.version.properties">
<filterchain>
<linecontains>
<contains value="htsjdk-version="/>
</linecontains>
<tokenfilter>
<replacestring from="htsjdk-version=" to=""/>
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
</target>
<target name="clone-htsjdk" description="Clone HTS-JDK sources from Sourceforge">
<exec executable="git" failonerror="true">
<arg value="clone"/>
<arg value="${htsjdk_git_url}"/>
<arg value="${htsjdk}"/>
</exec>
</target>
<target name="compile-htsjdk" depends="set-htsjdk-version" description="Build HTS-JDK, and grab build jars">
<ant antfile="build.xml" dir="${htsjdk}" target="clean" inheritall="false"/>
<ant antfile="build.xml" dir="${htsjdk}" target="all" inheritall="false"/>
<copy todir="${htsjdk_lib_dir}">
<fileset dir="${htsjdk}/dist" includes="**/*-*.jar"/>
<fileset dir="${htsjdk}/lib" includes="*.jar"/>
</copy>
<copy todir="${dist}">
<fileset dir="${htsjdk}/dist" includes="**/*.jar" excludes="**/*-*.jar"/>
</copy>
<!-- set the htsjdk version -->
<ant antfile="build.xml" dir="${htsjdk}" target="write-version-property" inheritall="false"/>
</target>
<target name="clean-htsjdk" description="Clean HTS-JDK">
<ant antfile="build.xml" dir="${htsjdk}" target="clean" inheritall="false"/>
</target>
<target name="test-htsjdk" description="Test HTS-JDK">
<ant antfile="build.xml" dir="${htsjdk}" target="test" inheritall="false"/>
</target>
<target name="compile-htsjdk-tests" description="Compile HTS-JDK Tests">
<ant antfile="build.xml" dir="${htsjdk}" target="compile-tests" inheritall="false"/>
</target>
<!-- COMPILE -->
<target name="compile" depends="compile-src, compile-tests"
description="Compile files without cleaning">
</target>
<target name="compile-src" depends="compile-htsjdk, compile-picard" description="Compile files without cleaning"/>
<target name="compile-picard" depends="init" description="Compile picard files without cleaning">
<compile-src includes="picard/**/*.*" />
</target>
<target name="compile-tests" depends="compile-htsjdk-tests, compile-picard-tests" description="Compile test files without cleaning"/>
<target name="compile-picard-tests" depends="init" description="Compile picard test files without cleaning">
<compile-tests includes="picard/**/*.*"/>
<copy todir="${classes.test}/">
<fileset dir="${src.test}/scripts" includes="**/*"/>
</copy>
</target>
<target name="build-timestamp">
<tstamp>
<format property="build.timestamp" pattern="yyyy.MM.dd hh.mm.ss" locale="en,US"/>
</tstamp>
<replace dir="${command-line-html-dir}" token="@builddate@" value="${build.timestamp}">
<include name="**/*.html"/>
</replace>
</target>
<!-- TEST -->
<target name="test" depends="compile, set_excluded_test_groups" description="Run unit tests">
<taskdef resource="testngtasks" classpathref="classpath"/>
<testng suitename="picard-tests" classpathref="classpath" outputdir="${test.output}"
failureproperty="tests.failed" excludedgroups="${excludedTestGroups}" workingDir="${basedir}"
verbose="${testng.verbosity}">
<classpath>
<pathelement path="${classes}"/>
<pathelement path="${classes.test}"/>
<pathelement path="${scripts}"/>
</classpath>
<classfileset dir="${classes.test}">
<include name="**/Test*.class"/>
<include name="**/*Test.class"/>
</classfileset>
<jvmarg value="-Xmx2G"/>
</testng>
<junitreport todir="${dist}/test">
<fileset dir="${test.output}">
<include name="*.xml"/>
</fileset>
<report format="noframes" todir="${dist}/test" styledir="etc/test"/>
</junitreport>
<copy file="etc/test/testng.css" todir="${dist}/test" overwrite="true"/>
<fail if="tests.failed" message="There were failed unit tests"/>
</target>
<target name="single-test"
depends="compile, compile-tests"
description="Compile and run a single test.">
<taskdef resource="testngtasks" classpathref="classpath"/>
<fail unless="name" message="Please provide input test: -Dname=..."/>
<condition property="debug.jvm.args" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${test.debug.port}"
else="">
<isset property="test.debug"/>
</condition>
<testng suitename="picard-single-test" classpathref="classpath" outputdir="${test.output}"
verbose="${testng.verbosity}">
<jvmarg line="-Xmx512M ${debug.jvm.args}"/>
<classpath>
<pathelement path="${classes}"/>
<pathelement path="${classes.test}"/>
<pathelement path="${scripts}"/>
</classpath>
<classfileset dir="${classes.test}">
<include name="**/${name}.class"/>
</classfileset>
</testng>
</target>
<target name="process-external-jars" depends="clean-jar-opt, maybe-add-gatk-tools-java">
</target>
<target name="clean-jar-opt">
<delete dir="${jar_opt}"/>
<mkdir dir="${jar_opt}"/>
</target>
<target name="maybe-add-gatk-tools-java" if="addGATKToolsJava">
<mkdir dir="${jar_opt}"/>
<unzip dest="${jar_opt}">
<fileset dir="${lib}/gatk-tools-java">
<include name="*.jar"/>
</fileset>
</unzip>
</target>
<target name="picard-jar" depends="compile, process-external-jars"
description="Builds the main executable picard.jar">
<mkdir dir="${dist}"/>
<mkdir dir="${dist.tmp}"/>
<unjar dest="${dist.tmp}">
<fileset dir="${lib}" />
<fileset dir="${htsjdk_lib_dir}">
<include name="*.jar"/>
</fileset>
</unjar>
<jar destfile="${dist}/picard.jar" compress="no">
<fileset dir="${classes}" includes="picard/**/*.*, META-INF/**/*"/>
<fileset dir="${src.scripts}" includes="**/*.R"/>
<fileset dir="${htsjdk-classes}" includes ="${htsjdk}/*/**/*.*"/>
<fileset dir="${dist.tmp}" includes="**/*"/>
<fileset dir="${jar_opt}" includes="**/*"/>
<manifest>
<attribute name="Implementation-Version" value="${picard-version}(${repository.revision})"/>
<attribute name="Implementation-Vendor" value="Broad Institute"/>
<attribute name="Main-Class" value="picard.cmdline.PicardCommandLine"/>
<attribute name="Implementation-Title" value="PICARD Tools"/>
<attribute name="HTSJDK-Version" value="${htsjdk-version}"/>
</manifest>
</jar>
<delete dir="${dist.tmp}"/>
</target>
<target name="picard-lib-jar" depends="compile"
description="Builds the library: picard-lib.jar">
<mkdir dir="${dist}"/>
<jar destfile="${dist}/picard-lib.jar" compress="no">
<fileset dir="${classes}" includes="picard/**/*.*"/>
<fileset dir="${src.scripts}" includes="**/*.R"/>
<manifest>
<attribute name="Implementation-Version" value="${picard-version}(${repository.revision})"/>
<attribute name="Implementation-Vendor" value="Broad Institute"/>
<attribute name="Implementation-Title" value="PICARD Tools Library"/>
</manifest>
</jar>
</target>
<target name="javadoc" depends="init" description="Generates the project javadoc.">
<javadoc
destdir="javadoc/picard"
packagenames="picard*"
windowtitle="PICARD JDK API Documentation"
doctitle="<h1>PICARD JDK API Documentation</h1>"
author="true"
protected="true"
use="true"
version="true"
failonerror="true"
excludepackagenames="htsjdk*">
<classpath>
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${htsjdk}/dist">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${htsjdk}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
<fileset dir="${src}" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
</javadoc>
<javadoc
destdir="javadoc/htsjdk"
packagenames="htsjdk*"
windowtitle="HTSJDK API Documentation"
doctitle="<h1>HTSJDK API Documentation</h1>"
author="true"
protected="true"
use="true"
version="true"
failonerror="true"
excludepackagenames="picard*">
<classpath>
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${htsjdk}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
<fileset dir="${htsjdk_src}" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
</javadoc>
<mkdir dir="${command-line-html-dir}"/>
<javadoc doclet="picard.util.MetricsDoclet"
docletpathref="metrics.classpath"
classpathref="metrics.classpath"
failonerror="true" verbose="true">
<classpath>
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${htsjdk}/dist">
<include name="**/*.jar"/>
</fileset>
</classpath>
<fileset dir=".">
<include name="${src}/**/*.java"/>
<include name="${htsjdk_src}/**/*.java"/>
</fileset>
<arg line="-f ${command-line-html-dir}/picard-metric-definitions.html"/>
</javadoc>
</target>
<target name="add-ga4gh-support">
<property name="addGATKToolsJava" value="1"/>
</target>
<target name="package-commands-ga4gh" depends="add-ga4gh-support, compile, picard-jar" />
<target name="package-commands" depends="compile, picard-jar">
<delete dir="${command-line-html-dir}"/>
<!-- If you don't want to generate on-line doc for a command, use package-command instead of document-command -->
<document-command title="AddCommentsToBam" main-class="picard.sam.AddCommentsToBam"/>
<document-command title="AddOrReplaceReadGroups" main-class="picard.sam.AddOrReplaceReadGroups"/>
<document-command title="BamToBfq" main-class="picard.fastq.BamToBfq"/>
<document-command title="BamIndexStats" main-class="picard.sam.BamIndexStats"/>
<document-command title="BedToIntervalList" main-class="picard.util.BedToIntervalList"/>
<document-command title="BuildBamIndex" main-class="picard.sam.BuildBamIndex"/>
<document-command title="CalculateHsMetrics" main-class="picard.analysis.directed.CalculateHsMetrics"/>
<document-command title="CleanSam" main-class="picard.sam.CleanSam"/>
<document-command title="CollectAlignmentSummaryMetrics" main-class="picard.analysis.CollectAlignmentSummaryMetrics"/>
<document-command title="CollectBaseDistributionByCycle" main-class="picard.analysis.CollectBaseDistributionByCycle"/>
<document-command title="CollectGcBiasMetrics" main-class="picard.analysis.CollectGcBiasMetrics"/>
<document-command title="CollectInsertSizeMetrics" main-class="picard.analysis.CollectInsertSizeMetrics"/>
<document-command title="CollectMultipleMetrics" main-class="picard.analysis.CollectMultipleMetrics"/>
<document-command title="CollectTargetedPcrMetrics" main-class="picard.analysis.directed.CollectTargetedPcrMetrics"/>
<document-command title="CollectRnaSeqMetrics" main-class="picard.analysis.CollectRnaSeqMetrics"/>
<document-command title="CollectWgsMetrics" main-class="picard.analysis.CollectWgsMetrics"/>
<document-command title="CompareSAMs" main-class="picard.sam.CompareSAMs"/>
<document-command title="CreateSequenceDictionary" main-class="picard.sam.CreateSequenceDictionary"/>
<document-command title="DownsampleSam" main-class="picard.sam.DownsampleSam"/>
<document-command title="ExtractIlluminaBarcodes" main-class="picard.illumina.ExtractIlluminaBarcodes"/>
<document-command title="EstimateLibraryComplexity" main-class="picard.sam.markduplicates.EstimateLibraryComplexity"/>
<document-command title="FastqToSam" main-class="picard.sam.FastqToSam"/>
<document-command title="FifoBuffer" main-class="picard.util.FifoBuffer"/>
<document-command title="FilterSamReads" main-class="picard.sam.FilterSamReads"/>
<document-command title="FilterVcf" main-class="picard.vcf.filter.FilterVcf"/>
<document-command title="FixMateInformation" main-class="picard.sam.FixMateInformation"/>
<document-command title="GatherBamFiles" main-class="picard.sam.GatherBamFiles"/>
<document-command title="GatherVcfs" main-class="picard.vcf.GatherVcfs"/>
<document-command title="GenotypeConcordance" main-class="picard.vcf.GenotypeConcordance"/>
<document-command title="IlluminaBasecallsToFastq" main-class="picard.illumina.IlluminaBasecallsToFastq"/>
<document-command title="IlluminaBasecallsToSam" main-class="picard.illumina.IlluminaBasecallsToSam"/>
<document-command title="CheckIlluminaDirectory" main-class="picard.illumina.CheckIlluminaDirectory"/>
<document-command title="IntervalListTools" main-class="picard.util.IntervalListTools"/>
<document-command title="LiftoverVcf" main-class="picard.vcf.LiftoverVcf"/>
<document-command title="MakeSitesOnlyVcf" main-class="picard.vcf.MakeSitesOnlyVcf"/>
<document-command title="MarkDuplicates" main-class="picard.sam.markduplicates.MarkDuplicates"/>
<document-command title="MarkDuplicatesWithMateCigar" main-class="picard.sam.markduplicates.MarkDuplicatesWithMateCigar"/>
<document-command title="MeanQualityByCycle" main-class="picard.analysis.MeanQualityByCycle"/>
<document-command title="MergeBamAlignment" main-class="picard.sam.MergeBamAlignment"/>
<document-command title="MergeSamFiles" main-class="picard.sam.MergeSamFiles"/>
<document-command title="MergeVcfs" main-class="picard.vcf.MergeVcfs"/>
<document-command title="NormalizeFasta" main-class="picard.reference.NormalizeFasta"/>
<document-command title="ExtractSequences" main-class="picard.reference.ExtractSequences"/>
<document-command title="QualityScoreDistribution" main-class="picard.analysis.QualityScoreDistribution"/>
<document-command title="ReorderSam" main-class="picard.sam.ReorderSam"/>
<document-command title="ReplaceSamHeader" main-class="picard.sam.ReplaceSamHeader"/>
<document-command title="RevertSam" main-class="picard.sam.RevertSam"/>
<document-command title="RevertOriginalBaseQualitiesAndAddMateCigar"
main-class="picard.sam.RevertOriginalBaseQualitiesAndAddMateCigar"/>
<document-command title="SamFormatConverter" main-class="picard.sam.SamFormatConverter"/>
<document-command title="SamToFastq" main-class="picard.sam.SamToFastq"/>
<document-command title="SortSam" main-class="picard.sam.SortSam"/>
<document-command title="SortVcf" main-class="picard.vcf.SortVcf"/>
<document-command title="UpdateVcfSequenceDictionary" main-class="picard.vcf.UpdateVcfSequenceDictionary"/>
<document-command title="VcfFormatConverter" main-class="picard.vcf.VcfFormatConverter"/>
<document-command title="MarkIlluminaAdapters" main-class="picard.illumina.MarkIlluminaAdapters"/>
<document-command title="SplitVcfs" main-class="picard.vcf.SplitVcfs"/>
<document-command title="ValidateSamFile" main-class="picard.sam.ValidateSamFile"/>
<document-command title="ViewSam" main-class="picard.sam.ViewSam"/>
<document-command title="VcfToIntervalList" main-class="picard.vcf.VcfToIntervalList"/>
</target>
<!-- ALL -->
<target name="all" depends="compile, picard-lib-jar, package-commands, document-standard-options, build-timestamp"
description="Default build target">
<zip zipfile="${dist}/picard-tools-${picard-version}.zip">
<zipfileset dir="${dist}" includes="*.jar" prefix="picard-tools-${picard-version}"/>
<zipfileset dir="${htsjdk_lib_dir}" includes="htsjdk-*.jar" prefix="picard-tools-${picard-version}"/>
<zipfileset dir="${lib}" includes="snappy*.jar"/>
<!-- distribute libJniDeflater.so in same directory as jarfiles-->
<zipfileset dir="${htsjdk}/lib/jni" includes="*" prefix="picard-tools-${picard-version}"/>
</zip>
</target>
<!-- ************************************************************************************** -->
<!-- ************************************************************************************** -->
<!-- Beginning of taskdefs that are used elsewhere in the build file -->
<!-- ************************************************************************************** -->
<!-- ************************************************************************************** -->
<target name="document-standard-options" depends="picard-jar">
<sequential>
<!-- For Sourceforge project website -->
<mkdir dir="${command-line-html-dir}/program_usage"/>
<!-- Generate HTML for each command -->
<java classname="picard.cmdline.CreateHtmlDocForStandardOptions"
output="${command-line-html-dir}/program_usage/standard-options.html"
failonerror="true">
<classpath>
<pathelement location="${dist}/picard.jar"/>
</classpath>
</java>
</sequential>
</target>
<!-- generate HTML documentation for command-line program -->
<macrodef name="document-command">
<attribute name="main-class"/>
<attribute name="title"/>
<element name="filesets" optional="yes"/>
<sequential>
<!-- For Sourceforge project website -->
<mkdir dir="${command-line-html-dir}/program_usage"/>
<mkdir dir="${command-line-html-dir}/inc"/>
<!-- Generate HTML for each command -->
<java classname="picard.cmdline.CreateHtmlDocForProgram"
output="${command-line-html-dir}/program_usage/@{title}.html"
failonerror="true">
<classpath>
<pathelement location="${dist}/picard.jar"/>
</classpath>
<arg value="@{main-class}"/>
</java>
<!-- Generate links to each command -->
<echo file="${command-line-html-dir}/inc/command-line-sidebar.html" append="true"
message="<li><a href="command-line-overview.html#@{title}">@{title}</a>${line.separator}"/>
<!-- include usage for each command -->
<echo file="${command-line-html-dir}/inc/command-line-usage.html" append="true"
message="{% include @{title}.html %}${line.separator}"/>
</sequential>
</macrodef>
<!-- Compile source files specified by includes, from source root. Can specifically
include or exclude-->
<macrodef name="compile-src">
<attribute name="includes" default=""/>
<attribute name="excludes" default=""/>
<attribute name="destdir" default="${classes}"/>
<attribute name="compile.classpath" default="classpath"/>
<attribute name="compiler.args" default=""/>
<sequential>
<mkdir dir="${classes}"/>
<!-- unset the sourcepath attribute in order to compile only files explicitly specified and disable javac's default searching mechanism -->
<javac destdir="@{destdir}"
optimize="${javac.opt}"
debug="${javac.debug}"
sourcepath=""
srcdir="${src}"
includes="@{includes}"
excludes="@{excludes}"
source="${javac.target}"
target="${javac.target}">
<classpath refid="@{compile.classpath}"/>
<compilerarg line="@{compiler.args}"/>
</javac>
</sequential>
</macrodef>
<macrodef name="compile-tests">
<attribute name="includes" default=""/>
<attribute name="excludes" default=""/>
<attribute name="compiler.args" default=""/>
<sequential>
<mkdir dir="${classes.test}"/>
<javac destdir="${classes.test}"
optimize="${javac.opt}"
debug="${javac.debug}"
srcdir="${src.test.java}"
includes="@{includes}"
excludes="@{excludes}"
source="${javac.target}"
target="${javac.target}">
<classpath>
<path refid="classpath"/>
<pathelement location="${classes}"/>
</classpath>
<compilerarg line="@{compiler.args}"/>
</javac>
</sequential>
</macrodef>
</project>