-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild-part-ivy-resolver.xml
96 lines (78 loc) · 4.27 KB
/
build-part-ivy-resolver.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
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project name="ivy-installer" default="install-ivy" xmlns:ivy="antlib:org.apache.ivy.ant">
<!--
this build file is a self contained project: it doesn't require anything else
that ant 1.6.2 or greater and java 1.4 or greater properly installed.
It is used to install ivy in case you don't already have it.
To install ivy manually run "ant -buildfile install-ivy-build.xml"
More information can be found at http://ant.apache.org/ivy/
NOTE: This file is a modified version of the build.xml file used in the
Ivy intro tutorial. A link to it can be found at:
http://ant.apache.org/ivy/history/latest-milestone/tutorial.html
-->
<!-- here is the version of ivy we will use. change this property to try a newer
version if you want -->
<property name="ivy.install.version" value="2.2.0" />
<property name="ivy.jar.dir" value="${basedir}/ivy" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<property name="ivy.settings.dir" value="${basedir}"/>
<property name="ivy.settings.file" value="${ivy.settings.dir}/ivy-settings.xml"/>
<target name="download-ivy" unless="ivy.exists">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<echo message="downloading ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="skip-download-ivy" if="ivy.exists">
<echo message="skipping ivy download, you already have it. If you need to re-download, run clean-ivy first"/>
</target>
<target name="check-ivy">
<available file="${ivy.jar.file}" property="ivy.exists"/>
</target>
<!-- =================================
target: install-ivy
this target is not necessary if you put ivy.jar in your ant lib directory
if you already have ivy in your ant lib, you can simply remove this
target and the dependency the 'go' target has on it
================================= -->
<target name="install-ivy" depends="check-ivy, download-ivy, skip-download-ivy" description="--> install ivy">
<!-- try to load ivy here from local ivy dir, 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>
<!-- =================================
target: clean-ivy
================================= -->
<target name="clean-ivy" description="--> clean the ivy installation">
<delete dir="${ivy.jar.dir}"/>
</target>
<!-- =================================
target: clean-cache
================================= -->
<target name="clean-cache" depends="install-ivy"
description="--> clean the ivy cache">
<ivy:cleancache />
</target>
</project>