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="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" />
30
<property name="ivy.local.default.root" location="${user.home}/.ivy2/local"/>
32
<!-- paths used for compilation and run -->
33
<path id="compile.path.id">
34
<fileset dir="${lib.dir}/cc-impl" />
37
<path id="test.path.id">
38
<path location="${build.dir}" />
39
<path location="${build.test.dir}" />
40
<fileset dir="${lib.dir}/test" />
43
<!-- =================================
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]"/>
51
<!-- =================================
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"/>
63
<jar destfile="${distrib.dir}/filter-hmimpl.jar" >
64
<fileset dir="${build.dir}">
65
<include name="filter/hmimpl/*.class"/>
68
<jar destfile="${distrib.dir}/filter-ccimpl.jar" >
69
<fileset dir="${build.dir}">
70
<include name="filter/ccimpl/*.class"/>
75
<!-- =================================
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}"/>
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.*"/>
93
<!-- =================================
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]"
100
pubrevision="${revision}"
102
<echo message="project ${ant.project.name} released with version ${revision}" />
104
<!-- =================================
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=".*" />
119
<!-- =================================
121
================================= -->
122
<target name="clean-cache" description="--> clean the ivy cache">
126
<!-- =================================
128
================================= -->
129
<target name="clean-local" description="--> clean the local user repository">
130
<delete dir="${ivy.local.default.root}"/>
134
<!-- =================================
136
================================= -->
137
<target name="report" depends="resolve" description="--> generates a report of dependencies">
138
<ivy:report todir="${build.dir}"/>