forked from pegasus-isi/pegasus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·655 lines (580 loc) · 26.9 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
<?xml version="1.0"?>
<project name="pegasus" default="dist">
<property environment="env"/>
<property file="build.properties"/>
<property file="build.git.properties"/>
<property name="build.source" value="1.8"/>
<property name="build.target" value="1.8"/>
<property name="make" value="make"/>
<property name="bash" value="bash"/>
<property name="compile.lint" value="-Xlint:none"/>
<property name="build.src" location="build/main/classes"/>
<property name="test.src" location="build/tests/classes"/>
<property name="junitreport.dir" value="${test.src}/junitreport"/>
<property name="dist.src.dir" location="dist/pegasus-source-${pegasus.version}"/>
<property name="dist.dir" location="dist/pegasus-${pegasus.version}"/>
<property name="dist.bin" location="${dist.dir}/bin"/>
<property name="dist.etc" location="${dist.dir}/etc"/>
<property name="dist.data" location="${dist.dir}/share"/>
<property name="dist.share" location="${dist.data}/pegasus"/>
<property name="dist.jars" location="${dist.share}/java"/>
<property name="dist.aws.jars" location="${dist.share}/java/aws"/>
<property name="dist.schema" location="${dist.share}/schema"/>
<property name="dist.doc" location="${dist.dir}/share/doc/pegasus"/>
<property name="dist.man" location="${dist.data}/man"/>
<path id="build.classpath">
<fileset dir="share/pegasus/java" includes="*.jar"/>
</path>
<path id="build.aws.classpath">
<fileset dir="share/pegasus/java/aws" includes="*.jar"/>
</path>
<echo>Pegasus Version: ${pegasus.version}</echo>
<echo>JAVA TARGET is ${build.target}</echo>
<echo>JAVA SOURCE is ${build.source}</echo>
<tstamp>
<format property="ISODATE.full" pattern="yyyy-MM-dd'T'HH:mm:ssZZZZZ"/>
<format property="ISODATE.short" pattern="yyyyMMdd"/>
<format property="ISODATE.utc" pattern="yyyyMMddHHmmss'Z'" timezone="UTC"/>
<format property="ISODATE.rpm" pattern="EEE MMM dd yyyy"/>
<format property="ISODATE.deb" pattern="EEE, d MMM yyyy HH:mm:ss Z"/>
</tstamp>
<echo>Build timestamp: ${ISODATE.utc}</echo>
<!-- Determine the system architecture and platform -->
<exec executable="${basedir}/release-tools/getsystem"
outputproperty="dist.arch"
failonerror="true"/>
<echo>Architecture: ${dist.arch}</echo>
<!-- OSID is used for Debian package builds -->
<exec executable="${basedir}/release-tools/getosid"
outputproperty="dist.osid"
failonerror="true"/>
<echo>OSID: ${dist.osid}</echo>
<!-- Determine the system library location (lib64 or lib) -->
<exec executable="${basedir}/release-tools/determine-lib-dir"
outputproperty="dist.lib.subdir"
failonerror="true"/>
<echo>Library subdir: ${dist.lib.subdir}</echo>
<property name="dist.lib" location="${dist.dir}/${dist.lib.subdir}"/>
<!-- Determine the system Python -->
<exec executable="${basedir}/release-tools/get-system-python"
outputproperty="dist.python"
failonerror="true">
</exec>
<echo>Python: ${dist.python}</echo>
<!-- Determine the system Python module location -->
<exec executable="${basedir}/release-tools/python-modules-dir"
outputproperty="dist.python-lib.subdir"
failonerror="true">
<arg value="${dist.lib.subdir}"/>
</exec>
<echo>Python library subdir: ${dist.python-lib.subdir}</echo>
<property name="dist.python-lib" location="${dist.dir}/${dist.python-lib.subdir}"/>
<target name="setup" depends="set-git-hash">
<echo>Git hash: ${pegasus.build.git.hash}</echo>
<mkdir dir="dist"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${test.src}"/>
<mkdir dir="${dist.dir}"/>
<!-- Not sure why these are needed -->
<echo file="${dist.dir}/stamp">${ISODATE.utc} ${dist.arch}${line.separator}</echo>
<copy preservelastmodified="true" todir="${build.src}" file="LICENSE"/>
<!-- Generate build properties file -->
<echo file="${build.src}/pegasus.build.properties">
pegasus.build.version=${pegasus.version}
pegasus.build.platform=${dist.arch}
pegasus.build.timestamp=${ISODATE.utc}
pegasus.build.libdir=${dist.lib.subdir}
pegasus.build.pydir=${dist.python-lib.subdir}
pegasus.build.git.hash=${pegasus.build.git.hash}
</echo>
<!-- RPM spec file with updated version number -->
<copy preservelastmodified="true" overwrite="true" file="pegasus.spec.in" tofile="pegasus.spec">
<filterset>
<filter token="PEGASUS_VERSION" value="${pegasus.version}"/>
<filter token="DATE" value="${ISODATE.rpm}"/>
</filterset>
</copy>
<!-- Create pegasus-config -->
<mkdir dir="${dist.bin}"/>
<copy preservelastmodified="true" todir="${dist.bin}">
<fileset dir="bin">
<include name="pegasus-config"/>
<include name="pegasus-python-wrapper"/>
<include name="pegasus-db-admin"/>
</fileset>
<filterset>
<filter token="PEGASUS_VERSION" value="${pegasus.version}"/>
<filter token="LIBDIR" value="${dist.lib.subdir}"/>
<filter token="PYTHON_LIBDIR" value="${dist.python-lib.subdir}"/>
</filterset>
</copy>
</target>
<target name="set-git-hash" unless="pegasus.build.git.hash">
<!-- Get Git Hash if it isn't already set -->
<echo>Setting pegasus.build.git.hash</echo>
<exec executable="/bin/bash" outputproperty="pegasus.build.git.hash" failonerror="true">
<arg value="-c"/>
<arg value="git rev-parse HEAD"/>
</exec>
</target>
<target name="compile-common" depends="setup" description="Compile common java code">
<javac destdir="${build.src}" srcdir="src"
encoding="UTF-8" deprecation="true" debug="true"
target="${build.target}" source="${build.source}"
includes="edu/isi/pegasus/common/**/*.java"
excludes="edu/isi/pegasus/common/**/*Test.java,edu/isi/pegasus/planner/**/*.java"
classpathref="build.classpath"
includeantruntime="false">
<compilerarg value="${compile.lint}"/>
</javac>
</target>
<target name="compile-vdl" depends="setup" description="Compile java VDL code">
<javac destdir="${build.src}" srcdir="src"
target="${build.target}" source="${build.source}"
encoding="UTF-8" debug="true"
includes="org/griphyn/vdl/*.java,org/griphyn/vdl/**/*.java"
excludes="org/griphyn/vdl/*Test.java,org/griphyn/vdl/**/*Test.java"
classpathref="build.classpath"
includeantruntime="false">
<compilerarg value="${compile.lint}"/>
</javac>
</target>
<target name="compile-planner" depends="setup" description="Compile java planner code">
<javac destdir="${build.src}" srcdir="src"
target="${build.target}" source="${build.source}"
encoding="UTF-8" debug="true"
includes="edu/isi/pegasus/planner/**/*.java"
excludes="edu/isi/pegasus/planner/**/*Test.java,org/griphyn/**/*.java"
classpathref="build.classpath"
includeantruntime="false">
<compilerarg value="${compile.lint}"/>
</javac>
</target>
<target name="compile-aws-batch" depends="compile-planner" description="Compile Pegasus AWS Batch Code">
<javac destdir="${build.src}" srcdir="src"
target="${build.target}" source="${build.source}"
encoding="UTF-8" debug="true"
includes="edu/isi/pegasus/aws/**/*.java"
excludes="edu/isi/pegasus/aws/**/*Test.java,org/griphyn/**/*.java"
classpathref="build.aws.classpath"
includeantruntime="false">
<compilerarg value="${compile.lint}"/>
<classpath refid="build.classpath" />
</javac>
</target>
<target name="compile-junit" depends="setup,compile-common,compile-planner" description="Compile java unit tests">
<javac destdir="${test.src}" srcdir="test/junit"
target="${build.target}" source="${build.source}"
encoding="UTF-8" debug="true"
includes="edu/isi/pegasus/**/*.java"
includeantruntime="false">
<classpath>
<path refid="build.classpath"/>
<path location="${build.src}"/>
</classpath>
<compilerarg value="${compile.lint}"/>
</javac>
</target>
<target name="compile-java" depends="compile-vdl,compile-planner,compile-common,compile-junit" description="Copile all java code"/>
<target name="compile" depends="compile-java,compile-ctools,compile-externals" description="Compile all code"/>
<target name="jar" depends="jar-planner,jar-junit,jar-vdl" description="Generate all jar files"/>
<target name="jar-planner" depends="compile-common,compile-planner" description="Generate planner jar">
<mkdir dir="${dist.jars}"/>
<jar destfile="${dist.jars}/pegasus.jar" basedir="${build.src}"
includes="*.properties,edu/isi/pegasus/**/*.class,edu/isi/ikcap/**/*.class"
excludes="*.class,edu/isi/pegasus/aws/**/*.class,edu/isi/pegasus/planner/test/**/*.class,edu/isi/pegasus/**/*Test.class,org/griphyn/**/*Test.class,org/griphyn/**/*.class"/>
<chmod perm="0644" file="${dist.jars}/pegasus.jar"/>
</target>
<target name="jar-aws-batch" depends="compile-aws-batch" description="Generate jar for Pegauss AWS Batch Code">
<mkdir dir="${dist.jars}"/>
<jar destfile="${dist.jars}/pegasus-aws-batch.jar" basedir="${build.src}"
includes="*.properties,edu/isi/pegasus/aws/**/*.class"
excludes="*.class,edu/isi/pegasus/aws/**/*Test.class"/>
<chmod perm="0644" file="${dist.jars}/pegasus-aws-batch.jar"/>
</target>
<target name="jar-junit" depends="compile-junit" description="Generate unit test jar">
<mkdir dir="${dist.jars}"/>
<jar destfile="${dist.jars}/pegasus-test.jar" basedir="${test.src}"
includes="edu/isi/pegasus/**/*.class"/>
<chmod perm="0644" file="${dist.jars}/pegasus-test.jar"/>
</target>
<target name="jar-vdl" depends="compile-vdl" description="Generate VDL jar">
<mkdir dir="${dist.jars}"/>
<jar destfile="${dist.jars}/vdl.jar" basedir="${build.src}"
includes="org/griphyn/vdl/**/*.class,org/griphyn/vdl/*.class"
excludes="*.class,org/griphyn/vdl/**/*Test.class,org/griphyn/vdl/*Test.class,edu/isi/pegasus/**/*.jar"/>
<chmod perm="644" file="${dist.jars}/vdl.jar"/>
</target>
<target name="doc-manpages" depends="setup" description="Generate manpages">
<exec executable="${make}" dir="doc/manpages" failonerror="true">
<arg line="prefix=${dist.dir} install"/>
</exec>
</target>
<target name="doc-user-guide" depends="setup,doc-manpages" description="Generate user guide from docbook source">
<mkdir dir="${dist.doc}"/>
<exec executable="${make}" dir="doc/docbook" failonerror="true">
<arg line="prefix=${dist.doc} install"/>
</exec>
</target>
<target name="doc-java" depends="setup,doc-user-guide" description="Generate java documentation">
<delete dir="${dist.doc}/wordpress/javadoc"/>
<javadoc destdir="${dist.doc}/wordpress/javadoc"
Author="true"
Use="true"
Version="true"
Private="true"
Windowtitle="PEGASUS"
Encoding="UTF-8"
classpathref="build.classpath">
<packageset dir="src">
<include name="edu/isi/pegasus/planner/dax/**"/>
<include name="edu/isi/pegasus/planner/selector/**"/>
</packageset>
<fileset dir="src" includes="*.java"/>
<doctitle><![CDATA[PEGASUS ${pegasus.version}]]></doctitle>
<group title="Pegasus" packages="edu.isi.pegasus.*"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
</javadoc>
</target>
<target name="doc-python" depends="setup,doc-user-guide,compile-externals" description="Generate python documentation">
<delete dir="${dist.doc}/wordpress/python"/>
<mkdir dir="${dist.doc}/wordpress/python"/>
<exec executable="./doc/python-docs" dir="" failonerror="true">
<env key="PYTHONPATH" value="${basedir}/lib/pegasus/externals/python"/>
<arg line="${basedir}/lib/pegasus/python ${dist.doc}/wordpress/python"/>
</exec>
</target>
<target name="doc-perl" depends="setup,doc-user-guide" description="Generate perl documentation">
<delete dir="${dist.doc}/wordpress/perl"/>
<mkdir dir="${dist.doc}/wordpress/perl"/>
<exec executable="./doc/perl-docs" dir="${basedir}" failonerror="true">
<arg line="${dist.doc}/wordpress/perl"/>
</exec>
</target>
<target name="doc-r" depends="setup,doc-user-guide,compile-r" description="Generate r documentation">
<delete dir="${dist.doc}/wordpress/r"/>
<mkdir dir="${dist.doc}/wordpress/r"/>
<exec executable="./doc/r-docs" dir="${basedir}" failonerror="true">
<arg line="${dist.share}/r ${dist.doc}/wordpress/r" />
</exec>
</target>
<target name="doc-schemas" depends="setup,doc-user-guide" description="Generate schemas">
<!-- doc schemas -->
<mkdir dir="${dist.doc}/schemas"/>
<copy preservelastmodified="true" todir="${dist.doc}/schemas">
<fileset dir="doc/schemas" includes="**/*"/>
</copy>
<fixcrlf srcdir="${dist.doc}/schemas" includes="**/*.xsd" eol="lf"/>
<fixcrlf srcdir="${dist.doc}/schemas" includes="**/*.xml" eol="lf"/>
<mkdir dir="${dist.doc}/wordpress/schemas"/>
<copy preservelastmodified="true" todir="${dist.doc}/wordpress/schemas">
<fileset dir="doc/schemas" includes="**/*"/>
</copy>
<fixcrlf srcdir="${dist.doc}/wordpress/schemas" includes="**/*.xsd" eol="lf"/>
<fixcrlf srcdir="${dist.doc}/wordpress/schemas" includes="**/*.xml" eol="lf"/>
</target>
<target name="doc" depends="setup,doc-schemas,doc-manpages,doc-user-guide,doc-java,doc-python,doc-perl,doc-r" description="Generate documentation"/>
<target name="compile-ctools" depends="setup" description="Compile C tools">
<exec executable="${make}" dir="src/tools" failonerror="true">
<env key="prefix" value="${dist.dir}"/>
<env key="datadir" value="${dist.data}"/>
<arg line="prefix=${dist.dir}"/>
<arg line="datadir=${dist.data}"/>
<arg line="install"/>
</exec>
</target>
<target name="compile-pmc" depends="setup" description="Compile Pegasus MPI cluster">
<exec executable="${make}" dir="src/tools/pegasus-mpi-cluster" failonerror="true">
<arg line="prefix=${dist.dir}"/>
<arg line="install"/>
</exec>
</target>
<target name="compile-externals" depends="setup" description="Compile external dependencies">
<exec executable="${make}" dir="src/externals" failonerror="true">
</exec>
</target>
<target name="dist-doc" depends="dist-clean,doc" description="Build documentation tarball">
<tar destfile="dist/pegasus-doc-${pegasus.version}.tar.gz"
basedir="dist" longfile="gnu" compression="gzip"
includes="pegasus-${pegasus.version}/share/man/**,pegasus-${pegasus.version}/share/doc/**"/>
</target>
<target name="compile-python" depends="dist-clean,setup">
<mkdir dir="${dist.python-lib}"/>
<exec executable="${dist.python}" dir="lib/pegasus/python" failonerror="true">
<arg line="setup.py clean --all install_lib -d ${dist.python-lib}"/>
</exec>
<chmod perm="0755" type="file">
<fileset dir="${dist.python-lib}">
<include name="Pegasus/cli/*"/>
<include name="Pegasus/plots_stats/plots/populate.py"/>
<include name="Pegasus/plots_stats/plots/pegasus_breakdown.py"/>
<include name="Pegasus/plots_stats/plots/pegasus_time.py"/>
<include name="Pegasus/tools/kickstart_parser.py"/>
</fileset>
</chmod>
</target>
<target name="compile-r" description="Compile R DAX API">
<mkdir dir="${dist.share}/r"/>
<exec executable="./setup.sh" dir="lib/pegasus/r/Pegasus" failonerror="true">
<arg line="${dist.share}/r" />
</exec>
</target>
<target name="dist-r" depends="dist-clean,compile-r" description="Copy R DAX tarball to dist folder">
<copy preservelastmodified="true" todir="dist">
<fileset dir="${dist.share}/r" includes="*.tar.gz"/>
<mapper>
<mapper type="regexp" from="^(.*)\.tar\.gz" to="pegasus-r-\1.tar.gz"/>
</mapper>
</copy>
</target>
<target name="dist-worker" depends="dist-clean,setup,compile-ctools,compile-python,compile-externals" description="Build worker tarball">
<!-- bin -->
<copy preservelastmodified="true" todir="${dist.bin}">
<fileset dir="bin">
<exclude name="pegasus-python-wrapper"/>
<!-- add script files to copy as necessary -->
</fileset>
</copy>
<chmod perm="0755" type="file">
<fileset dir="${dist.bin}">
<include name="*"/>
</fileset>
</chmod>
<exec executable="release-tools/update-python-tools" failonerror="true">
<arg value="${dist.bin}"/>
</exec>
<!-- lib -->
<copy preservelastmodified="true" todir="${dist.lib}/pegasus/externals/python">
<fileset dir="lib/pegasus/externals/python">
<include name="**/boto/**/*"/>
<include name="**/globus_sdk/**/*"/>
</fileset>
</copy>
<copy preservelastmodified="true" todir="${dist.dir}" file="LICENSE"/>
<package-binary name="pegasus-worker-${pegasus.version}-${dist.arch}"/>
</target>
<target name="dist-common" depends="dist-clean,setup,jar-planner,jar-aws-batch,jar-vdl,compile-ctools,compile-python,compile-externals,compile-r,dist-worker">
<!-- bin -->
<copy preservelastmodified="true" todir="${dist.bin}">
<fileset dir="bin">
<exclude name=".gitignore"/>
<exclude name="pegasus-config"/>
<exclude name="pegasus-python-wrapper"/>
</fileset>
</copy>
<chmod perm="0755" type="file">
<fileset dir="${dist.bin}">
<include name="*"/>
</fileset>
</chmod>
<exec executable="release-tools/update-python-tools" failonerror="true">
<arg value="${dist.bin}"/>
</exec>
<!-- etc -->
<mkdir dir="${dist.etc}"/>
<copy preservelastmodified="true" todir="${dist.etc}">
<fileset dir="etc" includes="**/*"/>
</copy>
<!-- lib -->
<mkdir dir="${dist.lib}/pegasus/javascript"/>
<copy preservelastmodified="true" todir="${dist.lib}/pegasus/javascript">
<fileset dir="lib/pegasus/javascript" includes="**/*.js"/>
</copy>
<mkdir dir="${dist.lib}/pegasus/perl"/>
<copy preservelastmodified="true" todir="${dist.lib}/pegasus/perl">
<fileset dir="lib/pegasus/perl" includes="**/*.pm"/>
</copy>
<mkdir dir="${dist.lib}/pegasus/php"/>
<copy preservelastmodified="true" todir="${dist.lib}/pegasus/php">
<fileset dir="lib/pegasus/php" includes="**/*.php"/>
</copy>
<copy preservelastmodified="true" todir="${dist.lib}/pegasus/externals/python">
<fileset dir="lib/pegasus/externals/python" includes="**/*"/>
</copy>
<!-- share -->
<mkdir dir="${dist.share}"/>
<copy preservelastmodified="true" todir="${dist.share}">
<fileset dir="share/pegasus" includes="**/*">
<exclude name=".gitignore"/>
</fileset>
</copy>
<chmod perm="0755" type="file">
<fileset dir="${dist.share}" includes="**/*.sh"/>
<fileset dir="${dist.share}" includes="**/*.py"/>
<fileset dir="${dist.share}" includes="**/*.pl"/>
</chmod>
<chmod perm="0755" type="file">
<fileset dir="${dist.share}/notification" includes="*"/>
</chmod>
<chmod perm="0755" type="file">
<fileset dir="${dist.share}/examples" includes="**/submit"/>
<fileset dir="${dist.share}/examples" includes="**/*.sh"/>
<fileset dir="${dist.share}/examples" includes="**/*.py"/>
<fileset dir="${dist.share}/examples" includes="**/*.pl"/>
<fileset dir="${dist.share}/examples" includes="**/*.exe"/>
<fileset dir="${dist.share}/examples" includes="**/split"/>
<fileset dir="${dist.share}/examples" includes="**/submit-workflow*"/>
<fileset dir="${dist.share}/examples" includes="**/galactic-plane/galactic-plane"/>
<fileset dir="${dist.share}/examples" includes="**/galactic-plane/local*"/>
<fileset dir="${dist.share}/examples" includes="**/galactic-plane/remote*"/>
</chmod>
<chmod perm="0644" type="file">
<fileset dir="${dist.jars}" includes="*.jar"/>
<fileset dir="${dist.aws.jars}" includes="*.jar"/>
</chmod>
<!-- include a copy of the worker package - this is so that the planner can include it
quickly in workflows running on the same system as the planner -->
<mkdir dir="${dist.share}/worker-packages"/>
<copy preservelastmodified="true" todir="${dist.share}/worker-packages">
<fileset dir="dist" includes="pegasus-worker-${pegasus.version}-${dist.arch}.tar.gz" />
</copy>
<copy preservelastmodified="true" todir="${dist.dir}">
<fileset dir="${basedir}">
<include name="README.md"/>
<include name="LICENSE"/>
<include name="RELEASE_NOTES"/>
</fileset>
</copy>
</target>
<macrodef name="package-binary">
<attribute name="name"/>
<sequential>
<!-- creates the binary tarball -->
<exec executable="sh" dir="dist" failonerror="true">
<arg value="-c"/>
<arg value="tar --exclude=\.git --exclude=\.gitignore --exclude=pegasus-python-wrapper -cf @{name}.tar pegasus-${pegasus.version}"/>
</exec>
<gzip src="dist/@{name}.tar" destfile="dist/@{name}.tar.gz"/>
<delete file="dist/@{name}.tar"/>
</sequential>
</macrodef>
<target name="dist-release" depends="dist-common,doc" description="Build binary release tarball">
<package-binary name="pegasus-binary-${pegasus.version}-${dist.arch}"/>
</target>
<target name="dist-macos" depends="dist-common,doc" description="Build binary release for Mac OS X">
<exec executable="release-tools/macos/package.sh" failonerror="true">
<arg value="${dist.dir}"/>
<arg value="dist/pegasus-binary-${pegasus.version}-${dist.arch}.dmg"/>
</exec>
</target>
<target name="dist" depends="dist-common" description="Build binary release tarball without documentation">
<package-binary name="pegasus-nodocs-${pegasus.version}-${dist.arch}"/>
</target>
<!-- This target should clean everything _except_ things we want in the
source tarball, such as documentation. -->
<target name="dist-clean">
<delete dir="${dist.dir}"/>
<delete dir="build"/>
<exec executable="${make}" dir="src/tools" failonerror="false">
<arg line="distclean"/>
</exec>
<exec executable="${make}" dir="src/tools/pegasus-mpi-cluster" failonerror="false">
<arg line="distclean"/>
</exec>
<exec executable="${make}" dir="src/externals" failonerror="false">
<arg line="clean"/>
</exec>
<exec executable="${dist.python}" dir="lib/pegasus/python" failonerror="false">
<arg line="setup.py clean --all"/>
</exec>
<delete>
<fileset dir="lib/pegasus/python/Pegasus" includes="**/*.pyc"/>
</delete>
</target>
<target name="clean" description="Delete all build artifacts">
<delete dir="dist"/>
<delete dir="build"/>
<exec executable="${make}" dir="src/tools" failonerror="false">
<arg line="distclean"/>
</exec>
<exec executable="${make}" dir="src/tools/pegasus-mpi-cluster" failonerror="false">
<arg line="distclean"/>
</exec>
<exec executable="${make}" dir="src/externals" failonerror="false">
<arg line="clean"/>
</exec>
<exec executable="${make}" dir="doc/manpages" failonerror="false">
<arg line="clean"/>
</exec>
<exec executable="${make}" dir="doc/docbook" failonerror="false">
<arg line="clean"/>
</exec>
<exec executable="${dist.python}" dir="lib/pegasus/python" failonerror="false">
<arg line="setup.py clean --all"/>
</exec>
<delete>
<fileset dir="lib/pegasus/python/Pegasus" includes="**/*.pyc"/>
</delete>
</target>
<target name="dist-source" depends="doc,dist-clean" description="Build source tarball">
<exec executable="release-tools/create-source-tar" failonerror="true">
<arg line="${pegasus.version}"/>
</exec>
</target>
<target name="dist-python-source" description="Build source tarball for Pegasus Python Modules">
<exec executable="release-tools/create-python-source-tar" failonerror="true">
<arg line="${pegasus.version}"/>
</exec>
</target>
<target name="dist-rpm" depends="dist-source,setup" description="Build RPM package">
<exec executable="release-tools/build-rpms" failonerror="true">
<arg line="${pegasus.version}"/>
</exec>
</target>
<target name="dist-deb" depends="dist-source,setup" description="Build Debian package">
<exec executable="release-tools/build-deb" failonerror="true">
<arg line="${pegasus.version} ${dist.osid}"/>
</exec>
</target>
<target name="swamp-tarballs" depends="dist-source" description="Build source tarballs for SWAMP">
<exec executable="release-tools/create-swamp-tarballs" failonerror="true">
<arg line="${pegasus.version}"/>
</exec>
</target>
<target name="test-java" depends="dist-common,jar,compile-externals" description="Run java unit tests">
<mkdir dir="${junitreport.dir}"/>
<junit printsummary="yes" haltonfailure="yes" fork="true" forkmode="once">
<sysproperty key="externals.python.path" value="${dist.lib}/pegasus/externals/python"/>
<sysproperty key="pegasus.home.schemadir" value="${dist.schema}"/>
<sysproperty key="pegasus.home.bindir" value="${dist.bin}"/>
<classpath>
<path refid="build.classpath"/>
<path refid="build.aws.classpath"/>
<path location="${dist.jars}/pegasus.jar"/>
<path location="${dist.jars}/pegasus-test.jar"/>
<path location="${dist.jars}/vdl.jar"/>
</classpath>
<formatter type="xml" usefile="yes"/>
<formatter type="brief" usefile="no"/>
<test name="edu.isi.pegasus.planner.test.AllTests" todir="${junitreport.dir}"/>
</junit>
</target>
<target name="test-python" depends="compile-externals" description="Execute python unit tests">
<exec executable="${dist.python}" dir="lib/pegasus/python" failonerror="true">
<env key="PYTHONPATH" value="${basedir}/lib/pegasus/externals/python"/>
<arg line="test.py"/>
</exec>
</target>
<target name="test-kickstart" depends="dist" description="Run kickstart unit tests">
<exec executable="/bin/sh" dir="src/tools/pegasus-kickstart" failonerror="true">
<arg line="-c 'make test'"/>
<env key="PEGASUS_BIN_DIR" value="${dist.bin}"/>
</exec>
</target>
<target name="test-pmc" description="Run PMC unit tests">
<exec executable="/bin/sh" dir="src/tools/pegasus-mpi-cluster" failonerror="true">
<arg line="-c 'make test'"/>
</exec>
</target>
<target name="test-transfer" depends="dist" description="Run transfer unit tests">
<exec executable="./test.sh" dir="test/unit/transfer" failonerror="true">
<arg line="${dist.bin}"/>
</exec>
</target>
<target name="test-integrity" depends="dist" description="Run integrity unit tests">
<exec executable="./test.sh" dir="test/unit/integrity" failonerror="true">
<arg line="${dist.bin}"/>
</exec>
</target>
<target name="test" depends="dist,test-python,test-kickstart,test-pmc,test-transfer,test-integrity,test-java" description="Run all unit tests"/>
</project>