-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgetivy.xml
70 lines (60 loc) · 2.86 KB
/
getivy.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
<?xml version="1.0"?>
<!--
DESCRIPTION
Downloads Ivy (if needed) and configures it
MODIFIED
Max Orgiyan
-->
<project name="GET-IVY" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Use a proxy, if SODA_PROXY_HOST and SODA_PROXY_PORT environment variables are set -->
<target name="probe-proxy" unless="skip.ivy">
<condition property="proxy.enabled">
<and>
<isset property="env.SODA_PROXY_HOST"/>
<isset property="env.SODA_PROXY_PORT"/>
</and>
</condition>
</target>
<target name="proxy" depends="probe-proxy" if="proxy.enabled" unless="skip.ivy">
<echo>Proxy host: ${env.SODA_PROXY_HOST}, proxy port: ${env.SODA_PROXY_PORT}</echo>
<setproxy proxyhost="${env.SODA_PROXY_HOST}" proxyport="${env.SODA_PROXY_PORT}" />
</target>
<!-- Get Apache Ivy, unless already present (i.e. IVY_HOME env variable is set) -->
<property name="ivy.install.version" value="2.1.0-rc2" />
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<!-- Apache Ivy download will be skipped if it's already installed
(in which case IVY_HOME environment variable should be set),
or if it's specifically requested (by passing -Ddownload.deps=false,
to ANT, which will, in turn, set the "skip.ivy" property).
-->
<target name="check-ivy">
<condition property="ivy.found.or.skip.ivy">
<or>
<isset property="skip.ivy"/>
<isset property="env.IVY_HOME"/>
</or>
</condition>
</target>
<target name="download-ivy" depends="check-ivy, proxy" unless="ivy.found.or.skip.ivy">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy" unless="skip.ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
</project>