-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.xml
103 lines (88 loc) · 4.99 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
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<project name="yatspec" default="build">
<property name="build.number" value="dev.build"/>
<property name="build" value="${basedir}/build"/>
<property name="artifacts" value="${build}/artifacts"/>
<property name="reports" value="${artifacts}/reports"/>
<property name="src" value="${basedir}/src"/>
<property name="test" value="${basedir}/test"/>
<property name="release.version" value="${build.number}"/>
<property name="release.name" value="${ant.project.name}-${release.version}"/>
<property name="release.jar" value="${release.name}.jar"/>
<property name="release.pom" value="${release.name}.pom"/>
<property name="release.src" value="${release.name}-sources.jar"/>
<property name="release.example" value="example.html"/>
<property name="release.jar.path" value="${artifacts}/${release.jar}"/>
<property name="test.jar.path" value="${artifacts}/${release.name}.test.jar"/>
<property name="build.dependencies.dir" value="lib/build"/>
<property name="runtime.dependencies.dir" value="lib/runtime"/>
<property name="optional.dependencies.dir" value="lib/optional"/>
<property name="manual.dependencies.dir" value="lib/manual"/>
<import file="${build}/macros.xml"/>
<import file="${build}/shavenmaven.xml"/>
<path id="all.dependancies">
<fileset dir="${build.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${runtime.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${optional.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${manual.dependencies.dir}" includes="**/*.jar"/>
</path>
<path id="all.jars">
<path refid="all.dependancies"/>
<path path="${release.jar.path}"/>
<path path="${test.jar.path}"/>
</path>
<target name="update">
<install version="89"/>
<parallel>
<update dependencies="build/build.dependencies"
directory="${build.dependencies.dir}"/>
<update dependencies="build/runtime.dependencies"
directory="${runtime.dependencies.dir}"/>
<update dependencies="build/optional.dependencies"
directory="${optional.dependencies.dir}"/>
</parallel>
</target>
<target name="clean" description="cleanup all">
<delete dir="${artifacts}"/>
</target>
<target name="compile">
<compile.and.jar src="${src}" jar="${release.jar.path}" classpathref="all.dependancies"
version="${release.version}"/>
<embed.libs/>
<compile.and.jar src="${test}" jar="${test.jar.path}" classpathref="all.jars" version="${release.version}"/>
</target>
<target name="test">
<test jar="${test.jar.path}" classpathref="all.jars" reports="${reports}"/>
</target>
<target name="package">
<mkdir dir="${artifacts}"/>
<zip destfile="${artifacts}/${release.src}" basedir="src"/>
<exec executable="git" output="${artifacts}/commit.properties" error="${artifacts}/commit.error">
<arg line='log -n 1 --pretty=format:"user:%an%ndate:%aD%nsummary:%s%nchangeset:%H"'/>
</exec>
<property file="${artifacts}/commit.properties" prefix="commit"/>
<propertyfile file="${artifacts}/release.properties">
<entry key="commit.user" value="${commit.user}"/>
<entry key="commit.summary" value="${commit.summary}"/>
<entry key="commit.date" value="${commit.date}"/>
<entry key="commit.changeset" value="${commit.changeset}"/>
<entry key="release.version" value="${release.version}"/>
<entry key="project.name" value="${ant.project.name}"/>
<entry key="release.name" value="${release.name}"/>
<entry key="release.path" value="com/googlecode/${ant.project.name}/${ant.project.name}/${release.version}/"/>
<entry key="release.files" value="${release.jar},${release.pom},${release.src}"/>
<entry key="${release.jar}.description" value="${commit.summary} build:${build.number} "/>
<entry key="${release.jar}.labels" value="Jar"/>
<entry key="${release.pom}.description" value="Maven POM file build:${build.number}"/>
<entry key="${release.pom}.labels" value="POM"/>
<entry key="${release.src}.description" value="Source file build:${build.number}"/>
<entry key="${release.src}.labels" value="Source"/>
<entry key="${release.example}.description" value="Example of the generated output created just by running a JUnit test"/>
<entry key="${release.example}.labels" value="Featured"/>
</propertyfile>
<generate.pom artifact.uri="mvn:com.googlecode.${ant.project.name}:${ant.project.name}:jar:${release.version}"
dependencies="build/runtime.dependencies"
directory="${artifacts}"/>
</target>
<target name="build" depends="update, clean, compile, test, package" description="build all"/>
</project>