2
Licensed to the Apache Software Foundation (ASF) under one
3
or more contributor license agreements. See the NOTICE file
4
distributed with this work for additional information
5
regarding copyright ownership. The ASF licenses this file
6
to you under the Apache License, Version 2.0 (the
7
"License"); you may not use this file except in compliance
8
with the License. You may obtain a copy of the License at
10
http://www.apache.org/licenses/LICENSE-2.0
12
Unless required by applicable law or agreed to in writing,
13
software distributed under the License is distributed on an
14
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
KIND, either express or implied. See the License for the
16
specific language governing permissions and limitations
19
<project name="dual-ivy" default="run" xmlns:ivy="antlib:org.apache.ivy.ant">
20
<!-- some variables used -->
21
<property name="lib.dir" value="${basedir}/lib" />
22
<property name="build.dir" value="${basedir}/build" />
23
<property name="src.dir" value="${basedir}/src" />
25
<!-- ivy properties used -->
26
<property name="ivy.settings.dir" value="../settings" />
28
<!-- paths used for compilation and run -->
29
<path id="lib.path.id">
30
<fileset dir="${lib.dir}" />
32
<path id="run.path.id">
33
<path refid="lib.path.id" />
34
<path location="${build.dir}" />
37
<ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
39
<!-- =================================
41
================================= -->
42
<target name="resolve" description="--> resolve and retrieve dependencies with ivy">
46
<!-- =================================
48
================================= -->
49
<target name="report" depends="resolve" description="--> generates a report of dependencies">
50
<ivy:report todir="${build.dir}"/>
53
<!-- =================================
55
================================= -->
56
<target name="run" depends="resolve" description="--> compile and run the project">
57
<mkdir dir="${build.dir}" />
58
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" />
59
<java classpathref="run.path.id" classname="example.Hello"/>
62
<!-- =================================
64
================================= -->
65
<target name="clean" description="--> clean the project">
66
<delete includeemptydirs="true">
67
<fileset dir="${basedir}">
68
<exclude name="src/**" />
69
<exclude name="build.xml" />
70
<exclude name="ivy.xml" />
75
<!-- =================================
77
================================= -->
78
<target name="clean-cache" description="--> clean the ivy cache">