-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasl-repo-ivy.xml
executable file
·161 lines (146 loc) · 7.66 KB
/
asl-repo-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" encoding="utf-8"?>
<!--
********************************************************************************
* Ant Script Library - Ivy repository module
* Targets used to configure and manipulate Ivy repositories
* Module property prefix: "repo-ivy"
********************************************************************************
* Copyright 2009 Joe Schmetzer
*
* Licensed 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="asl-repo-ivy" xmlns:ivy="antlib:org.apache.ivy.ant">
<dirname property="repo-ivy.basedir" file="${ant.file.asl-repo-ivy}"/>
<property name="repo-ivy.settings-file" location="${repo-ivy.basedir}/ivysettings.xml" />
<property name="repo-ivy.lib-dir" location="lib"/>
<property name="repo-ivy.report-dir" location="target/dist/reports/ivy-report"/>
<property name="repo-ivy.retrieve-pattern" value="${repo-ivy.lib-dir}/[artifact]-[revision](-[classifier]).[ext]"/>
<property name="repo-ivy.publish-pattern" value="${common.dist-dir}/[artifact]-[revision].[ext]"/>
<!-- ***********************************************************************
* Set up the Ivy tasks
************************************************************************ -->
<path id="rep-ivy.lib-path">
<pathelement location="${repo-ivy.basedir}/lib/apache-ivy/ivy-2.2.0.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpathref="rep-ivy.lib-path"/>
<!-- ***********************************************************************
* target: -repo-configure-ivy
************************************************************************ -->
<target name="-repo-configure-ivy" unless="repo-ivy.already-configured">
<property name="repo-ivy.already-configured" value="true" />
<ivy:configure file="${repo-ivy.settings-file}" />
</target>
<!-- ***********************************************************************
* target: repo-resolve
************************************************************************ -->
<target name="repo-resolve" depends="-repo-configure-ivy"
description="Resolves dependencies with ivy">
<ivy:resolve />
</target>
<!-- ***********************************************************************
* target: repo-retrieve
************************************************************************ -->
<target name="repo-retrieve" depends="-repo-configure-ivy"
description="Retrieve dependencies with Ivy">
<ivy:retrieve pattern="${repo-ivy.retrieve-pattern}" sync="true" />
</target>
<!-- ***********************************************************************
* target: repo-publish
************************************************************************ -->
<target name="repo-publish" depends="-repo-configure-ivy"
description="Publish artifacts to Ivy shared repository">
<ivy:info />
<ivy:publish
artifactspattern="${repo-ivy.publish-pattern}"
resolver="shared"
overwrite="true"
pubrevision="${ivy.revision}"/>
</target>
<!-- ***********************************************************************
* target: repo-publish-local
************************************************************************ -->
<target name="repo-publish-local" depends="-repo-configure-ivy, dist"
description="Publish artifacts to Ivy local repository">
<fail unless="release.version"
message="'release.version' property must be set to publish"/>
<ivy:info />
<ivy:publish
artifactspattern="${repo-ivy.publish-pattern}"
resolver="local"
overwrite="true"
pubrevision="${release.version}"/>
</target>
<!-- ***********************************************************************
* target: repo-report
************************************************************************ -->
<target name="repo-report" depends="repo-resolve"
description="Generate an Ivy dependencies report">
<ivy:report todir="${repo-ivy.report-dir}" />
</target>
<!-- ***********************************************************************
* target: repo-clean-cache
************************************************************************ -->
<target name="repo-clean-cache" depends="-repo-configure-ivy"
description="Clean Ivy repository cache">
<ivy:cleancache />
</target>
<!-- ***********************************************************************
* target: repo-clean-local
************************************************************************ -->
<target name="repo-clean-local" depends="-repo-configure-ivy"
description="Clean Ivy local repository">
<ivy:info />
<delete dir="${ivy.local.default.root}/${ivy.organisation}/${ivy.module}"/>
</target>
<!-- ***********************************************************************
* target: repo-install-local
************************************************************************ -->
<target name="repo-install-local" depends="-repo-configure-ivy,-repo-install-init"
description="Install jars from central m2 repoisotry to Ivy local repository">
<ivy:install
from="default" to="local"
organisation="${repo-ivy.install-organisation}"
module="${repo-ivy.install-module}"
revision="${repo-ivy.install-revision}"
transitive="true"
haltonfailure="false"
overwrite="true"
/>
</target>
<!-- ***********************************************************************
* target: -repo-install-init
************************************************************************ -->
<target name="-repo-install-init"
depends="-repo-install-init-org,-repo-install-init-module,-repo-install-init-revision"/>
<!-- ***********************************************************************
* target: -repo-install-init
************************************************************************ -->
<target name="-repo-install-init-org" unless="repo-ivy.install-organisation">
<input addproperty="repo-ivy.install-organisation" message="Install organisation:"/>
</target>
<!-- ***********************************************************************
* target: -repo-install-init
************************************************************************ -->
<target name="-repo-install-init-module" unless="repo-ivy.install-module">
<input addproperty="repo-ivy.install-module" message="Install module:"/>
</target>
<!-- ***********************************************************************
* target: -repo-install-init
************************************************************************ -->
<target name="-repo-install-init-revision" unless="repo-ivy.install-revision">
<input addproperty="repo-ivy.install-revision" message="Install revision:"/>
</target>
</project>