~ubuntu-branches/ubuntu/trusty/ivy/trusty

« back to all changes in this revision

Viewing changes to src/example/dual/project/build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2009-03-06 22:04:56 UTC
  • Revision ID: james.westby@ubuntu.com-20090306220456-5v37luqiuqda8ewp
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
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
 
9
 
 
10
     http://www.apache.org/licenses/LICENSE-2.0
 
11
 
 
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
 
17
   under the License.    
 
18
-->
 
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" />
 
24
    
 
25
    <!-- ivy properties used -->
 
26
    <property name="ivy.settings.dir" value="../settings" />
 
27
 
 
28
        <!-- paths used for compilation and run  -->
 
29
    <path id="lib.path.id">
 
30
        <fileset dir="${lib.dir}" />
 
31
        </path>
 
32
    <path id="run.path.id">
 
33
        <path refid="lib.path.id" />
 
34
        <path location="${build.dir}" />
 
35
    </path>
 
36
    
 
37
    <ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
 
38
    
 
39
    <!-- ================================= 
 
40
          target: resolve              
 
41
         ================================= -->
 
42
    <target name="resolve" description="--> resolve and retrieve dependencies with ivy">
 
43
        <ivy:retrieve />
 
44
    </target>
 
45
    
 
46
    <!-- ================================= 
 
47
          target: report              
 
48
         ================================= -->
 
49
    <target name="report" depends="resolve" description="--> generates a report of dependencies">
 
50
        <ivy:report todir="${build.dir}"/>
 
51
    </target>
 
52
    
 
53
    <!-- ================================= 
 
54
          target: run
 
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"/>
 
60
    </target>
 
61
    
 
62
    <!-- ================================= 
 
63
          target: clean              
 
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" />
 
71
                </fileset>
 
72
        </delete>
 
73
    </target>
 
74
        
 
75
    <!-- ================================= 
 
76
          target: clean-cache              
 
77
         ================================= -->
 
78
        <target name="clean-cache" description="--> clean the ivy cache">
 
79
                <ivy:cleancache />
 
80
        </target>
 
81
</project>