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

« back to all changes in this revision

Viewing changes to src/example/configurations/multi-projects/filter-framework/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="filter-framework" default="publish" xmlns:ivy="antlib:org.apache.ivy.ant">
 
20
    <!-- some variables used -->
 
21
    <property name="lib.dir" value="lib" />
 
22
    <property name="build.dir" value="build" />
 
23
    <property name="distrib.dir" location="distrib" />
 
24
    <property name="src.dir" value="src" />
 
25
        <property name="test.dir" value="test" />
 
26
        <property name="build.test.dir" value="${build.dir}/test-classes" />
 
27
        <property name="report.test.dir" value="${build.dir}/test-report" />
 
28
        <property name="revision" value="1.3" />
 
29
        
 
30
        <property name="ivy.local.default.root" location="${user.home}/.ivy2/local"/>
 
31
        
 
32
    <!-- paths used for compilation and run  -->
 
33
    <path id="compile.path.id">
 
34
        <fileset dir="${lib.dir}/cc-impl" />
 
35
        </path>
 
36
        
 
37
    <path id="test.path.id">
 
38
        <path location="${build.dir}" />
 
39
         <path location="${build.test.dir}" />
 
40
        <fileset dir="${lib.dir}/test" />
 
41
        </path>
 
42
    
 
43
    <!-- ================================= 
 
44
          target: resolve              
 
45
         ================================= -->
 
46
    <target name="resolve" description="--> retreive dependencies with ivy">
 
47
        <!-- conf="*" will copie artifacts defined for each conf in a dir matching conf name -->
 
48
                <ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]"/>
 
49
    </target>
 
50
        
 
51
        <!-- ================================= 
 
52
          target: build
 
53
         ================================= -->
 
54
    <target name="build" depends="clean, resolve" description="--> compile and jar project">
 
55
        <mkdir dir="${build.dir}" />
 
56
                <mkdir dir="${distrib.dir}"/>
 
57
        <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="compile.path.id"/>
 
58
        <jar destfile="${distrib.dir}/filter-api.jar" >
 
59
                <fileset dir="${build.dir}">
 
60
                        <include name="filter/*.class"/>
 
61
                </fileset>
 
62
        </jar>
 
63
        <jar destfile="${distrib.dir}/filter-hmimpl.jar" >
 
64
                <fileset dir="${build.dir}">
 
65
                        <include name="filter/hmimpl/*.class"/>
 
66
                </fileset>
 
67
        </jar>    
 
68
        <jar destfile="${distrib.dir}/filter-ccimpl.jar" >
 
69
                <fileset dir="${build.dir}">
 
70
                        <include name="filter/ccimpl/*.class"/>
 
71
                </fileset>
 
72
        </jar>          
 
73
    </target>
 
74
        
 
75
    <!-- ================================= 
 
76
          target: test              
 
77
         ================================= -->  
 
78
        <target name="test" depends="build" description="--> compile and test the project">     
 
79
                <mkdir dir="${report.test.dir}"/>
 
80
                <mkdir dir="${build.test.dir}"/>
 
81
                
 
82
                <javac srcdir="${test.dir}" destdir="${build.test.dir}" classpathref="test.path.id"/>
 
83
                <junit printsummary="yes" fork="yes" haltonfailure="yes" >
 
84
                        <classpath refid="test.path.id"/>       
 
85
                        <formatter type="plain"/>
 
86
                        <batchtest todir="${report.test.dir}" >
 
87
                            <fileset dir="${build.test.dir}">
 
88
                                <include name="**/**Test.*"/>
 
89
                            </fileset>  
 
90
                        </batchtest>
 
91
                </junit>
 
92
        </target>
 
93
    <!-- ================================= 
 
94
          target: publish              
 
95
         ================================= -->  
 
96
    <target name="publish" depends="test" description="--> compile test and publish this project in the local ivy repository">
 
97
        <property name="revision" value="${revision}"/>
 
98
                <ivy:publish artifactspattern="${distrib.dir}/[artifact].[ext]" 
 
99
                                   resolver="local"
 
100
                                   pubrevision="${revision}" 
 
101
                                   status="release"/>
 
102
        <echo message="project ${ant.project.name} released with version ${revision}" />
 
103
    </target>   
 
104
    <!-- ================================= 
 
105
          target: clean              
 
106
         ================================= -->
 
107
    <target name="clean" description="--> clean the project">
 
108
        <delete includeemptydirs="true">
 
109
            <fileset dir="${basedir}">
 
110
                <exclude name="src/**" />
 
111
                <exclude name="test/**" />
 
112
                <exclude name="build.xml" />
 
113
                <exclude name="ivy.xml" />
 
114
                <exclude name=".*" />
 
115
                </fileset>
 
116
        </delete>
 
117
    </target>
 
118
        
 
119
    <!-- ================================= 
 
120
          target: clean-cache              
 
121
         ================================= -->
 
122
        <target name="clean-cache" description="--> clean the ivy cache">
 
123
                <ivy:cleancache />
 
124
        </target>
 
125
 
 
126
    <!-- ================================= 
 
127
      target: clean-local              
 
128
     ================================= -->
 
129
        <target name="clean-local" description="--> clean the local user repository">
 
130
                <delete dir="${ivy.local.default.root}"/>
 
131
        </target>
 
132
 
 
133
            
 
134
    <!-- ================================= 
 
135
          target: report              
 
136
         ================================= -->
 
137
    <target name="report" depends="resolve" description="--> generates a report of dependencies">
 
138
        <ivy:report todir="${build.dir}"/>
 
139
    </target>
 
140
</project>