forked from liferay/liferay-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-common-ivy.xml
87 lines (73 loc) · 2.28 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
<?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="${project.dir}/.ivy" />
<property name="ivy.install.version" value="2.3.0" />
<if>
<not>
<available file="${ivy.home}/ivy-${ivy.install.version}.jar" />
</not>
<then>
<mkdir dir="${ivy.home}" />
<get
dest="${ivy.home}"
src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
/>
</then>
</if>
<path id="ivy.lib.path">
<fileset
dir="${ivy.home}"
includes="ivy-${ivy.install.version}.jar"
/>
</path>
<taskdef classpathref="ivy.lib.path" resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" />
<basename file="${project.dir}" property="project.dir.name" />
<for list="${basedir},${project.dir}" param="ivy.xml.dir">
<sequential>
<if>
<available file="@{ivy.xml.dir}/ivy.xml" />
<then>
<pathconvert property="ivy.md5.dir">
<map from="${project.dir}" to="${ivy.home}/${project.dir.name}" />
<path location="@{ivy.xml.dir}"/>
</pathconvert>
<checksum file="@{ivy.xml.dir}/ivy.xml" todir="${ivy.md5.dir}" verifyproperty="ivy.xml.unmodified" />
<if>
<isfalse value="${ivy.xml.unmodified}" />
<then>
<ivy:settings file="${project.dir}/ivy-settings.xml" />
<ivy:resolve
file="@{ivy.xml.dir}/ivy.xml"
log="download-only"
/>
<if>
<or>
<equals arg1="@{ivy.xml.dir}" arg2="${project.dir}" />
<antelope:endswith string="${ant.project.name}" with="-shared" />
</or>
<then>
<ivy:retrieve
log="download-only"
pattern="@{ivy.xml.dir}/lib/[artifact].[ext]"
type="jar"
/>
</then>
<else>
<ivy:retrieve
log="download-only"
pattern="@{ivy.xml.dir}/docroot/WEB-INF/lib/[artifact].[ext]"
type="jar"
/>
</else>
</if>
<checksum file="@{ivy.xml.dir}/ivy.xml" todir="${ivy.md5.dir}" />
</then>
</if>
<var name="ivy.md5.dir" unset="true" />
<var name="ivy.xml.unmodified" unset="true" />
</then>
</if>
</sequential>
</for>
</project>