forked from liferay/liferay-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-common-ivy.xml
869 lines (762 loc) · 25 KB
/
build-common-ivy.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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common-ivy" xmlns:antelope="antlib:ise.antelope.tasks" xmlns:artifact="antlib:org.apache.maven.artifact.ant" xmlns:ivy="antlib:org.apache.ivy.ant">
<basename property="basedir.name" file="${basedir}" />
<propertyregex
input="${basedir.name}"
property="ivy.module.name"
regexp="(.*)\-(.*)$"
select="com.liferay.\1"
/>
<propertyregex
input="${ivy.module.name}"
override="true"
property="ivy.module.name"
regexp="\-"
replace="\."
/>
<macrodef name="mirrors-get">
<attribute name="dest" />
<attribute default="false" name="ignoreerrors" />
<attribute name="src" />
<attribute default="true" name="trylocalnetwork" />
<attribute default="false" name="verbose" />
<sequential>
<propertyregex
input="@{src}"
override="true"
property="mirrors.cache.artifact.subdir"
regexp="https?://(.+/).+"
replace="\1"
/>
<property name="mirrors.cache.artifact.dir" value="${mirrors.cache.dir}/${mirrors.cache.artifact.subdir}" />
<propertyregex
input="@{src}"
override="true"
property="mirrors.cache.artifact.file.name"
regexp=".+/(.+)"
replace="\1"
/>
<if>
<not>
<available file="${mirrors.cache.artifact.dir}/${mirrors.cache.artifact.file.name}" />
</not>
<then>
<mkdir dir="${mirrors.cache.artifact.dir}" />
<propertyregex
input="@{src}"
override="true"
property="mirrors.src"
regexp="http://"
replace="http://mirrors.lax.liferay.com/"
/>
<if>
<equals arg1="@{trylocalnetwork}" arg2="true" />
<then>
<trycatch>
<try>
<get
dest="${mirrors.cache.artifact.dir}"
ignoreerrors="@{ignoreerrors}"
src="${mirrors.src}"
verbose="@{verbose}"
/>
</try>
<catch>
<get
dest="${mirrors.cache.artifact.dir}"
ignoreerrors="@{ignoreerrors}"
src="@{src}"
verbose="@{verbose}"
/>
</catch>
</trycatch>
</then>
<else>
<get
dest="${mirrors.cache.artifact.dir}"
ignoreerrors="@{ignoreerrors}"
src="@{src}"
verbose="@{verbose}"
/>
</else>
</if>
</then>
</if>
<if>
<available file="@{dest}" type="dir" />
<then>
<copy
file="${mirrors.cache.artifact.dir}/${mirrors.cache.artifact.file.name}"
tofile="@{dest}/${mirrors.cache.artifact.file.name}"
/>
</then>
<else>
<copy
file="${mirrors.cache.artifact.dir}/${mirrors.cache.artifact.file.name}"
tofile="@{dest}"
/>
</else>
</if>
<var name="mirrors.cache.artifact.dir" unset="true" />
<var name="mirrors.cache.artifact.file.name" unset="true" />
<var name="mirrors.cache.artifact.subdir" unset="true" />
<var name="mirrors.src" unset="true" />
</sequential>
</macrodef>
<if>
<not>
<available file="${ivy.home}/ivy-${ivy.version}.jar" />
</not>
<then>
<mkdir dir="${ivy.home}" />
<mirrors-get
dest="${ivy.home}/ivy-${ivy.version}.jar"
src="${ivy.jar.url}"
/>
</then>
</if>
<path id="ivy.lib.path">
<fileset
dir="${ivy.home}"
includes="ivy-${ivy.version}.jar"
/>
<fileset
dir="${sdk.dir}/lib"
includes="bcpg-jdk16.jar,bcprov-jdk16.jar"
/>
</path>
<taskdef classpathref="ivy.lib.path" resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" />
<pathconvert property="sdk.dependencies.dir" targetos="unix">
<path location="${sdk.dir}/dependencies" />
</pathconvert>
<path id="sdk.dependencies.path">
<dirset dir="${sdk.dir}" includes="dependencies/*" />
</path>
<pathconvert pathsep="," property="sdk.dependencies.path" refid="sdk.dependencies.path" targetos="unix" />
<macrodef name="record-git-commit-snapshot">
<sequential>
<loadfile srcfile="maven.deploy.log" property="maven.deploy.log.content" />
<propertyregex
input="${maven.deploy.log.content}"
override="true"
property="snapshot.tstamp"
regexp="${plugin.name}-${plugin.full.version}-([\d.-]+)\.jar"
select="\1"
/>
<property file="bnd.bnd" prefix="bnd." />
<git-head-hash
path="${basedir}"
property="module.snapshot.git.hash"
/>
<propertyregex
input="${sonatype.url}"
property="cdn.sonatype.url"
regexp="https://"
replace="http://cdn."
/>
<echo file="snapshot.properties">
module.snapshot.git.hash=${module.snapshot.git.hash}
module.snapshot.url=${cdn.sonatype.url}/com/liferay/${bnd.Bundle-SymbolicName}/${bnd.Bundle-Version}-SNAPSHOT/${bnd.Bundle-SymbolicName}-${bnd.Bundle-Version}-${snapshot.tstamp}.jar
</echo>
<var name="maven.deploy.log.content" unset="true" />
<var name="module.snapshot.git.hash" unset="true" />
<var name="snapshot.tstamp" unset="true" />
</sequential>
</macrodef>
<macrodef name="set-build-xml-var">
<attribute name="bnd.property.key" default="" />
<attribute name="build.xml.var.name" />
<attribute name="module.dir" />
<sequential>
<if>
<and>
<available file="@{module.dir}/bnd.bnd" />
<not>
<equals arg1="@{bnd.property.key}" arg2="" />
</not>
</and>
<then>
<var name="module.bnd.@{bnd.property.key}" unset="true" />
<loadproperties prefix="module.bnd.">
<file file="@{module.dir}/bnd.bnd" />
</loadproperties>
<propertycopy
from="module.bnd.@{bnd.property.key}"
name="module.bnd.property.value"
override="true"
silent="true"
/>
<if>
<isset property="module.bnd.property.value" />
<then>
<var name="set-build-xml-var.return" value="${module.bnd.property.value}" />
</then>
<else>
<set-build-xml-var-from-build-xml
build.xml.var.name="@{build.xml.var.name}"
module.dir="@{module.dir}"
/>
</else>
</if>
</then>
<else>
<set-build-xml-var-from-build-xml
build.xml.var.name="@{build.xml.var.name}"
module.dir="@{module.dir}"
/>
</else>
</if>
</sequential>
</macrodef>
<macrodef name="set-build-xml-var-from-build-xml">
<attribute name="build.xml.var.name" />
<attribute name="module.dir" />
<sequential>
<loadfile property="set-build-xml-var.build.xml.content" srcFile="@{module.dir}/build.xml" />
<antelope:stringutil string="${set-build-xml-var.build.xml.content}" property="set-build-xml-var.value.beginindex">
<antelope:indexof string="property name="@{build.xml.var.name}" value="" fromindex="0" />
</antelope:stringutil>
<if>
<equals arg1="${set-build-xml-var.value.beginindex}" arg2="-1" />
<then>
<var name="set-build-xml-var.return" unset="true" />
</then>
<else>
<antelope:stringutil string="${set-build-xml-var.build.xml.content}" property="set-build-xml-var.value.beginindex">
<antelope:indexof string="value="" fromindex="${set-build-xml-var.value.beginindex}" />
</antelope:stringutil>
<antelope:math
datatype="int"
operand1="${set-build-xml-var.value.beginindex}"
operand2="7"
operation="+"
result="set-build-xml-var.value.beginindex"
/>
<antelope:stringutil string="${set-build-xml-var.build.xml.content}" property="set-build-xml-var.value.endindex">
<antelope:indexof string=""" fromindex="${set-build-xml-var.value.beginindex}" />
</antelope:stringutil>
<antelope:stringutil string="${set-build-xml-var.build.xml.content}" property="set-build-xml-var.return">
<antelope:substring beginindex="${set-build-xml-var.value.beginindex}" endindex="${set-build-xml-var.value.endindex}" />
</antelope:stringutil>
</else>
</if>
<var name="set-build-xml-var.build.xml.content" unset="true" />
</sequential>
</macrodef>
<macrodef name="set-module-properties">
<attribute name="module.dir" />
<sequential>
<var name="module.dir.unix" unset="true" />
<pathconvert property="module.dir.unix" targetos="unix">
<path location="@{module.dir}" />
</pathconvert>
<var name="module.auto.deploy.dir" unset="true" />
<var name="original.lib.name" unset="true" />
<var name="original.lib.version" unset="true" />
<var name="original.lib.url" unset="true" />
<var name="plugin.full.version" unset="true" />
<var name="plugin.jars" unset="true" />
<var name="plugin.required.contexts" unset="true" />
<var name="plugin.tlds" unset="true" />
<var name="plugin.version" unset="true" />
<set-build-xml-var
build.xml.var.name="auto.deploy.dir"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="module.auto.deploy.dir" value="${set-build-xml-var.return}" />
</then>
<else>
<var name="module.auto.deploy.dir" value="${auto.deploy.dir}" />
</else>
</if>
<set-build-xml-var
build.xml.var.name="original.lib.name"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="original.lib.name" value="${set-build-xml-var.return}" />
</then>
</if>
<set-build-xml-var
build.xml.var.name="original.lib.version"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="original.lib.version" value="${set-build-xml-var.return}" />
</then>
</if>
<set-build-xml-var
build.xml.var.name="original.lib.url"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="original.lib.url" value="${set-build-xml-var.return}" />
</then>
</if>
<if>
<available file="@{module.dir}/docroot/WEB-INF/liferay-plugin-package.properties" />
<then>
<var name="plugin-package.module-incremental-version" unset="true" />
<var name="plugin-package.portal-dependency-jars" unset="true" />
<var name="plugin-package.portal-dependency-tlds" unset="true" />
<var name="plugin-package.required-deployment-contexts" unset="true" />
<property file="@{module.dir}/docroot/WEB-INF/liferay-plugin-package.properties" prefix="plugin-package" />
<if>
<isset property="plugin-package.module-full-version" />
<then>
<var name="plugin.full.version" value="${plugin-package.module-full-version}" />
</then>
</if>
<var name="plugin.jars" value="${plugin-package.portal-dependency-jars}" />
<var name="plugin.required.contexts" value="${plugin-package.required-deployment-contexts}" />
<var name="plugin.tlds" value="${plugin-package.portal-dependency-tlds}" />
<var name="plugin.version" value="${plugin-package.module-incremental-version}" />
</then>
<else>
<set-build-xml-var
build.xml.var.name="plugin.version"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="plugin.version" value="${set-build-xml-var.return}" />
</then>
<else>
<var name="plugin.version" value="1" />
</else>
</if>
<set-build-xml-var
bnd.property.key="Bundle-Version"
build.xml.var.name="plugin.full.version"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="plugin.full.version" value="${set-build-xml-var.return}" />
</then>
</if>
</else>
</if>
<if>
<not>
<isset property="plugin.full.version" />
</not>
<then>
<var name="plugin.full.version" value="${lp.version}.${plugin.version}${lp.version.file.suffix}" />
</then>
</if>
<set-build-xml-var
bnd.property.key="Bundle-SymbolicName"
build.xml.var.name="plugin.name"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="plugin.name" value="${set-build-xml-var.return}" />
</then>
<else>
<if>
<equals arg1="@{module.dir}" arg2="." />
<then>
<var name="plugin.name" value="${ant.project.name}" />
</then>
<else>
<antelope:grep
group="1"
in="@{module.dir}"
property="plugin.name"
regex="(?:.*[/\\])(.*)"
/>
</else>
</if>
</else>
</if>
<set-build-xml-var
build.xml.var.name="theme.parent"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="theme.parent" value="${set-build-xml-var.return}" />
</then>
<else>
<var name="theme.parent" unset="true" />
</else>
</if>
<set-build-xml-var
build.xml.var.name="theme.type"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="theme.type" value="${set-build-xml-var.return}" />
</then>
<else>
<var name="theme.type" unset="true" />
</else>
</if>
<if>
<and>
<or>
<antelope:endswith string="${plugin.name}" with="-ext" />
<antelope:endswith string="${plugin.name}" with="-hook" />
<antelope:endswith string="${plugin.name}" with="-layouttpl" />
<antelope:endswith string="${plugin.name}" with="-portlet" />
<antelope:endswith string="${plugin.name}" with="-theme" />
<antelope:endswith string="${plugin.name}" with="-web" />
</or>
<not>
<resourcecontains
resource="${module.dir.unix}/build.xml"
substring="/build-common-osgi-plugin.xml""
/>
</not>
</and>
<then>
<var name="plugin.packaging" value="war" />
</then>
<else>
<var name="plugin.packaging" value="jar" />
</else>
</if>
<var name="plugin.file" value="${sdk.dir}/dist/${plugin.name}-${plugin.full.version}.${plugin.packaging}" />
<var name="plugin.javadoc.file" value="${sdk.dir}/dist/${plugin.name}-${plugin.full.version}-javadoc.zip" />
<var name="plugin.pom.file" value="${sdk.dir}/dist/${plugin.name}-${plugin.full.version}.pom" />
<var name="plugin.sources.file" value="${sdk.dir}/dist/${plugin.name}-${plugin.full.version}-sources.${plugin.packaging}" />
<var name="plugin.src.file" value="${sdk.dir}/dist/${plugin.name}-src-${plugin.full.version}.zip" />
<var name="plugin.wsdd.file" value="${sdk.dir}/dist/${plugin.name}-wsdd-${plugin.full.version}.jar" />
<if>
<available file="@{module.dir}/src" />
<then>
<var name="plugin.classes.dir" value="@{module.dir}/classes" />
<var name="plugin.lib.dir" value="@{module.dir}/lib" />
<var name="plugin.source.dir" value="@{module.dir}/src" />
<if>
<available file="@{module.dir}/lib" />
<then>
<path id="plugin-lib.classpath">
<fileset dir="@{module.dir}/lib" includes="*.jar" />
<pathelement location="@{module.dir}/classes" />
</path>
</then>
<else>
<path id="plugin-lib.classpath">
<pathelement location="@{module.dir}/classes" />
</path>
</else>
</if>
</then>
<else>
<var name="plugin.classes.dir" value="@{module.dir}/docroot/WEB-INF/classes" />
<var name="plugin.lib.dir" value="@{module.dir}/docroot/WEB-INF/lib" />
<var name="plugin.source.dir" value="@{module.dir}/docroot/WEB-INF/src" />
<if>
<available file="@{module.dir}/tmp" />
<then>
<path id="plugin-lib.classpath">
<fileset dir="@{module.dir}/docroot/WEB-INF/lib" erroronmissingdir="false" includes="*.jar" />
<fileset dir="@{module.dir}/tmp/WEB-INF/lib" erroronmissingdir="false" includes="*.jar" />
<pathelement location="@{module.dir}/docroot/WEB-INF/classes" />
<pathelement location="@{module.dir}/tmp/WEB-INF/classes" />
</path>
</then>
<else>
<path id="plugin-lib.classpath">
<fileset dir="@{module.dir}/docroot/WEB-INF/lib" erroronmissingdir="false" includes="*.jar" />
<pathelement location="@{module.dir}/docroot/WEB-INF/classes" />
</path>
</else>
</if>
</else>
</if>
<if>
<resourcecontains
resource="${module.dir.unix}/build.xml"
substring="/build-common-osgi-plugin.xml""
/>
<then>
<property name="plugin-lib.classpath.path" refid="plugin-lib.classpath" />
<set-build-xml-var
build.xml.var.name="ignore.osgi.portal.classpath"
module.dir="@{module.dir}"
/>
<path id="plugin-lib.classpath">
<fileset dir="@{module.dir}/lib" erroronmissingdir="false" includes="*.jar" />
<pathelement path="${plugin-lib.classpath.path}" />
<path refid="portal.classpath" />
</path>
<var name="plugin-lib.classpath.path" unset="true" />
</then>
</if>
<set-build-xml-var
build.xml.var.name="plugin-lib.additional.dir"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<property name="plugin-lib.classpath.path" refid="plugin-lib.classpath" />
<path id="plugin-lib.classpath">
<fileset dir="@{module.dir}/${set-build-xml-var.return}" includes="*.jar" />
<pathelement path="${plugin-lib.classpath.path}" />
</path>
<var name="plugin-lib.classpath.path" unset="true" />
</then>
</if>
<set-build-xml-var
build.xml.var.name="ivy.resolve.transitive.dependencies"
module.dir="@{module.dir}"
/>
<if>
<isset property="set-build-xml-var.return" />
<then>
<var name="plugin.ivy.resolve.transitive.dependencies" value="${set-build-xml-var.return}" />
</then>
<else>
<var name="plugin.ivy.resolve.transitive.dependencies" value="${ivy.resolve.transitive.dependencies}" />
</else>
</if>
</sequential>
</macrodef>
<macrodef name="process-ivy">
<attribute default="${basedir}" name="module.dir" />
<sequential>
<for list="@{module.dir},${sdk.dir},${sdk.dependencies.path}" param="ivy.xml.dir">
<sequential>
<if>
<available file="@{ivy.xml.dir}/ivy.xml" />
<then>
<checksum file="@{ivy.xml.dir}/ivy.xml" verifyproperty="ivy.xml.unmodified" />
<if>
<isfalse value="${ivy.xml.unmodified}" />
<then>
<var name="plugin.ivy.resolve.transitive.dependencies" unset="true" />
<if>
<and>
<available file="@{ivy.xml.dir}/bnd.bnd" />
<available file="@{ivy.xml.dir}/build.xml" />
</and>
<then>
<set-module-properties
module.dir="@{ivy.xml.dir}"
/>
</then>
<else>
<var name="plugin.ivy.resolve.transitive.dependencies" value="${ivy.resolve.transitive.dependencies}" />
</else>
</if>
<ivy:settings file="${ivy.custom.settings.file}" />
<if>
<antelope:endswith string="@{module.dir}" with="solr4-shared" />
<then>
<var name="ivy.checksums" value="" />
</then>
</if>
<ivy:resolve
conf="default,internal,provided"
file="@{ivy.xml.dir}/ivy.xml"
log="${ivy.log.level}"
transitive="${plugin.ivy.resolve.transitive.dependencies}"
/>
<var name="ivy.checksums" unset="true" />
<if>
<not>
<available file="@{ivy.xml.dir}/docroot" />
</not>
<then>
<ivy:retrieve
log="${ivy.log.level}"
overwriteMode="always"
pattern="@{ivy.xml.dir}/lib/[artifact].[ext]"
type="bundle,eclipse-plugin,jar,maven-plugin,orbit"
/>
<ivy:retrieve
log="${ivy.log.level}"
overwriteMode="always"
pattern="@{ivy.xml.dir}/lib/[artifact]-[type]s.[ext]"
type="source"
/>
</then>
<else>
<ivy:retrieve
log="${ivy.log.level}"
overwriteMode="always"
pattern="@{ivy.xml.dir}/docroot/WEB-INF/lib/[artifact].[ext]"
type="bundle,eclipse-plugin,jar,maven-plugin,orbit"
/>
<ivy:retrieve
log="${ivy.log.level}"
overwriteMode="always"
pattern="@{ivy.xml.dir}/docroot/WEB-INF/lib/[artifact]-[type]s.[ext]"
type="source"
/>
</else>
</if>
<checksum file="@{ivy.xml.dir}/ivy.xml" forceoverwrite="true" />
</then>
</if>
<var name="ivy.xml.unmodified" unset="true" />
</then>
</if>
</sequential>
</for>
</sequential>
</macrodef>
<process-ivy />
<target name="publish">
<ivy:settings file="${sdk.dir}/ivy-settings-publisher.xml" />
<ivy:resolve
conf="default,provided"
log="${ivy.log.level}"
transitive="${ivy.resolve.transitive.dependencies}"
/>
<property name="ivy.pom.description" value="${plugin.name}" />
<property name="ivy.pom.name" value="${plugin.name}" />
<property name="plugin.release.qualifier" value="" />
<if>
<equals arg1="${plugin.release.qualifier}" arg2="-SNAPSHOT" />
<then>
<property name="sonatype.password" value="${sonatype.snapshot.password}" />
<property name="sonatype.url" value="${sonatype.snapshot.url}" />
<property name="sonatype.username" value="${sonatype.snapshot.username}" />
</then>
<else>
<property name="sonatype.password" value="${sonatype.release.password}" />
<property name="sonatype.url" value="${sonatype.release.url}" />
<property name="sonatype.username" value="${sonatype.release.username}" />
</else>
</if>
<property name="ivy.pom.version" value="${plugin.full.version}${plugin.release.qualifier}" />
<ivy:makepom
description="${ivy.pom.description}"
ivyfile="ivy.xml"
pomfile="${plugin.pom.file}"
templatefile="${sdk.dir}/tools/templates/pom_tmpl/template.pom"
>
<mapping conf="default" scope="compile" />
<mapping conf="provided" scope="provided" />
<mapping conf="runtime" scope="runtime" />
</ivy:makepom>
<artifact:pom file="${plugin.pom.file}" id="${plugin.name}" />
<if>
<equals arg1="${publish.target}" arg2="local" />
<then>
<if>
<and>
<available file="${plugin.javadoc.file}" />
<available file="${plugin.source.file}" />
</and>
<then>
<artifact:install file="${plugin.file}">
<attach classifier="javadoc" file="${plugin.javadoc.file}" />
<attach classifier="sources" file="${plugin.source.file}" />
<pom refid="${plugin.name}" />
</artifact:install>
</then>
<elseif>
<available file="${plugin.javadoc.file}" />
<then>
<artifact:install file="${plugin.file}">
<attach classifier="javadoc" file="${plugin.javadoc.file}" />
<pom refid="${plugin.name}" />
</artifact:install>
</then>
</elseif>
<elseif>
<available file="${plugin.source.file}" />
<then>
<artifact:install file="${plugin.file}">
<attach classifier="sources" file="${plugin.source.file}" />
<pom refid="${plugin.name}" />
</artifact:install>
</then>
</elseif>
<else>
<artifact:install file="${plugin.file}">
<pom refid="${plugin.name}" />
</artifact:install>
</else>
</if>
</then>
<else>
<if>
<equals arg1="${plugin.release.qualifier}" arg2="-SNAPSHOT" />
<then>
<record action="start" name="${basedir}/maven.deploy.log" />
</then>
</if>
<if>
<and>
<available file="${plugin.javadoc.file}" />
<available file="${plugin.source.file}" />
</and>
<then>
<artifact:deploy file="${plugin.file}">
<attach classifier="javadoc" file="${plugin.javadoc.file}" />
<attach classifier="sources" file="${plugin.source.file}" />
<pom refid="${plugin.name}" />
<remoteRepository url="${sonatype.url}">
<authentication password="${sonatype.password}" username="${sonatype.username}" />
</remoteRepository>
</artifact:deploy>
</then>
<elseif>
<available file="${plugin.javadoc.file}" />
<then>
<artifact:deploy file="${plugin.file}">
<attach classifier="javadoc" file="${plugin.javadoc.file}" />
<pom refid="${plugin.name}" />
<remoteRepository url="${sonatype.url}">
<authentication password="${sonatype.password}" username="${sonatype.username}" />
</remoteRepository>
</artifact:deploy>
</then>
</elseif>
<elseif>
<available file="${plugin.source.file}" />
<then>
<artifact:deploy file="${plugin.file}">
<attach classifier="sources" file="${plugin.source.file}" />
<pom refid="${plugin.name}" />
<remoteRepository url="${sonatype.url}">
<authentication password="${sonatype.password}" username="${sonatype.username}" />
</remoteRepository>
</artifact:deploy>
</then>
</elseif>
<else>
<artifact:deploy file="${plugin.file}">
<pom refid="${plugin.name}" />
<remoteRepository url="${sonatype.url}">
<authentication password="${sonatype.password}" username="${sonatype.username}" />
</remoteRepository>
</artifact:deploy>
</else>
</if>
<if>
<equals arg1="${plugin.release.qualifier}" arg2="-SNAPSHOT" />
<then>
<record action="stop" name="${basedir}/maven.deploy.log" />
<record-git-commit-snapshot />
<delete file="maven.deploy.log" />
</then>
</if>
</else>
</if>
</target>
</project>