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="dependee" 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="classes.dir" value="${build.dir}/classes" />
24
<property name="src.dir" value="${basedir}/src" />
26
<!-- ivy properties used -->
27
<property name="ivy.settings.dir" value="../settings" />
28
<property file="${ivy.settings.dir}/ivysettings.properties" />
30
<!-- paths used for compilation and run -->
31
<path id="lib.path.id">
32
<fileset dir="${lib.dir}" />
34
<path id="run.path.id">
35
<path refid="lib.path.id" />
36
<path location="${classes.dir}" />
39
<ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
41
<!-- =================================
43
================================= -->
44
<target name="resolve" description="--> resolve and retrieve dependencies with ivy">
48
<!-- =================================
50
================================= -->
51
<target name="report" depends="resolve" description="--> generates a report of dependencies">
52
<ivy:report todir="${build.dir}"/>
55
<!-- =================================
57
================================= -->
58
<target name="compile" depends="resolve" description="--> description">
59
<mkdir dir="${classes.dir}" />
60
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="lib.path.id" />
63
<!-- =================================
65
================================= -->
66
<target name="run" depends="compile" description="--> compile and run the project">
67
<java classpathref="run.path.id" classname="standalone.Main"/>
70
<!-- =================================
72
================================= -->
73
<target name="jar" depends="compile" description="--> make a jar file for this project">
74
<propertyfile file="${classes.dir}/version.properties">
75
<entry key="version" type="int" operation="+" default="0" />
77
<property file="${classes.dir}/version.properties" />
78
<jar destfile="${build.dir}/${ant.project.name}.jar">
79
<fileset dir="${classes.dir}" />
83
<!-- =================================
85
================================= -->
86
<target name="publish" depends="jar" description="--> publish this project in the ivy repository">
87
<property name="revision" value="${version}"/>
88
<delete file="${build.dir}/ivy.xml"/>
89
<ivy:publish artifactspattern="${build.dir}/[artifact].[ext]"
91
pubrevision="${revision}"
94
<echo message="project ${ant.project.name} released with version ${revision}" />
98
<!-- =================================
100
================================= -->
101
<target name="clean" description="--> clean the project">
102
<delete includeemptydirs="true">
103
<fileset dir="${basedir}">
104
<exclude name="src/**" />
105
<exclude name="build.xml" />
106
<exclude name="ivy.xml" />