forked from jkreps/azkaban
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
178 lines (153 loc) · 6.83 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0"?>
<project name="azkaban" basedir="." default="all">
<property name="azkaban.base.dir" value="${basedir}" />
<property file="build.properties" />
<property name="name" value="azkaban" />
<property name="display.name" value="Azkaban" />
<property name="author" value="Richard Park" />
<property environment="env" />
<!-- set the build number based on environment variable, otherwise blank -->
<property environment="env" description="System environment variables (including those set by Hudson)" />
<condition property="curr.release.snapshot" value="${curr.release}-snapshot-${env.BUILD_NUMBER}" else="${curr.release}">
<and>
<isset property="env.BUILD_NUMBER" />
<not>
<equals arg1="" arg2="${env.BUILD_NUMBER}" trim="yes" />
</not>
</and>
</condition>
<target name="all" depends="clean, jars, war, unit" description="Builds all jars" />
<target name="clean" description="Delete generated files.">
<!--echo message="Deleting dist directory: ${azkaban.base.dir}/${dist.dir}, ${azkaban.base.dir}/${build.dir}" />
<delete dir="${azkaban.base.dir}/${dist.dir}" /-->
<echo message="Deleting generated files in azkaban-common" />
<subant target="clean">
<fileset dir="azkaban-common" includes="build.xml" />
</subant>
<echo message="Deleting generated files in azkaban" />
<subant target="clean">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="jars" depends="clean" description="Compile main source tree java files">
<echo message="building azkaban-common.jar" />
<subant target="jars">
<fileset dir="azkaban-common" includes="build.xml" />
</subant>
<echo message="building azkaban.jar" />
<subant target="jars">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="jar-with-deps" depends="jars" description="Make big bad jar">
<delete dir="${dist.dir}/jar-with-deps"/>
<mkdir dir="${dist.dir}/jar-with-deps"/>
<jar jarfile="${dist.dir}/jar-with-deps/${name}-self-contained-${curr.release}.jar" filesetmanifest="merge">
<manifest>
<attribute name="Main-Class" value="azkaban.jobs.CommandLineJobRunner"/>
</manifest>
<fileset dir="${dist.dir}/azkaban/classes"/>
<fileset dir="${dist.dir}/azkaban-common/classes"/>
<zipgroupfileset dir="${lib.dir}" includes="*.jar" excludes="jarjar-1.0.jar" />
</jar>
</target>
<target name="unit"
description="Compile and run unit tests"
depends="jars" >
<!--. Run JUnit tests: use -Dtests.to.run=testA,testB,... to run tests selectively"-->
<echo message="building and running unit tests" />
<subant target="unit">
<fileset dir="azkaban-common" includes="build.xml" />
</subant>
<subant target="unit">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="build-tests" description="Generate test packages.">
<echo message="Create test jar in test/dist/azkaban-tests.zip " />
<subant target="build-tests">
<fileset dir="test" includes="build.xml" />
</subant>
</target>
<target name="war" depends="jars" description="creates azkaban war.">
<echo message="building azkaban.war" />
<subant target="war">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="deploy" depends="all" description="Deploys azkaban to tomcat.">
<subant target="deploy">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="snapshot" description="Create a release snapshot artifacts">
<create-release-artifacts version="${curr.release.snapshot}" />
</target>
<target name="release" description="Create a release artifacts">
<create-release-artifacts version="${curr.release}" />
</target>
<macrodef name="create-release-artifacts">
<attribute name="version" />
<sequential>
<antcall target="jars" />
<zip destfile="${dist.dir}/${name}-@{version}.zip">
<zipfileset dir="." prefix="azkaban-@{version}" filemode="755" includes="bin/*" />
<zipfileset dir="." prefix="azkaban-@{version}" includes="**">
<exclude name="${dist.dir}/azkaban"/>
<exclude name="${dist.dir}/azkaban-common"/>
<exclude name="${dist.dir}/*.tar.gz"/>
<exclude name="${dist.dir}/*.zip"/>
<exclude name="bin/*" />
<exclude name=".git*/**" />
</zipfileset>
</zip>
<tar destfile="${dist.dir}/${name}-@{version}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="." prefix="azkaban-@{version}" filemode="755" includes="bin/*" />
<tarfileset dir="." prefix="azkaban-@{version}" includes="**">
<exclude name="${dist.dir}/azkaban"/>
<exclude name="${dist.dir}/azkaban-common"/>
<exclude name="${dist.dir}/*.tar.gz"/>
<exclude name="${dist.dir}/*.zip"/>
<exclude name="bin/*" />
<exclude name=".git*/**" />
</tarfileset>
</tar>
</sequential>
</macrodef>
<target name="mvn-deploy" description="Maven deploy all">
<echo message="Running mvn deploy on azkaban-common" />
<subant target="mvn-deploy" inheritall="true">
<fileset dir="azkaban-common" includes="build.xml" />
</subant>
<echo message="Running mvn deploy on azkaban" />
<subant target="mvn-deploy" inheritall="true">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="mvn-install" description="Maven install all">
<echo message="Running mvn install on azkaban-common" />
<subant target="mvn-install">
<fileset dir="azkaban-common" includes="build.xml" />
</subant>
<echo message="Running mvn install on azkaban" />
<subant target="mvn-install">
<fileset dir="azkaban" includes="build.xml" />
</subant>
</target>
<target name="setsnapshotversion" description="Set the version to be snapshot">
<echo message="Setting Snapshot Version" />
<property name="release.version" value="${curr.release.snapshot}"/>
<property name="mvn.repository.location" value="${mvn.repository.location.snapshot}"/>
<property name="mvn.repository.id" value="${mvn.repository.id.snapshot}"/>
</target>
<target name="setreleaseversion" description="Set the version to be release">
<echo message="Setting Release Version" />
<property name="release.version" value="${curr.release}"/>
<property name="mvn.repository.location" value="${mvn.repository.location.release}"/>
<property name="mvn.repository.id" value="${mvn.repository.id.release}"/>
</target>
<target name="mvn-deploysnapshot" description="Deploy the snapshot version" depends="setsnapshotversion, mvn-deploy" />
<target name="mvn-deployrelease" description="Deploy the release version" depends="setreleaseversion, mvn-deploy" />
<target name="mvn-installsnapshot" description="Install the snapshot version" depends="setsnapshotversion, mvn-install" />
<target name="mvn-installrelease" description="Install the release version" depends="setreleaseversion, mvn-install" />
</project>