-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.xml
972 lines (814 loc) · 39.4 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
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
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
<?xml version="1.0"?>
<!--
This file is part of JSBML. Please visit http://sbml.org/Software/JSBML
for the latest version of JSBML and more information about SBML.
Copyright (C) 2009-2022 jointly by the following organizations:
1. The University of Tuebingen, Germany
2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
3. The California Institute of Technology, Pasadena, CA, USA
4. The University of California, San Diego, La Jolla, CA, USA
5. The Babraham Institute, Cambridge, UK
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation. A copy of the license agreement is provided
in the file named "LICENSE.txt" included with this software distribution
and also available online as http://sbml.org/Software/JSBML/License.
-->
<project
default="usage"
basedir=".">
<echo message="Determining the revision number of JSBML" />
<exec executable="svn" outputproperty="svninfo.xml" resultproperty="svn.return.status" failifexecutionfails="false">
<arg line="info --xml" />
</exec>
<!-- We consider it is a subversion checkout if the svninfo file contain the closing info tag -->
<condition property="svn.checkout">
<and>
<contains string="${svninfo.xml}" substring="/info>"/>
<isset property="svn.return.status"/>
</and>
</condition>
<exec executable="git" outputproperty="git.commit.hash" resultproperty="git.return.status" failifexecutionfails="false">
<arg line="log -1 --pretty=format:%H" />
</exec>
<!-- We consider it is a git clone if the property does not contain some error keywords and a return code is given (meaning the executable was found) -->
<condition property="git.clone">
<and>
<not>
<contains string="${git.commit.hash}" substring="fatal"/>
</not>
<isset property="git.return.status"/>
</and>
</condition>
<!-- last property to check if neither svn or git were used and the sources were just downloaded as .zip or .tar.gz -->
<condition property="vcs.used">
<or>
<equals arg1="${git.clone}" arg2="true"/>
<equals arg1="${svn.checkout}" arg2="true"/>
</or>
</condition>
<tstamp>
<format property="YEAR" pattern="yyyy" />
</tstamp>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<property file="${basedir}/jsbml-build.properties"/>
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target description="Initialization target" name="init" unless="target.init.done" depends="svn.build.number, git.build.number, default.build.number">
<property name="target.init.done" value="true"/>
<property name="Name" value="${jsbml.Name}" />
<property name="name" value="jsbml" />
<property name="version" value="1.7-SNAPSHOT" />
<property name="api.version" value="1.7-SNAPSHOT"/>
<property name="year" value="${YEAR}" />
<echo message="----------- ${Name} ${version} [${year}] ------------" />
<echo message="----------- ${TODAY} ------------" />
<echo message="----------- ${DSTAMP} ${TSTAMP} ------------" />
<echo message="----------- git revision ${jsbml.revision} ------------" />
<echo message="----------- git url ${jsbml.url} ------------" />
<property environment="env" />
<property name="build.compiler" value="modern" />
<property name="build.sysclasspath" value="ignore" />
<property name="debug" value="on" />
<property name="optimize" value="on" />
<property name="deprecation" value="false" />
<property name="depend" value="true" />
<property name="verbose" value="false" />
<property name="build.time" value="${DSTAMP}-${TSTAMP}" />
<property name="build.name" value="${version} (build ${jsbml.revision}-${build.time})" />
<property name="src.dir" value="${basedir}/src" />
<property name="test.src.dir" value="${basedir}/test" />
<property name="build.dir" value="${basedir}/build" />
<property name="build.src" value="${basedir}/build/src" />
<property name="build.dest" value="${basedir}/build/classes" />
<property name="build.javadocs" value="${basedir}/build/apidocs" />
<property name="jars.dir" value="${basedir}/core/lib" />
<property name="dist.root" value="${basedir}/dist" />
<property name="dist.dir" value="${dist.root}/${name}-${version}" />
<property name="resource.dir" value="${basedir}/resources" />
<!-- TODO - make something generic for the modules like for the packages -->
<property name="cellDesigner.module.base.dir" value="${basedir}/modules/celldesigner" />
<property name="libSBMLio.module.base.dir" value="${basedir}/modules/libSBMLio" />
<property name="tidy.module.base.dir" value="${basedir}/modules/tidy" />
<property name="core.base.dir" value="${basedir}/core" />
<property name="package.names" value="comp distrib arrays dyn fbc groups layout multi qual render req spatial" />
<filter token="year" value="${year}" />
<filter token="version" value="${version}" />
<filter token="date" value="${TODAY}" />
<filter token="log" value="true" />
<filter token="verbose" value="true" />
<!-- add everything needed to the classpath -->
<!-- adjust the settings to your local environment -->
<path id="classpath">
<fileset dir="${jars.dir}" includes="*.jar *.zip"/>
<path location="${core.base.dir}/build/classes"/>
<fileset dir="${build.dir}" includes="*.jar *.zip"/>
</path>
<!-- add everything to setup tests using the simulation core library -->
<property name="simulation.core.dir" value="${basedir}/../simulation-core" />
<property name="simulation.core.version" value="1.4" />
<property name="sbml-test-cases-2013-01-01" value="${basedir}/../simulation-core/sbml-test-cases-2013-01-01" />
<path id="simulation.core.classpath">
<fileset dir="${simulation.core.dir}/lib" includes="*.jar" excludes="jsbml*"/>
<path refid="classpath"/>
<fileset dir="${simulation.core.dir}/dist/SimulationCoreLibrary-${simulation.core.version}/" includes="*.jar"/>
<fileset dir="${simulation.core.dir}/lib/ext-lib/" includes="*.jar"/>
</path>
</target>
<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target
name="usage"
description="Help on usage"
depends="init"
>
<echo message="" />
<echo message="" />
<echo message=" ${Name} Build file" />
<echo message=" -------------------------------------------------------------" />
<echo message="" />
<echo message=" available targets are:" />
<echo message="" />
<echo message=" jar --> generates the ${name}.jar file" />
<echo message=" bigjar --> generates the ${name}-with-dependencies.jar file" />
<echo message=" javadoc --> generates the API documentation" />
<echo message=" test --> runs the tests" />
<echo message=" dist --> generates all the distribution files" />
<echo message=" maven-install --> install JSBML into the local maven repo" />
<echo message=" maven-deploy --> deploy JSBML into the repo defined by the 'deploy' environement variable. Expected values are 'ossrh', 'ossrh_release', 'sf'." />
<echo message=" Default value is 'ossrh' which correspond to oss sonatype snapshots repository." />
<echo message=" clean --> cleans up the directory" />
<echo message="" />
<echo message=" See the comments inside the build.xml file for more details." />
<echo message=" -------------------------------------------------------------" />
<echo message="" />
<echo message="" />
<!--
<echo message=" compile compiles the source code"/>
-->
</target>
<!-- =================================================================== -->
<!-- Creating the jsbml revision and url if it is an svn checkout -->
<!-- =================================================================== -->
<target
name="svn.build.number"
description="Finds out the subversion build number"
if="svn.checkout" >
<!-- <echo message="It seems to be an SVN checkout"/> -->
<xmlproperty collapseAttributes="true">
<propertyresource name="svninfo.xml" />
</xmlproperty>
<property name="jsbml.revision" value="${info.entry.revision}" />
<property name="jsbml.url" value="${info.entry.url}" />
</target>
<!-- =================================================================== -->
<!-- Creating the jsbml revision and url if it is a git clone -->
<!-- =================================================================== -->
<target
name="git.build.number"
description="Finds out the git build number"
if="git.clone"
unless="svn.checkout"
>
<!-- <echo message="It seems to be a git clone"/> -->
<exec executable="git" outputproperty="git.origin.url" failifexecutionfails="false">
<arg line="config --get remote.origin.url" />
</exec>
<property name="jsbml.revision" value="${git.commit.hash}" />
<property name="jsbml.url" value="${git.origin.url}" />
</target>
<!-- =================================================================== -->
<!-- Creating the jsbml revision and url if it just an archive unpacked -->
<!-- =================================================================== -->
<target
name="default.build.number"
description="Finds out the default build number"
unless="vcs.used">
<!-- <echo message="Could not retrieve automatically the revision number from svn or git !"/> -->
<property name="jsbml.revision" value="build run on ${DSTAMP}" />
<property name="jsbml.url" value="no url provided" />
</target>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target
name="prepare"
description="Prepares the build directory"
depends="init"
unless="prepare.src.target.done"
>
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dest}" />
<mkdir dir="${build.src}" />
<mkdir dir="${dist.dir}" />
<echo message="Done" />
</target>
<!-- =================================================================== -->
<!-- Prepares the source code -->
<!-- =================================================================== -->
<target
name="prepare-src"
description="Prepares the source code"
depends="prepare"
unless="prepare.src.target.done"
>
<property name="prepare.src.target.done" value="true"/>
<ant dir="${core.base.dir}" inheritAll="false" inheritRefs="false">
<property name="use.old.astnodes" value="true"/>
<target name="clean" />
<target name="jar" />
</ant>
<copy todir="${build.src}">
<fileset dir="${core.base.dir}/build/src" includes="**/*"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles the test directory -->
<!-- =================================================================== -->
<target
name="compile"
description="Compiles the test directory"
depends="prepare-src, package, prepare-tidy"
>
<javac srcdir="${test.src.dir}"
destdir="${build.dest}"
debug="${debug}"
optimize="${optimize}"
verbose="${verbose}"
source="${jsbml.build.javac.source}"
target="${jsbml.build.javac.target}"
classpathref="classpath"
encoding="UTF-8">
</javac>
</target>
<!-- =================================================================== -->
<!-- Creates the class package -->
<!-- =================================================================== -->
<target
name="jar"
description="Creates the class package"
depends="prepare-src, compile"
>
<jar
jarfile="${dist.dir}/${name}-${version}.jar"
manifest="${core.base.dir}/build/classes/META-INF/MANIFEST.MF"
filesetmanifest="mergewithoutmain"
duplicate="preserve"
index="true"
>
<fileset dir="${core.base.dir}/build/classes" excludes="**/package-info.class **/package.html"/>
<fileset dir="${build.dest}" excludes="**/package-info.class **/package.html"/>
<zipgroupfileset dir="${build.dir}" includes="*.jar" excludes="**/package-info.class **/package.html"/>
<service type="org.sbml.jsbml.xml.parsers.ReadingParser">
<!-- This list need to be updated as soon as there is a new parser -->
<provider classname="org.sbml.jsbml.xml.parsers.SBMLCoreParser" />
<provider classname="org.sbml.jsbml.xml.parsers.XMLNodeReader" />
<provider classname="org.sbml.jsbml.xml.parsers.MathMLStaxParser" />
<provider classname="org.sbml.jsbml.xml.parsers.ArraysParser" />
<provider classname="org.sbml.jsbml.xml.parsers.CompParser" />
<provider classname="org.sbml.jsbml.xml.parsers.DistribParser" />
<provider classname="org.sbml.jsbml.xml.parsers.DynParser" />
<provider classname="org.sbml.jsbml.xml.parsers.FBCParser" />
<provider classname="org.sbml.jsbml.xml.parsers.GroupsParser" />
<provider classname="org.sbml.jsbml.xml.parsers.L3LayoutParser" />
<provider classname="org.sbml.jsbml.xml.parsers.LayoutParser" />
<provider classname="org.sbml.jsbml.xml.parsers.MultiParser" />
<provider classname="org.sbml.jsbml.xml.parsers.QualParser" />
<provider classname="org.sbml.jsbml.xml.parsers.RenderParser" />
<provider classname="org.sbml.jsbml.xml.parsers.ReqParser" />
<provider classname="org.sbml.jsbml.xml.parsers.SpatialParser" />
<provider classname="org.sbml.jsbml.xml.parsers.UncertMLXMLNodeReader" />
</service>
</jar>
</target>
<!-- =================================================================== -->
<!-- Creates the class package and include all the dependencies jars -->
<!-- into a big jsbml jar file. -->
<!-- =================================================================== -->
<target
name="jar-src"
description="Creates the class package and includes all the dependencies jars into a big jsbml jar file"
depends="jar"
>
<jar
jarfile="${dist.dir}/${name}-${version}-src.jar"
basedir="${build.src}" includes="**/*.java"
index="true"
manifest="${core.base.dir}/build/classes/META-INF/MANIFEST.MF"
/>
</target>
<!-- =================================================================== -->
<!-- Creates the class package and include all the dependencies jars -->
<!-- into a big jsbml jar file. -->
<!-- =================================================================== -->
<target
name="bigjar"
description="Creates the class package and includes all the dependencies jars (and other resources) into a big jsbml jar file"
depends="jar"
>
<jar
jarfile="${dist.dir}/${name}-${version}-with-dependencies.jar"
filesetmanifest="mergewithoutmain" duplicate="preserve"
index="true"
manifest="${core.base.dir}/build/classes/META-INF/MANIFEST.MF"
>
<!-- we use the ${build.src} to include the sources of jsbml in the resulting jar -->
<fileset dir="${build.src}" />
<!-- all the dependencies jars -->
<zipgroupfileset dir="${jars.dir}" includes="*.jar" />
<!-- jsbml core classes -->
<fileset dir="${core.base.dir}/build/classes" />
<!-- jsbml trunk test classes -->
<fileset dir="${build.dest}" />
<!-- all the package jars -->
<zipgroupfileset dir="${build.dir}" includes="*.jar" />
<!-- all L3 packages classes -->
<service type="org.sbml.jsbml.xml.parsers.ReadingParser">
<!-- This list need to be updated as soon as there is a new parser -->
<provider classname="org.sbml.jsbml.xml.parsers.SBMLCoreParser" />
<provider classname="org.sbml.jsbml.xml.parsers.XMLNodeReader" />
<provider classname="org.sbml.jsbml.xml.parsers.MathMLStaxParser" />
<provider classname="org.sbml.jsbml.xml.parsers.ArraysParser" />
<provider classname="org.sbml.jsbml.xml.parsers.CompParser" />
<provider classname="org.sbml.jsbml.xml.parsers.DistribParser" />
<provider classname="org.sbml.jsbml.xml.parsers.DynParser" />
<provider classname="org.sbml.jsbml.xml.parsers.FBCParser" />
<provider classname="org.sbml.jsbml.xml.parsers.GroupsParser" />
<provider classname="org.sbml.jsbml.xml.parsers.L3LayoutParser" />
<provider classname="org.sbml.jsbml.xml.parsers.LayoutParser" />
<provider classname="org.sbml.jsbml.xml.parsers.MultiParser" />
<provider classname="org.sbml.jsbml.xml.parsers.QualParser" />
<provider classname="org.sbml.jsbml.xml.parsers.RenderParser" />
<provider classname="org.sbml.jsbml.xml.parsers.ReqParser" />
<provider classname="org.sbml.jsbml.xml.parsers.SpatialParser" />
<provider classname="org.sbml.jsbml.xml.parsers.UncertMLXMLNodeReader" />
</service>
</jar>
</target>
<!-- =================================================================== -->
<!-- Test the jsbml library -->
<!-- =================================================================== -->
<target
name="test"
description="Test the jsbml library"
depends="jar"
>
<!-- Launching the tests for core and packages -->
<echo message="There should be NO failures or errors."/>
<echo message=""/>
<echo message="You can see a detailled output of the tests on the file: jsbmlTestResults.txt"/>
<echo message=""/>
<junit printsummary="yes" >
<formatter type="plain"/>
<test name="org.sbml.jsbml.test.AllTests" outfile="jsbmlTestResults">
<formatter type="plain"/>
</test>
<classpath>
<path refid="classpath"/>
<pathelement location="${dist.dir}/${name}-${version}.jar"/>
</classpath>
</junit>
<echo message=""/>
</target>
<!-- =================================================================== -->
<!-- Test the SBML online validator -->
<!-- =================================================================== -->
<target
name="test-online-validator"
description="Test the SBML online validator"
depends="jar"
>
<!-- Launching the tests for core and packages -->
<echo message="There should be NO failures or errors."/>
<echo message=""/>
<echo message="You can see a detailled output of the tests on the file: jsbmlTestResults.txt"/>
<echo message=""/>
<junit printsummary="yes" >
<formatter type="plain"/>
<test name="org.sbml.jsbml.xml.test.CheckConsistencyTests" outfile="jsbmlOnlineValidatorTestResults">
<formatter type="plain"/>
</test>
<classpath>
<path refid="classpath"/>
<pathelement location="${dist.dir}/${name}-${version}.jar"/>
</classpath>
</junit>
<echo message=""/>
</target>
<!-- =================================================================== -->
<!-- Test the jsbml library (long) -->
<!-- =================================================================== -->
<target
name="extra-test"
description="Test the jsbml library over the libsbml test suite"
depends="init"
>
<!-- Launching the tests for core and packages -->
<echo message="There should be NO failures or errors."/>
<echo message=""/>
<echo message="You can see a detailled output of the tests on the file: simulation-coreTestResults.txt"/>
<echo message=""/>
<java classname="org.simulator.SBMLTestSuiteRunner" classpathref="simulation.core.classpath" output="simulation-coreTestResults.txt">
<arg value="${sbml-test-cases-2013-01-01}/cases/semantic/"/>
<arg value="1"/>
<arg value="1185"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target
name="javadoc"
depends="prepare-src, package"
description="Creates the API documentation"
>
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="org.*"
excludepackagenames="org.sbml.jsbml.**.test, org.sbml.jsbml.**.test.**"
sourcepath="${build.src}"
destdir="${build.javadocs}"
classpathref="classpath"
maxmemory="96m"
author="true"
version="true"
use="true"
splitindex="true"
noindex="false"
windowtitle="${Name} ${version} API Specification"
doctitle="${Name} ${version} API Specification"
breakiterator="yes"
access="public"
overview="${basedir}/overview.html"
stylesheetfile="${basedir}/stylesheet.css"
header="<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXML.js" type="text/javascript"></script>
<img height="40" src="https://github.com/sbmlteam/jsbml/blob/master/doc/common/logo/JSBML_shaddow_small.png?raw=true" title="JSBML" alt="JSBML"/>"
footer="<script type="text/javascript">
SyntaxHighlighter.defaults["auto-links"] = false;
SyntaxHighlighter.defaults["tab-size"] = 2;
SyntaxHighlighter.all();
</script>
Generated at ${TODAY}<br/>Version ${version} Revision ${jsbml.revision}">
<link href="http://docs.oracle.com/javase/6/docs/api/" />
<link href="https://biojava.org/docs/api6.0.0" />
<tag name="sbml.deprecated" description="Deprecated in SBML since:" />
<tag name="libsbml.deprecated" description="Note: this method is kept here as it exist in libSBML." />
<tag name="jsbml.note" description="Note:" />
<tag name="jsbml.warning" />
<tag name="doc.note" description="Documentation note" />
<tag name="date" description="Last modified:" />
<arg value="--allow-script-in-comments"/>
<arg value="-J-Xms4096m"/>
<arg value="-J-Xmx4096m"/>
<arg value="-Xmaxerrs"/>
<arg value="10000"/>
<arg value="-Xmaxwarns"/>
<arg value="10000"/>
</javadoc>
<!--<property name="icon.file.src" value="${basedir}/core/doc/common/logo/JSBML.png"/>-->
<!--<property name="icon.file.dest" value="${basedir}/build/apidocs/resources/JSBML.png"/>-->
<!--<copy file="${icon.file.src}" tofile="${icon.file.dest}" verbose="true"/>-->
<!--<property name="icon.file.src2" value="${basedir}/javadoc.jpg"/>-->
<!--<property name="icon.file.dest2" value="${build.javadocs}/resources/javadoc.jpg"/>-->
<!--<copy file="${icon.file.src2}" tofile="${icon.file.dest2}" verbose="true"/>-->
</target>
<!-- =================================================================== -->
<!-- Creates the javadocs jar package -->
<!-- =================================================================== -->
<target
name="jar-javadoc"
description="Creates the javadocs jar package"
depends="javadoc"
>
<jar jarfile="${dist.dir}/${name}-${version}-javadoc.jar" basedir="${build.javadocs}"
index="true" manifest="${core.base.dir}/build/classes/META-INF/MANIFEST.MF" />
</target>
<!-- =================================================================== -->
<!-- Creates the distribution -->
<!-- =================================================================== -->
<target
name="dist"
description="Creates the distribution"
depends="init"
>
<!-- Cleaning before starting -->
<antcall target="clean" inheritrefs="true" inheritall="true"/>
<!-- generate the jars using the old ASTNode class -->
<!-- Creates the standard jar files -->
<antcall target="jar" inheritrefs="true" inheritall="true"/>
<property name="package.target.done" value="true"/>
<property name="prepare.src.target.done" value="true"/>
<antcall target="jar-src" inheritrefs="true" inheritall="true"/>
<copy todir="${dist.root}" file="${dist.dir}/${name}-${version}.jar" />
<!-- Creates the jar file including all the dependencies -->
<antcall target="bigjar" inheritrefs="true" inheritall="true"/>
<copy todir="${dist.root}" file="${dist.dir}/${name}-${version}-with-dependencies.jar" />
<!-- Creates and copy the generated javadoc -->
<antcall target="jar-javadoc" inheritrefs="true" inheritall="true"/>
<copy todir="${dist.dir}/doc/api">
<fileset dir="${build.javadocs}/" includes="**/*"/>
</copy>
<!-- backup the jars using the old ASTNode class -->
<copy tofile="${dist.dir}/${name}-${version}-oldASTNode-with-dependencies.jar" file="${dist.dir}/${name}-${version}-with-dependencies.jar" />
<copy tofile="${dist.dir}/${name}-${version}-oldASTNode.jar" file="${dist.dir}/${name}-${version}.jar" />
<!-- re-generating the jsbml-core jar file -->
<!-- copying by hand the ASTNode2 facade -->
<copy file="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java.newASTNode" tofile="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java" overwrite="yes"/>
<copy file="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java.newASTNode" tofile="${core.base.dir}/build/src/org/sbml/jsbml/ASTNode.java" overwrite="yes"/>
<delete file="${build.dest}/org/sbml/jsbml/test/ASTNodeVersionTest.class" />
<ant dir="${core.base.dir}" inheritAll="false" inheritRefs="false">
<target name="clean" />
<target name="jar" />
</ant>
<copy file="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java.newASTNode" tofile="${build.dir}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/>
<!-- re-generating the global jsbml jar files -->
<antcall target="jar" inheritrefs="true" inheritall="true"/>
<antcall target="bigjar" inheritrefs="true" inheritall="true"/>
<!-- restoring the ASTNode class -->
<copy file="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java" overwrite="yes"/>
<copy file="${core.base.dir}/src/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${core.base.dir}/build/src/org/sbml/jsbml/ASTNode.java" overwrite="yes"/>
<!-- rename and copy all jars, restore the jars using the old ASTNode class as the default -->
<copy tofile="${dist.root}/${name}-${version}-newASTNode-with-dependencies.jar" file="${dist.dir}/${name}-${version}-with-dependencies.jar" />
<copy tofile="${dist.root}/${name}-${version}-newASTNode.jar" file="${dist.dir}/${name}-${version}.jar" />
<copy tofile="${dist.dir}/${name}-${version}-newASTNode-with-dependencies.jar" file="${dist.dir}/${name}-${version}-with-dependencies.jar" />
<copy tofile="${dist.dir}/${name}-${version}-newASTNode.jar" file="${dist.dir}/${name}-${version}.jar" />
<copy file="${dist.dir}/${name}-${version}-oldASTNode-with-dependencies.jar" tofile="${dist.dir}/${name}-${version}-with-dependencies.jar" overwrite="true"/>
<copy file="${dist.dir}/${name}-${version}-oldASTNode.jar" tofile="${dist.dir}/${name}-${version}.jar" overwrite="true"/>
<delete file="${dist.dir}/${name}-${version}-oldASTNode.jar" verbose="true"/>
<delete file="${dist.dir}/${name}-${version}-oldASTNode-with-dependencies.jar" verbose="true"/>
<!-- Copy the source files -->
<copy todir="${dist.dir}/src">
<fileset dir="${build.src}/" includes="**/*"/>
</copy>
<!-- Copy all the dependencies jar files -->
<copy todir="${dist.dir}/lib">
<fileset dir="${jars.dir}/" includes="*.jar"/>
</copy>
<!-- put back README when it is done -->
<copy todir="${dist.dir}">
<fileset dir="${basedir}/" includes="LICENSE.txt NEWS.txt AUTHORS.txt build.xml"/>
</copy>
<copy todir="${dist.dir}/licenses">
<fileset dir="${basedir}/core/licenses" includes="**/*"/>
</copy>
<!-- <copy todir="${dist.dir}" file="${core.base.dir}/performanceTest.sh"/> -->
<copy todir="${dist.dir}/doc">
<fileset dir="${basedir}/doc" includes="**/*.pdf **/*.jpg **/*.java" excludes="posters/** publications/** templates/** beginners_guide/** presentations/**"/>
</copy>
<!-- create the modules files -->
<antcall target="module-dist" inheritrefs="true" inheritall="true"/>
<!-- Creates the archives to be distributed -->
<zip basedir="${dist.root}" destfile="${dist.root}/${name}-${version}-full.zip" includes="${name}-${version}/**" />
<!-- Not generating a tar.gz, having only a zip file should be enough -->
<!-- <tar basedir="${dist.root}" destfile="${dist.root}/${name}-${version}.tar.gz" includes="${name}-${version}/**" compression="gzip"/> -->
</target>
<!-- =================================================================== -->
<!-- Build the jsbml modules -->
<!-- =================================================================== -->
<target
name="module"
description="Build the jsbml modules"
depends="init"
>
<!--
<ant dir="${cellDesigner.module.base.dir}" inheritAll="false" inheritRefs="false">
<target name="clean" />
<target name="jar" />
<target name="javadoc" />
</ant>
-->
<ant dir="${libSBMLio.module.base.dir}" inheritAll="false" inheritRefs="false">
<target name="clean" />
<target name="jar" />
<target name="javadoc" />
</ant>
<ant dir="${tidy.module.base.dir}" inheritAll="false" inheritRefs="false">
<target name="clean" />
<target name="jar" />
<target name="javadoc" />
</ant>
</target>
<!-- =================================================================== -->
<!-- Build a single jsbml package -->
<!-- =================================================================== -->
<target
name="prepare-package"
depends="init"
description="Build a single jsbml package"
>
<echo>Package ${packagename}</echo>
<ant dir="${basedir}/extensions/${packagename}" inheritAll="false" inheritRefs="false">
<target name="clean" />
<target name="jar" />
<!-- <target name="dist"/> -->
</ant>
<copy todir="${build.src}">
<fileset dir="${basedir}/extensions/${packagename}/build/src" />
</copy>
<copy todir="${build.dir}">
<fileset dir="${basedir}/extensions/${packagename}/build/" includes="*.jar" />
</copy>
</target>
<!-- =================================================================== -->
<!-- Build a single jsbml module -->
<!-- =================================================================== -->
<target
name="prepare-tidy"
depends="init"
description="Build the tidy jsbml module"
>
<echo>Module jsbml-tidy</echo>
<ant dir="${tidy.module.base.dir}" inheritAll="false" inheritRefs="false">
<target name="clean" />
<target name="jar" />
</ant>
<copy todir="${build.src}">
<fileset dir="${tidy.module.base.dir}/build/src" />
</copy>
<copy todir="${build.dir}">
<fileset dir="${tidy.module.base.dir}/build/" includes="*.jar" />
<fileset dir="${tidy.module.base.dir}/lib/" includes="*.jar" />
</copy>
</target>
<!-- =================================================================== -->
<!-- Build the jsbml extensions/packages -->
<!-- =================================================================== -->
<target
name="package"
description="Build the jsbml L3 packages"
depends="init"
unless="package.target.done"
>
<property name="package.target.done" value="true"/>
<foreach list="${package.names}" delimiter=" " param="packagename" target="prepare-package" inheritall="true" inheritrefs="true"/>
</target>
<!-- =================================================================== -->
<!-- Create the jsbml modules distribution -->
<!-- =================================================================== -->
<target
name="module-dist"
description="Build the jsbml modules"
depends="init"
>
<mkdir dir="${dist.dir}/modules" />
<property file="${cellDesigner.module.base.dir}/celldesigner-build.properties" />
<property file="${libSBMLio.module.base.dir}/libSBMLio-build.properties" />
<property file="${tidy.module.base.dir}/tidy-build.properties" />
<!--
<echo message="Value read from celldesigner properties file = ${celldesigner.name}" />
<echo message="Value read from celldesigner properties file = ${celldesigner.version}" />
<echo message="Value read from libSBMLio properties file = ${libSBMLio.name}" />
-->
<!--
<ant dir="${cellDesigner.module.base.dir}" inheritAll="false" inheritRefs="false">
<target name="dist" />
</ant>
<copy todir="${dist.dir}/modules/${celldesigner.name}-${celldesigner.version}">
<fileset dir="${cellDesigner.module.base.dir}/dist/${celldesigner.name}-${celldesigner.version}" includes="*.jar" />
</copy>
<copy todir="${dist.root}">
<fileset dir="${cellDesigner.module.base.dir}/dist/" includes="*.zip" />
</copy>
-->
<ant dir="${libSBMLio.module.base.dir}" inheritAll="false" inheritRefs="true">
<target name="dist" />
</ant>
<copy todir="${dist.dir}/modules/${libSBMLio.name}-${libSBMLio.version}">
<fileset dir="${libSBMLio.module.base.dir}/dist/${libSBMLio.name}-${libSBMLio.version}" includes="*.jar" />
</copy>
<copy todir="${dist.root}">
<fileset dir="${libSBMLio.module.base.dir}/dist/" includes="*.zip" />
</copy>
<ant dir="${tidy.module.base.dir}" inheritAll="false" inheritRefs="false">
<target name="dist" />
</ant>
<copy todir="${dist.dir}/modules/${tidy.name}-${tidy.version}">
<fileset dir="${tidy.module.base.dir}/dist/${tidy.name}-${tidy.version}" includes="*.jar" />
</copy>
<copy todir="${dist.dir}/modules/${tidy.name}-${tidy.version}">
<fileset dir="${tidy.module.base.dir}/dist/${tidy.name}-${tidy.version}/lib" includes="*.jar" />
</copy>
<copy todir="${dist.root}">
<fileset dir="${tidy.module.base.dir}/dist/" includes="*.zip" />
</copy>
</target>
<!-- =================================================================== -->
<!-- Install jsbml in the local repo -->
<!-- =================================================================== -->
<target
name="maven-install"
description="Install jsbml localy"
depends="init"
>
<exec executable="mvn">
<arg value="javadoc:jar"/>
<arg value="source:jar"/>
<arg value="install"/>
</exec>
<!-- TODO - add the jsbml artifact as well ?
-->
</target>
<!-- =================================================================== -->
<!-- Deploy jsbml in a remote repo -->
<!-- =================================================================== -->
<target
name="maven-deploy"
description="Deploy jsbml remotely"
depends="init"
>
<!-- To create a new release, run either as:
ant maven-deploy -Ddeploy=ossrh
-> makes a SNAPSHOT release
or
ant maven-deploy -Ddeploy=ossrh_release
-> makes a stable release
Note: When making a release, it is also necessary to run 'ant dist' to prepare the
binary distribution
-->
<!-- Defining which options to use depending of the 'deploy' property content -->
<!-- using var here as property are not re-writable in ant -->
<var name="maven.repo.url" value="https://oss.sonatype.org/content/repositories/snapshots"/>
<var name="maven.profile" value="ossrh"/>
<property name="maven.repo.id" value="ossrh-jsbml"/>
<echo message="Using ${deploy} as option"/>
<if>
<equals arg1="${deploy}" arg2="ossrh_release" />
<then><var name="maven.repo.url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/"/></then>
<elseif>
<equals arg1="${deploy}" arg2="sf" />
<then>
<var name="maven.repo.url" value="scp://shell.sourceforge.net/home/project-web/jsbml/htdocs/m2repo_snapshots"/>
<var name="maven.profile" value="sf"/>
</then>
</elseif>
<elseif>
<equals arg1="${deploy}" arg2="sf_release" />
<then>
<var name="maven.repo.url" value="scp://shell.sourceforge.net/home/project-web/jsbml/htdocs/m2repo"/>
<var name="maven.profile" value="sf"/>
</then>
</elseif>
<elseif>
<equals arg1="${deploy}" arg2="local" />
<then>
<var name="maven.repo.url" value="file:///homes/maven/public_html/m2repo"/>
<var name="maven.profile" value="local"/>
</then>
</elseif>
</if>
<echo message="Using ${maven.repo.url} as repository URL"/>
<echo message="Using ${maven.profile} as maven profile"/>
<!-- mvn clean javadoc:jar source:jar deploy -Ddeploy=ossrh -->
<exec executable="mvn"> <!-- mvn clean javadoc:jar source:jar deploy -Ddeploy=ossrh -->
<arg value="clean"/>
<arg value="javadoc:jar"/>
<arg value="source:jar"/>
<arg value="deploy"/>
<arg value="-Ddeploy=${maven.profile}"/>
</exec>
<!-- deploying a pseudo jar file to be able to have all packages dependencies defined in one go -->
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/> <!-- using 'gpg:sign-and-deploy-file' to be able to sign the files when deploying -->
<arg value="-DpomFile=dev/maven/pom.xml"/>
<arg value="-Dfile=dev/maven/jsbml-pom.jar"/>
<arg value="-Dsources=dev/maven/jsbml-pom-sources.jar"/>
<arg value="-Djavadoc=dev/maven/jsbml-pom-javadoc.jar"/>
<arg value="-Durl=${maven.repo.url}"/>
<arg value="-DrepositoryId=${maven.repo.id}"/>
</exec>
<!-- TODO try to find a way to close and release the implicitly created staging repo from the sign-and-deploy-file goal.
<exec executable="mvn">
<arg value="nexus-staging:deploy-staged"/> 'deploy-staged' could work but we would need to add by hand the extra files in the .index file
<arg value="nexus-staging:close"/>
<arg value="nexus-staging:release"/>
</exec>
nexus-staging:deploy-staged-repository could be an option but it does not seems to work fine in the tests I made.
mvn nexus-staging:deploy-staged-repository -DautoReleaseAfterClose=false -DskipStagingRepositoryClose=true
-DrepositoryDirectory=/home/rodrigue/src/jsbml_old_sf_svn/sf_maven_repo/
-DnexusUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2 -DserverId=ossrh -DstagingProfileId=303b798d21777c
-->
<!-- mvn test jar:test-jar to generate the test jar files to be able to run the tests in a new project -->
</target>
<!-- =================================================================== -->
<!-- Cleans everything -->
<!-- =================================================================== -->
<target
name="clean"
description="Cleans everything"
depends="init"
>
<delete includeEmptyDirs="true" quiet="yes">
<fileset dir="${build.dir}" includes="**/*" />
</delete>
<delete dir="${dist.root}" includeEmptyDirs="true" quiet="yes">
</delete>
</target>
</project>
<!-- End of file -->