-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcontinuous.xml
More file actions
1490 lines (1322 loc) · 66.7 KB
/
continuous.xml
File metadata and controls
1490 lines (1322 loc) · 66.7 KB
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
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<project name="continuous"
default="continuous" >
<!-- ********************************** -->
<!-- ** Initialisation/Configuration ** -->
<!-- ********************************** -->
<!-- Allow the path of the imported script to be overriden -->
<property name="build.script" value="build.xml" />
<import file="${basedir}/${build.script}" />
<!-- We ant Java 1.6 and Ant 1.7, to make the scripting simple -->
<fail message="Ant 1.7 or higher is required to build. ${ant.version} detected">
<!-- antversion tag not available in 1.6 which is unhelpful -->
<condition><contains string="${ant.version}" substring="1.6." /></condition>
</fail>
<fail message="Ant 1.7 or higher is required to build. ${ant.version} detected">
<condition><not><antversion atleast="1.7" /></not></condition>
</fail>
<target name="continuous-init" depends="init">
<property file="continuous.properties" />
<property name="classpath.unit.test.full" value="${toString:classpath.unit.test.extension}" />
<path id="classpath.unit.test.extension">
<pathelement location="${dir.name.binaries}/build-classpath/${version.major}.${version.minor}" />
<pathelement path="${classpath.unit.test.full}" />
</path>
<echo>classpath.unit.test.extension = ${toString:classpath.unit.test.extension}</echo>
</target>
<target name="bootstrap-wcm-test" depends="continuous-init" >
<!-- enable wcm for unit tests -->
<echo message="enable wcm for tests" />
<copy file="${file.name.wcm.bootstrap}" todir="${dir.project.repository}/${dir.name.source}/${dir.name.test.resources}/alfresco/extension" />
</target>
<target name="init-test"
depends="continuous-init,bootstrap-wcm-test">
<mkdir dir="${dir.continuous.dist}" />
</target>
<!-- ********************** -->
<!-- ** Cleaning targets ** -->
<!-- ********************** -->
<target name="clean-continuous"
description="Cleans just the continuous build area"
depends="continuous-init">
<delete quiet="yes"
includeEmptyDirs="true"
dir="${dir.continuous.build}" />
</target>
<!-- *********************** -->
<!-- ** Top level targets ** -->
<!-- *********************** -->
<target name="continuous"
description="Performs a full clean, runs all tests and creates all distribution files"
depends="clean-continuous,
clean,
-reset-database,
set-build-number,
init-test,
test,
distribute,
generate-checksums" />
<target name="continuous-core"
description="Performs a full clean, runs all tests and creates all patch distribution files"
depends="clean-continuous,
clean,
-reset-database,
set-build-number,
init-test,
test,
distribute-core,
generate-checksums" />
<target name="continuous-without-tests"
description="Performs a full clean and creates all distribution files but does not run any tests"
depends="clean-continuous,
clean,
-reset-database,
distribute,
generate-checksums" />
<target name="continuous-without-distribute"
description="Performs a full clean and runs all tests but does not generate any distribution files"
depends="clean-continuous,
clean,
-reset-database,
set-build-number,
init-test,
test" />
<target name="distribute"
description="Creates the distribution files for all platforms"
depends="set-build-number,
incremental,
distribute-core,
distribute-non-core,
revert-changes" />
<target name="distribute-patch"
description="Creates the distribution files for all platforms"
depends="set-build-number,
incremental,
distribute-core,
revert-changes" />
<target name="distribute-non-core"
description="Creates the distribution files for all platforms"
depends="distribute-amps,
distribute-sdk,
distribute-installers,
distribute-extras,
distribute-fdk,
distribute-docs" />
<target name="distribute-core"
description="Creates the patch distribution files for all platforms"
depends="assemble-commands,
distribute-amps,
assemble-tomcat,
distribute-war,
distribute-wcm,
distribute-webserviceclient,
distribute-deployment,
distribute-webeditor,
distribute-wcmqs-extension,
distribute-solr,
distribute-file-transfer-receiver" />
<target name="set-build-number"
depends="continuous-init, set-build-devbox-number, set-revision-number">
<property file="distribute.properties" />
</target>
<target name="set-build-devbox-number"
if="alf.build.number">
<exec executable="svn">
<arg line="revert ${dir.project.repository.config}/alfresco/version.properties"/>
</exec>
<replace file="${dir.project.repository.config}/alfresco/version.properties"
token="@build-number@"
value="${alf.build.number}"
summary="yes" />
<replace file="${dir.project.repository.config}/alfresco/version.properties"
token="version.edition=Community"
value="version.edition=${file.name.codeline}"
summary="yes" />
</target>
<target name="set-revision-number"
depends="continuous-init"
unless="alf.build.number">
<taskdef name="svn"
classname="org.tigris.subversion.svnant.SvnTask">
<classpath refid="classpath.compile" />
</taskdef>
<svn>
<status path="${basedir}" revisionProperty="svn.revision" />
</svn>
<exec executable="svn">
<arg line="revert ${dir.project.repository.config}/alfresco/version.properties"/>
</exec>
<replace file="${dir.project.repository.config}/alfresco/version.properties"
token="@build-number@"
value="r${svn.revision}"
summary="yes" />
<replace file="${dir.project.repository.config}/alfresco/version.properties"
token="version.edition=Community"
value="version.edition=${file.name.codeline}"
summary="yes" />
</target>
<target name="set-build-number-cc"
depends="continuous-init"
if="build.release">
<replace file="${dir.project.repository.config}/alfresco/version.properties"
token="@build-number@"
value="${label}" />
<replace file="${dir.project.repository.config}/alfresco/version.properties"
token="@code-line@"
value="${file.name.codeline}"
summary="yes" />
</target>
<target name="revert-changes"
depends="continuous-init">
<exec executable="svn">
<arg line="revert ${dir.project.repository.config}/alfresco/version.properties"/>
</exec>
</target>
<target name="generate-checksums"
description="Generates checksum files for the distibution files"
depends="continuous-init">
<delete>
<fileset dir="${dir.continuous.dist}"
includes="*.MD5"/>
</delete>
<checksum>
<fileset dir="${dir.continuous.dist}"/>
</checksum>
</target>
<!-- **************************************************** -->
<!-- ** Database targets (for internal script use only)** -->
<!-- **************************************************** -->
<target name="reset-database"
depends="-drop-database,
-create-database" />
<target name="-reset-database"
depends="-drop-database,
-create-database" />
<target name="load-database-properties"
depends="continuous-init">
<!-- If a DB properties override file was supplied, copy it into place -->
<script language="javascript" classpath="${classpath.bsf_javascript}"> <![CDATA[
importClass(java.io.File);
var repoConfigPath = project.getProperty("dir.project.repository.config");
var globalFile = new File(repoConfigPath + "/alfresco/module/test/alfresco-global.properties" );
var propfile = project.getProperty("DB_PROPERTIES");
// Always clean up the old one
var del = project.createTask("delete");
del.setFile( globalFile );
del.perform();
if(propfile != null) {
// Copy in the new one
var copy = project.createTask("copy");
copy.setFile( new File(propfile) );
copy.setTofile( globalFile );
copy.perform();
}
]]></script>
<!-- Grab dev-context.xml and test-context.xml, from the repo config + home dir -->
<!-- Then, load the repository properties files, in order -->
<!-- Note - ant property loading works differently to spring, so we -->
<!-- need to load in the reverse order! -->
<script language="javascript" classpath="${classpath.bsf_javascript}"> <![CDATA[
importClass(java.util.regex.Matcher);
importClass(java.util.regex.Pattern);
importClass(java.io.File);
importClass(java.io.FileInputStream);
importClass(java.io.InputStreamReader);
importClass(java.io.BufferedReader);
importClass(java.lang.System);
var fail = project.createTask("fail");
var loadfile = project.createTask("loadfile");
loadfile.setFailonerror(false);
var repoConfigPath = project.getProperty("dir.project.repository.config");
var repoPropMatcher = Pattern.compile("<bean id=\"repository-properties\"(.*?)</bean>", Pattern.DOTALL);
var locationsMatcher = Pattern.compile("<property name=\"locations\"(.*?)</property>", Pattern.DOTALL);
var valueMatcher = Pattern.compile("<value>(.*?)</value>", Pattern.DOTALL);
var propertiesDefs = new Array();
var propertiesFiles = new Array();
var count = 0;
for each (var dirp in ["user.home", "dir.project.repository.config"]) {
var dir = project.getProperty(dirp) + "/alfresco/extension/";
for each (var xmlc in ["dev-context","test-context"]) {
var xmlfile = new File(dir + xmlc + ".xml");
count++;
loadfile.setProperty("xml"+count);
loadfile.setSrcFile(xmlfile);
loadfile.perform();
var xml = project.getProperty("xml"+count);
if(xml != null) {
var rpm = repoPropMatcher.matcher(xml);
if(rpm.find()) {
var lm = locationsMatcher.matcher( rpm.group() );
if(lm.find()) {
var vm = valueMatcher.matcher( lm.group(0) );
while(vm.find()) {
var property = vm.group(1);
var pfn;
// Support things like <value>${foo}</value>
if(property.startsWith("${")) {
var sysProp = property.substring(2, property.length()-1);
property = project.getProperty(sysProp);
if(property == null) {
fail.setMessage("Can't resolve " + vm.group(0));
fail.perform();
}
}
// Get the FS path to the property file
if(property.startsWith("classpath:")) {
pfn = repoConfigPath + "/" + property.substring(10);
} else if(property.startsWith("file:")) {
pfn = property.substring(5);
} else {
pfn = property;
}
if(pfn != null) {
var pf = new File(pfn);
if(pf.exists()) {
propertiesDefs.push( property );
propertiesFiles.push( pf );
}
}
}
}
}
}
}
}
// If they gave a properties override file, that goes first
var propfile = project.getProperty("DB_PROPERTIES");
if(propfile != null) {
propertiesFiles.push( new File(propfile) );
propertiesDefs.push( propfile );
}
// Now load the files, in reverse order
for(var i=(propertiesFiles.length-1); i>=0; i--) {
var pf = propertiesFiles[i];
var property = propertiesDefs[i];
var echoT = project.createTask("echo");
echoT.setMessage("Loading DB property " + property);
echoT.perform();
var propertyT = project.createTask("property");
propertyT.setFile(pf);
propertyT.perform();
}
// Try to figure out what database engine they wanted
var dbtype = "unknown";
var dburl = project.getProperty("db.url");
if(dburl == null) {
fail.setMessage("No {db.url} property found, which is required");
fail.perform();
} else if(dburl.startsWith("jdbc:mysql://")) {
dbtype = "mysql";
// Master URL has no database name
var masterURL = "jdbc:mysql://";
if(dburl.indexOf(":///") == -1) {
// Copy the hostname over for the master URL
var tmp = dburl.substring(dburl.indexOf("://")+3);
masterURL += tmp.substring(0, tmp.indexOf("/"));
}
masterURL += "/";
project.setProperty("db.master.url", masterURL);
} else if(dburl.startsWith("jdbc:postgresql:")) {
dbtype = "postgresql";
// Master URL is to the special template1 database
var masterURL = "jdbc:postgresql:";
if(dburl.indexOf("://") != -1) {
// Copy the hostname over for the master URL
var tmp = dburl.substring(dburl.indexOf("://")+1);
masterURL += tmp.substring(0, tmp.indexOf("/",3)+1);
}
masterURL += "template1";
project.setProperty("db.master.url", masterURL);
} else if(dburl.startsWith("jdbc:oracle:")) {
dbtype = "oracle";
// Ensure we were given sys credentials too
if(project.getProperty("db.master.username") == null) {
fail.setMessage("Property db.master.username not given (normally 'sys as sysdba')");
fail.perform();
}
if(project.getProperty("db.master.password") == null) {
fail.setMessage("Property db.master.password not given");
fail.perform();
}
} else if(dburl.startsWith("jdbc:db2//")) {
dbtype = "db2"; // DB2 type 4
// We need the JDBC connection URL for the default database
var slashslash = dburl.indexOf("db2//");
var dbnameslash = dburl.indexOf("/", slashslash+6);
var masterURL = dburl.substring(0, dbnameslash) + "/default";
project.setProperty("db.master.url", masterURL);
} else if(dburl.startsWith("jdbc:db2:")) {
dbtype = "db2"; // DB2 type 2
project.setProperty("db.master.url", "jdbc:db2:default");
} else if(dburl.startsWith("jdbc:microsoft:sqlserver://")) {
// We need the JDBC connection URL for the master database
var masterURL = dburl.substring(0, dburl.indexOf(";databaseName=")) +
";databaseName=master";
fail.setMessage("The Microsoft SQL Server JDBC driver isn't supported, please use JTDS");
fail.perform();
} else if(dburl.startsWith("jdbc:jtds:sqlserver://")) {
dbtype = "mssql";
// We need the JDBC connection URL for the master database
var slashslash = dburl.indexOf("://");
var dbnameslash = dburl.indexOf("/", slashslash+4);
var masterURL = dburl.substring(0, dbnameslash) + "/master";
project.setProperty("db.master.url", masterURL);
}
project.setProperty("db.type",dbtype);
]]></script>
<echo message="DB Type is ${db.type}"/>
<echo message="DB Name is ${db.name}"/>
<echo message="DB Normal URL is ${db.url}"/>
<echo message="DB Master URL is ${db.master.url}"/>
</target>
<target name="-create-database"
depends="continuous-init, load-database-properties">
<antcall target="-create-database-${db.type}" />
</target>
<target name="-create-database-unknown">
<fail message="Unknown database type for JDBC url '${db.url}'" />
</target>
<target name="-create-database-mysql">
<sql driver="${db.driver}"
url="${db.master.url}"
classpathref="classpath.compile"
print="yes"
userid="${db.username}"
password="${db.password}">
create database if not exists ${db.name};
</sql>
</target>
<target name="-create-database-postgresql">
<!-- Note - PostGreSQL lacks a "if not exists" for creating databases -->
<!-- So, do it with ignoring of errors -->
<sql driver="${db.driver}"
url="${db.master.url}"
classpathref="classpath.compile"
print="yes"
autocommit="yes"
onerror="continue"
userid="${db.username}"
password="${db.password}">
create database ${db.name};
</sql>
</target>
<target name="-create-database-mssql">
<!-- MS SQL Server lacks a "if not exists" for creating databases -->
<!-- So, do it with ignoring of errors -->
<sql driver="${db.driver}"
url="${db.master.url}"
classpathref="classpath.compile"
print="yes"
autocommit="yes"
onerror="continue"
userid="${db.username}"
password="${db.password}">
CREATE DATABASE ${db.name};
ALTER DATABASE ${db.name} SET ALLOW_SNAPSHOT_ISOLATION ON;
</sql>
</target>
<target name="-create-database-oracle">
<!-- Really user + schema, rather than oracle database -->
<sql driver="${db.driver}"
url="${db.url}"
classpathref="classpath.compile"
print="yes"
userid="${db.master.username}"
password="${db.master.password}">
grant connect,resource to ${db.username} identified by ${db.password};
</sql>
</target>
<target name="-create-database-db2">
<!-- DB name must be <= 8 chars -->
<!-- Windows Only solution: Use db2 cmdline since no ability to create database via JDBC (not even using procedure call to "admin_cmd") :-( -->
<!-- increase logfilsz for certain unit tests that run large txns (see ALF-4241) -->
<exec executable="db2cmd">
<arg value="/w"/>
<arg value="db2 create database ${db.name} using codeset UTF-8 territory default pagesize 32 K&&db2 update database configuration for ${db.name} using logfilsiz 8192&&exit"/>
</exec>
</target>
<target name="-drop-database"
depends="continuous-init, load-database-properties">
<antcall target="-drop-database-${db.type}" />
<delete verbose="true">
<fileset dir="${basedir}"
includes="**/alfresco.log" />
</delete>
<delete dir="${dir.root}"
includeEmptyDirs="true" />
</target>
<target name="-drop-database-unknown">
<fail message="Unknown database type for JDBC url '${db.url}'" />
</target>
<target name="-drop-database-mysql" depends="init">
<sql driver="${db.driver}"
url="${db.master.url}"
classpathref="classpath.compile"
print="yes"
userid="${db.username}"
password="${db.password}">
drop database if exists ${db.name};
</sql>
</target>
<target name="-drop-database-postgresql" depends="init">
<sql driver="${db.driver}"
url="${db.master.url}"
classpathref="classpath.compile"
print="yes"
autocommit="yes"
userid="${db.username}"
password="${db.password}">
drop database if exists ${db.name};
</sql>
</target>
<target name="-drop-database-mssql" depends="init">
<!-- MS SQL Server lacks a "if exists" for dropping databases -->
<!-- So, do it with ignoring errors -->
<sql driver="${db.driver}"
url="${db.master.url}"
classpathref="classpath.compile"
print="yes"
autocommit="yes"
onerror="continue"
userid="${db.username}"
password="${db.password}">
drop database ${db.name};
</sql>
</target>
<target name="-drop-database-oracle" depends="init">
<!-- Really user + schema, rather than oracle database -->
<!-- Oracle lacks a "if exists" for dropping users -->
<!-- So, do it with ignoring of errors -->
<sql driver="${db.driver}"
url="${db.url}"
classpathref="classpath.compile"
print="yes"
autocommit="yes"
onerror="continue"
userid="${db.master.username}"
password="${db.master.password}">
drop user ${db.username} cascade;
</sql>
</target>
<target name="-drop-database-db2" depends="init">
<!-- Use db2 cmdline since no ability to drop database via JDBC (not even using procedure call to "admin_cmd") ??? -->
<exec executable="db2cmd">
<arg value="/c"/>
<arg value="db2 drop database ${db.name}"/>
</exec>
</target>
<!-- ***************** -->
<!-- ** WCM targets ** -->
<!-- ***************** -->
<target name="distribute-wcm"
description="Creates the distibution files for WCM"
depends="assemble-virtual">
<tar destfile="${dir.continuous.assemble}/temp.tar"
longfile="gnu">
<tarfileset dir="${dir.continuous.assemble.virtualtomcat}"
prefix="virtual-tomcat"
excludes="**/bin/*.sh" />
<tarfileset dir="${dir.continuous.assemble.virtualtomcat}/bin"
prefix="virtual-tomcat/bin"
includes="*.sh"
mode="755" />
<tarfileset dir="${dir.project.installer}"
includes="wcm-bootstrap-context.xml" />
<tarfileset dir="${dir.project.installer}/wcm-commands"
prefix="bin"
mode="755"/>
<tarfileset dir="${dir.project.webclient.xforms.examples}"
prefix="wcm-examples"
excludes="unit-tests/**" />
</tar>
<zip destfile="${dir.continuous.dist}/${file.name.dist.wcm}.zip">
<tarfileset src="${dir.continuous.assemble}/temp.tar"/>
</zip>
<delete quiet="yes" file="${dir.continuous.assemble}/temp.tar" />
</target>
<target name="assemble-virtual"
depends="continuous-init">
<mkdir dir="${dir.continuous.dist}" />
<delete quiet="yes"
includeEmptyDirs="true"
dir="${dir.continuous.assemble.virtualtomcat}" />
<unzip src="${dir.name.binaries}/tomcat/${file.name.zip.tomcatvirt.custom}"
dest="${dir.continuous.assemble}" />
<move file="${dir.continuous.assemble}/${file.name.base.zip.tomcatvirt.custom}"
tofile="${dir.continuous.assemble.virtualtomcat}" />
<move file="${dir.continuous.assemble.virtualtomcat}/server/lib/servlets-ssi.renametojar"
tofile="${dir.continuous.assemble.virtualtomcat}/server/lib/servlets-ssi.jar" />
<deploy-virtual-tomcat location="${dir.continuous.assemble.virtualtomcat}" />
</target>
<target name="assemble-commands"
depends="package-bm-remote, package-mmt, assemble-commands-init, assemble-command-extras"/>
<target name="assemble-commands-init">
<mkdir dir="${dir.continuous.assemble.commands}" />
<copy todir="${dir.continuous.assemble.commands}">
<fileset dir="${dir.project.jlan}/jni" />
</copy>
<copy todir="${dir.continuous.assemble.commands}">
<fileset dir="${dir.installer.bitrock}/bitrock/alfresco/commands" />
</copy>
</target>
<target name="assemble-tomcat"
depends="continuous-init, set-build-number">
<mkdir dir="${dir.continuous.dist}" />
<!-- copy project files common to both platforms -->
<copy todir="${dir.continuous.assemble.tomcat}/webapps">
<fileset dir="${dir.project.webclient.dist}"
includes="${file.name.war.webclient}" />
<fileset dir="${dir.project.slingshot.dist}"
includes="${file.name.war.slingshot}" />
</copy>
<!-- Copy any required common libs -->
<copy todir="${dir.continuous.assemble.tomcat}/lib"
file="${dir.project.3rdparty.lib}/devenv/${file.name.jar.postgres.connector}" />
<copy todir="${dir.continuous.assemble.tomcat}/endorsed"
file="${dir.project.3rdparty.lib}/${dir.name.xalan}/${file.name.jar.xalan}" />
<copy todir="${dir.continuous.assemble.tomcat}/endorsed"
file="${dir.project.3rdparty.lib}/${dir.name.xalan}/${file.name.jar.serializer}" />
<!-- Add config to shared location -->
<copy todir="${dir.continuous.assemble.tomcat}/shared/classes/alfresco/extension">
<fileset dir="${dir.project.repository.config}/alfresco/extension" />
<fileset dir="${dir.project.webclient.config}/alfresco/extension" />
<fileset dir="${dir.project.datamodel.config}/alfresco/extension" />
</copy>
<copy todir="${dir.continuous.assemble.tomcat}/shared/classes"
file="${dir.project.repository.config}/alfresco-global.properties.sample" />
<copy todir="${dir.continuous.assemble.tomcat}/shared/classes/alfresco/web-extension">
<fileset dir="${dir.project.slingshot.config}/alfresco/web-extension" />
</copy>
<copy todir="${dir.continuous.assemble.tomcat}/shared/classes/alfresco/messages">
<fileset dir="${dir.project.installer.messages}" />
</copy>
</target>
<!-- *********************** -->
<!-- ** Installer targets ** -->
<!-- *********************** -->
<!-- Try and pick appropriate exe - assumes mac=OSX and unix=Linux -->
<target name="set-bitrock-builder">
<condition property="platformExe" value="${file.name.bitrock.exe.win}">
<os family="windows" />
</condition>
<condition property="platformExe" value="${file.name.bitrock.exe.osx}">
<os family="mac" />
</condition>
<condition property="platformExe" value="${file.name.bitrock.exe.linux}">
<os family="unix" />
</condition>
<property name="file.name.bitrock.license.xml" location="${dir.name.binaries}/build-classpath/license.xml"/>
<echo message="Using binaries_folder=${dir.name.binaries}, file.name.bitrock.license.xml=${file.name.bitrock.license.xml}"/>
</target>
<!-- BitRock installer targets:
PLEASE NOTE: It is not possible to use these targets as an argument to ant as they will fail due to missing
properties. They must be called via the "distribute-installers" target to ensure dependencies are
configured. This is a limitation caused by allowing the targets to be called in parallel avoiding
multiple dependency invocation (see ant docs for more information). Instead use the targets with
the same name but prefixed by "build-"
-->
<target name="windows-32-bit-installer">
<exec dir="${dir.installer.bitrock}" executable="${platformExe}" output="build/error-install-win.txt" failifexecutionfails="true">
<arg line='${installer.build.type} project.xml windows ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars ${installer.build.args} "project.fullName=Alfresco ${file.name.codeline} (Evaluation Use Only)" project.installerFilename="${file.name.dist.installer.win}" binaries_folder="${installer.build.binaries.win32}"'/>
</exec>
</target>
<target name="windows-64-bit-installer">
<exec dir="${dir.installer.bitrock}" executable="${platformExe}" output="build/error-install-win64.txt" failifexecutionfails="true">
<arg line='${installer.build.type} project.xml windows ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars ${installer.build.args} project.installerFilename="${file.name.dist.installer.win64}" binaries_folder="${installer.build.binaries.win64}"'/>
</exec>
</target>
<target name="windows-deployment-installer">
<exec dir="${dir.installer.deploy}" executable="${platformExe}" output="build/error-deploy-win.txt" failifexecutionfails="true">
<arg line='${installer.build.type} deployment.xml windows ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars "project.outputDirectory=${dir.continuous.dist}" "project.version=${file.name.exe.version}" "project.fullName=Alfresco ${file.name.codeline} Deployment" project.installerFilename="${file.name.dist.deployment.win}"'/>
</exec>
</target>
<target name="osx-installer">
<exec dir="${dir.installer.bitrock}" executable="${platformExe}" output="build/error-install-osx.txt" failifexecutionfails="false">
<arg line='${installer.build.type} project.xml osx ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars ${installer.build.args} "project.fullName=Alfresco ${file.name.codeline} (Evaluation Use Only)" project.installerFilename="${file.name.dist.installer.osx}" binaries_folder="${installer.build.binaries.osx86}"'/>
</exec>
<tar destfile="${dir.continuous.dist}/${file.name.dist.installer.osx}.tar.gz"
longfile="gnu"
compression="gzip">
<tarfileset dir="${dir.continuous.dist}/${file.name.dist.installer.osx}"
prefix="${file.name.dist.installer.osx}" mode="755"/>
</tar>
</target>
<target name="osx-deployment-installer">
<exec dir="${dir.installer.deploy}" executable="${platformExe}" output="build/error-deploy-osx.txt" failifexecutionfails="false">
<arg line='${installer.build.type} deployment.xml osx ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars "project.outputDirectory=${dir.continuous.dist}" "project.version=${file.name.exe.version}" "project.fullName=Alfresco ${file.name.codeline} Deployment" project.installerFilename="${file.name.dist.deployment.osx}"'/>
</exec>
<tar destfile="${dir.continuous.dist}/${file.name.dist.deployment.osx}.tar.gz"
longfile="gnu"
compression="gzip">
<tarfileset dir="${dir.continuous.dist}/${file.name.dist.deployment.osx}"
prefix="${file.name.dist.deployment.osx}" mode="755"/>
</tar>
</target>
<target name="linux-64-bit-installer">
<exec dir="${dir.installer.bitrock}" executable="${platformExe}" output="build/error-install-linux64.txt" failifexecutionfails="true">
<arg line='${installer.build.type} project.xml linux-x64 ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars ${installer.build.args} project.installerFilename="${file.name.dist.installer.linux64}" binaries_folder="${installer.build.binaries.lin64}"'/>
</exec>
</target>
<target name="linux-deployment-installer">
<exec dir="${dir.installer.deploy}" executable="${platformExe}" output="build/error-deploy-linux.txt" failifexecutionfails="true">
<arg line='${installer.build.type} deployment.xml linux ${installer.package.type} --license ${file.name.bitrock.license.xml} --setvars "project.outputDirectory=${dir.continuous.dist}" "project.version=${file.name.exe.version}" "project.fullName=Alfresco ${file.name.codeline} Deployment" project.installerFilename="${file.name.dist.deployment.linux}"'/>
</exec>
</target>
<!-- Targets for building BitRock installer for specific platforms -->
<target name="build-windows-32-bit-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="windows-32-bit-installer"/>
</target>
<target name="build-windows-64-bit-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="windows-64-bit-installer"/>
</target>
<target name="build-windows-deployment-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="windows-deployment-installer"/>
</target>
<target name="build-osx-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="osx-installer"/>
</target>
<target name="build-osx-deployment-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="osx-deployment-installer"/>
</target>
<target name="build-linux-64-bit-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="linux-64-bit-installer"/>
</target>
<target name="build-linux-deployment-installer"
depends="continuous-init, set-build-number, set-bitrock-builder">
<antcall target="linux-deployment-installer"/>
</target>
<!-- Build installers in parallel -->
<target name="distribute-installers"
depends="continuous-init, set-build-number, set-bitrock-builder" >
<parallel threadCount="2" failonany="true">
<antcall target="windows-32-bit-installer"/>
<antcall target="windows-64-bit-installer"/>
<antcall target="windows-deployment-installer"/>
<antcall target="osx-installer"/>
<antcall target="osx-deployment-installer"/>
<antcall target="linux-64-bit-installer"/>
<antcall target="linux-deployment-installer"/>
</parallel>
</target>
<!-- ***************** -->
<!-- ** WAR targets ** -->
<!-- ***************** -->
<target name="distribute-war"
description="Creates the WAR file distribution for all platforms"
depends="continuous-init" >
<mkdir dir="${dir.continuous.dist}" />
<tar destfile="${dir.continuous.assemble}/temp.tar"
longfile="gnu">
<tarfileset dir="${dir.installer.bitrock}"
includes="licenses/**" />
<tarfileset dir="${dir.installer.bitrock}"
includes="README.txt" />
<tarfileset dir="${dir.continuous.assemble.tomcat}"
prefix="web-server" />
<tarfileset dir="${dir.project.installer}/war-commands"
prefix="bin"
mode="755"/>
<!-- Only DLLs and JARs from assemble area -->
<tarfileset dir="${dir.continuous.assemble.commands}"
prefix="bin"
includes="**/*.dll,**/*.jar"/>
</tar>
<zip destfile="${dir.continuous.dist}/${file.name.dist.war}.zip">
<tarfileset src="${dir.continuous.assemble}/temp.tar"/>
</zip>
<delete quiet="yes" file="${dir.continuous.assemble}/temp.tar" />
</target>
<target name="distribute-solr"
description="Creates the ZIP file of the sample SOLR installation"
depends="set-build-number, deploy-solr">
<mkdir dir="${dir.continuous.dist}" />
<zip destfile="${dir.continuous.dist}/${file.name.dist.solr}.zip">
<zipfileset dir="${dir.project.solr.instance}" />
</zip>
</target>
<!-- ******************************** -->
<!-- ** Web Service Client targets ** -->
<!-- ******************************** -->
<target name="distribute-webserviceclient"
description="Creates the web service client distribution file for all platforms"
depends="continuous-init">
<mkdir dir="${dir.continuous.dist}" />
<zip destfile="${dir.continuous.dist}/${file.name.dist.webserviceclient}.zip">
<zipfileset dir="${dir.project.webserviceclient.dist}" />
<zipfileset dir="${dir.project.webserviceclient.config}/alfresco"
prefix="alfresco"/>
<fileset file="${dir.project.webserviceclient}/README_ws_client.txt" />
</zip>
</target>
<!-- ************************ -->
<!-- ** Quick Start Bundle ** -->
<!-- ************************ -->
<target name="distribute-wcmqs-extension">
<tar destfile="${dir.continuous.assemble}/temp.tar"
longfile="gnu">
<tarfileset dir="${dir.module.wcmquickstart.dist}" includes="${file.name.amp.wcmquickstart}" />
<tarfileset dir="${dir.module.wcmquickstart-share.dist}" includes="${file.name.amp.wcmquickstart-share}" />
<tarfileset dir="${dir.module.wcmquickstart.dist}" includes="${file.name.amp.wcmquickstart}" />
<tarfileset dir="${dir.project.webeditor.dist}" includes="${file.name.war.webeditor}" />
<tarfileset dir="${dir.module.wcmquickstart}" includes="README_wcmqs.txt" />
<tarfileset dir="${dir.project.wcmquickstart-webapp.config}/alfresco/web-extension" includes="**/*" />
<tarfileset dir="${dir.continuous.assemble}" includes="${file.name.war.webeditor}, ${file.name.war.wcmquickstart-webapp}" />
</tar>
<zip destfile="${dir.continuous.dist}/${file.name.dist.wcmqs}.zip">
<tarfileset src="${dir.continuous.assemble}/temp.tar"/>
</zip>
<delete quiet="yes" file="${dir.continuous.assemble}/temp.tar" />
</target>
<!-- ************************ -->
<!-- ** Deployment targets ** -->
<!-- ************************ -->
<target name="distribute-deployment"
depends="continuous-init, set-build-number"
description="Creates a zip file containing the deployment receiver">
<mkdir dir="${dir.continuous.dist}" />
<copy file="${dir.project.deployment.dist}/${file.name.zip.deployment}"
tofile="${dir.continuous.dist}/${file.name.dist.deployment}.zip" />
</target>
<!-- ************************************ -->
<!-- ** Module Management Tool targets ** -->
<!-- ************************************ -->
<target name="assemble-mmt"
depends="continuous-init">
<!-- Create the required directory structure -->
<mkdir dir="${dir.continuous.dist}" />
<mkdir dir="${dir.continuous.assemble.mmt}" />
<!-- extract the one-jar file -->
<unjar src="${dir.project.3rdparty.lib}/one-jar/one-jar-boot-0.96-RC4.jar"
dest="${dir.continuous.assemble.mmt}"
overwrite="true" />
<!-- remove unwanted files -->
<delete >
<fileset dir="${dir.continuous.assemble.mmt}">
<include name="**/*.java" />
<include name="**/boot-manifest.mf" />
</fileset>
</delete>
<!-- copy required jars into lib folder -->
<copy todir="${dir.continuous.assemble.mmt}/lib"
flatten="false">
<fileset dir="${dir.project.3rdparty.lib}"
includes="**/jug-asl-2.0.0.jar" />
<fileset dir="${dir.project.3rdparty.lib}"
includes="**/truezip.jar" />
</copy>
<!-- unjar the spring surf core JAR -->
<unjar dest="${dir.continuous.assemble.mmt}/tmp-spring-surf" overwrite="true">
<fileset dir="${dir.project.3rdparty.lib}/spring-surf" includes="spring-surf-core-*.jar" />
</unjar>
<!-- get the files for the main mmt jar -->
<copy todir="${dir.continuous.assemble.mmt}/tmp-mmt-jar"
flatten="false">
<fileset dir="${dir.project.core.classes}"
includes="org/alfresco/error/AlfrescoRuntimeException.class" />
<fileset dir="${dir.project.core.classes}"
includes="org/alfresco/util/Pair.class" />
<fileset dir="${dir.project.core.classes}"
includes="org/alfresco/util/VersionNumber.class" />
<fileset dir="${dir.continuous.assemble.mmt}/tmp-spring-surf"
includes="org/springframework/extensions/surf/util/I18NUtil.class" />
<fileset dir="${dir.continuous.assemble.mmt}/tmp-spring-surf"
includes="org/springframework/extensions/surf/util/ISO8601DateFormat.class" />
<fileset dir="${dir.continuous.assemble.mmt}/tmp-spring-surf"
includes="org/springframework/extensions/surf/exception/PlatformRuntimeException.class" />
<fileset dir="${dir.project.repository.classes}"
includes="org/alfresco/repo/module/tool/default-file-mapping.properties" />
<fileset dir="${dir.project.repository.classes}"
includes="org/alfresco/repo/module/**/*.class" />
<fileset dir="${dir.project.repository.classes}"
includes="org/alfresco/service/cmr/module/**/*.class" />
</copy>
<!-- copy in a manifest file -->
<copy tofile="${dir.continuous.assemble.mmt}/tmp-mmt-jar/META-INF/MANIFEST.MF" >
<fileset dir="${dir.project.repository}/source/meta-inf"
includes="mmt-manifest.mf" />
</copy>
<!-- jar the main mmt classes -->
<mkdir dir="${dir.continuous.assemble.mmt}/main" />
<jar destfile="${dir.continuous.assemble.mmt}/main/main.jar"
manifest="${dir.continuous.assemble.mmt}/tmp-mmt-jar/META-INF/MANIFEST.MF"
update="false" >
<fileset dir="${dir.continuous.assemble.mmt}/tmp-mmt-jar">
<include name="**/*" />
</fileset>
</jar>
<!-- Remove temp files -->
<delete dir="${dir.continuous.assemble.mmt}/tmp-mmt-jar" />
<delete dir="${dir.continuous.assemble.mmt}/tmp-spring-surf" />
</target>
<target name="package-mmt"
depends="assemble-mmt"
description="Creates the Alfresco Module Management Tool distribution file for all platforms">
<mkdir dir="${dir.continuous.assemble.commands}" />
<zip destfile="${dir.continuous.assemble.commands}/${file.name.dist.mmt}.jar">
<zipfileset dir="${dir.continuous.assemble.mmt}" />
</zip>
</target>
<!-- ************************************ -->
<!-- ** Benchmark Remote targets ** -->
<!-- ************************************ -->
<target name="assemble-bm-remote"
depends="continuous-init">
<!-- Create the required directory structure -->
<mkdir dir="${dir.continuous.dist}" />
<mkdir dir="${dir.continuous.assemble.bm-remote}" />
<!-- extract the one-jar file -->
<unjar src="${dir.project.3rdparty.lib}/one-jar/one-jar-boot-0.96-RC4.jar"
dest="${dir.continuous.assemble.bm-remote}"
overwrite="true" />
<!-- remove unwanted files -->
<delete >
<fileset dir="${dir.continuous.assemble.bm-remote}">
<include name="**/*.java" />
<include name="**/boot-manifest.mf" />