-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
102 lines (87 loc) · 4.43 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="yadic" 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.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"/>
<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"/>
</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="79"/>-->
<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}"/>
<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="hg" output="${artifacts}/hg.properties">
<arg line="log -l 1"/>
</exec>
<property file="${artifacts}/hg.properties" prefix="hg"/>
<propertyfile file="${artifacts}/release.properties">
<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="${hg.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:com.googlecode.${ant.project.name}:${ant.project.name}:jar:${release.version}"
dependencies="build/runtime.dependencies"
directory="${artifacts}"/>
</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>
</target>
</project>