-
Notifications
You must be signed in to change notification settings - Fork 160
/
Copy pathbuild.xml
96 lines (81 loc) · 3.44 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="build-info-extractor-ivy">
<property name="target.dir" value="target"/>
<property name="src.dir" value="src/main/java"/>
<property name="resources.dir" value="src/main/resources"/>
<property name="lib.dir" value="${target.dir}/lib"/>
<property name="build.dir" value="${target.dir}/build"/>
<property name="dist.dir" value="${target.dir}/dist"/>
<property name="jars.dir" value="${dist.dir}/jars"/>
<property name="ivy.distrib.dir" value="${dist.dir}"/>
<property name="ivy.lib.dir" value="${lib.dir}"/>
<property name="jar.file" value="${build.dir}/${ant.project.name}.jar"/>
<property name="module.version.target" value="1.0"/>
<!--<property name="ivy.build.artifacts.dir" value="???"/>-->
<path id="lib.path.id">
<fileset dir="${lib.dir}"/>
</path>
<path id="run.path.id">
<path refid="lib.path.id"/>
<path location="${build.dir}"/>
</path>
<target name="ivyConfigure">
<ivy:configure/>
</target>
<target name="resolve" description="--> retreive dependencies with ivy" depends="ivyConfigure, setup">
<ivy:retrieve/>
</target>
<target name="publish" depends="package, ivyConfigure">
<ivy:resolve/>
<ivy:publish resolver="publish_artifactory" pubrevision="1.0" overwrite="false"/>
</target>
<target name="report" depends="resolve" description="--> generates a report of dependencies">
<ivy:report todir="${build.dir}"/>
</target>
<target name="setup">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${jars.dir}"/>
<mkdir dir="${lib.dir}"/>
</target>
<target name="compile" depends="resolve">
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="on" classpathref="lib.path.id"/>
</target>
<target name="local-version">
<tstamp>
<format property="now" pattern="yyyyMMddHHmmss"/>
</tstamp>
<property name="ivy.new.revision" value="${module.version.target}-local-${now}"/>
</target>
<target name="publish-local" depends="local-version, package"
description="--> publish this project in the local ivy repository">
<ivy:publish artifactspattern="${build.dir}/[artifact].[ext]"
resolver="local"
pubrevision="${ivy.new.revision}"
pubdate="${now}"
status="integration"
forcedeliver="true"
/>
<echo message="project ${ant.project.name} published locally with version ${ivy.new.revision}"/>
</target>
<target name="package" depends="compile" description="--> make a jar file for this project">
<jar destfile="${jar.file}">
<fileset dir="${build.dir}"/>
<fileset dir="${resources.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Version" value="${version}"/>
</manifest>
</jar>
</target>
<target name="clean" description="--> clean the project">
<delete includeemptydirs="true">
<fileset dir="${basedir}">
<include name="${target.dir}/**"/>
</fileset>
</delete>
</target>
<target name="clean-cache" description="--> clean the ivy cache">
<ivy:cleancache/>
</target>
</project>