This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathbuild-common-ivy.xml
161 lines (133 loc) · 4.19 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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common-ivy" xmlns:antelope="antlib:ise.antelope.tasks" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="ivy.home" value="${sdk.dir}/.ivy" />
<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="\."
/>
<path id="classpath.com.liferay.ant.mirrors.get">
<fileset dir="${sdk.dir}/dependencies/com.liferay.ant.mirrors.get/lib" includes="*.jar" />
</path>
<taskdef classname="com.liferay.ant.mirrors.get.MirrorsGetTask" classpathref="classpath.com.liferay.ant.mirrors.get" name="mirrors-get" />
<if>
<not>
<available file="${ivy.home}/ivy-${ivy.version}.jar" />
</not>
<then>
<mkdir dir="${ivy.home}" />
<mirrors-get
dest="${ivy.home}"
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" />
<path id="sdk.dependencies.path">
<dirset dir="${sdk.dir}" includes="dependencies/*" />
</path>
<pathconvert pathsep="," property="sdk.dependencies.path" refid="sdk.dependencies.path" targetos="unix" />
<for list="${basedir},${sdk.dir},${sdk.dependencies.path}" param="ivy.xml.dir">
<sequential>
<if>
<available file="@{ivy.xml.dir}/ivy.xml" />
<then>
<fixcrlf eol="lf" file="@{ivy.xml.dir}/ivy.xml" fixlast="false" />
<checksum file="@{ivy.xml.dir}/ivy.xml" verifyproperty="ivy.xml.unmodified" />
<if>
<isfalse value="${ivy.xml.unmodified}" />
<then>
<ivy:settings file="${ivy.custom.settings.file}" />
<ivy:resolve
file="@{ivy.xml.dir}/ivy.xml"
log="download-only"
transitive="${ivy.resolve.transitive.dependencies}"
/>
<if>
<or>
<equals arg1="@{ivy.xml.dir}" arg2="${sdk.dir}" />
<antelope:endswith string="${ant.project.name}" with="-shared" />
<not>
<available file="@{ivy.xml.dir}/docroot" />
</not>
</or>
<then>
<ivy:retrieve
overwriteMode="always"
pattern="@{ivy.xml.dir}/lib/[artifact].[ext]"
type="bundle,jar,orbit"
/>
<ivy:retrieve
overwriteMode="always"
pattern="@{ivy.xml.dir}/lib/[artifact]-[type]s.[ext]"
type="source"
/>
</then>
<else>
<ivy:retrieve
overwriteMode="always"
pattern="@{ivy.xml.dir}/docroot/WEB-INF/lib/[artifact].[ext]"
type="bundle,jar,orbit"
/>
<ivy:retrieve
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>
<target name="publish">
<ivy:settings file="${sdk.dir}/ivy-settings-publisher.xml" />
<ivy:resolve
log="download-only"
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="" />
<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/pom_tmpl/template.pom"
/>
<ivy:publish
forcedeliver="true"
overwrite="true"
publishivy="false"
pubrevision="${ivy.pom.version}"
resolver="${ivy.publish.resolver}"
>
<artifacts pattern="${sdk.dir}/dist/${plugin.name}-${plugin.full.version}(-[classifier]).[ext]" />
</ivy:publish>
</target>
</project>