-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
139 lines (120 loc) · 6.09 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0" encoding="UTF-8"?>
<project name="jcompilo" 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="group.id" value="com.googlecode.${ant.project.name}"/>
<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.pack200" value="${release.name}.pack.gz"/>
<property name="release.sh" value="${release.name}.sh"/>
<property name="release.cmd" value="${release.name}.cmd"/>
<property name="release.pom" value="${release.name}.pom"/>
<property name="release.src" value="${release.name}-sources.jar"/>
<property name="release.dep" value="${release.name}-dep.jar"/>
<property name="release.dep.path" value="${artifacts}/${release.name}-dep.jar"/>
<property name="release.jar.path" value="${artifacts}/${release.jar}"/>
<property name="test.jar.path" value="${artifacts}/${release.name}-tests.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"/>
<import file="${build}/macros.xml"/>
<import file="${build}/shavenmaven.xml"/>
<requires java.version="1\.[8]"/>
<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"/>
</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="2.36"/>
<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}" main.class="com.googlecode.jcompilo.BootStrap"/>
</target>
<target name="test">
<compile.and.jar src="${test}" jar="${test.jar.path}" classpathref="all.jars"
version="${release.version}" main.class="com.googlecode.jcompilo.BootStrap"/>
<test jar="${test.jar.path}" classpathref="all.jars" reports="${reports}"/>
</target>
<target name="pack">
<exec executable="pack200">
<arg line="${artifacts}/${release.pack200} ${artifacts}/${release.jar}"/>
</exec>
</target>
<target name="package">
<mkdir dir="${artifacts}"/>
<zip destfile="${artifacts}/${release.src}" basedir="src"/>
<copy file="${basedir}/example/jcompilo.sh" tofile="${artifacts}/${release.sh}">
<filterset>
<filter token="version" value="${build.number}"/>
</filterset>
</copy>
<copy file="${basedir}/example/jcompilo.cmd" tofile="${artifacts}/${release.cmd}">
<filterset>
<filter token="version" value="${build.number}"/>
</filterset>
</copy>
<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"/>
</propertyfile>
<generate.pom artifact.uri="mvn:${group.id}:${ant.project.name}:jar:${release.version}"
dependencies="build/runtime.dependencies"
directory="${artifacts}"/>
</target>
<target name="embed">
<embed.libs/>
</target>
<target name="build" description="build all">
<parallel>
<antcall target="update"/>
<antcall target="clean"/>
</parallel>
<antcall target="compile"/>
<parallel>
<antcall target="test"/>
<antcall target="package"/>
</parallel>
<antcall target="embed"/>
<antcall target="pack"/>
</target>
</project>