forked from dataiku/dataiku-hive-udf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
51 lines (42 loc) · 2.02 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
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="dataiku-hive-udf" default="jar">
<property file="build.properties" />
<property name="ivy.install.version" value="2.0.0-beta1"/>
<property name="ivy.jar.dir" value="${basedir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib"/>
<property name="dist.dir" value="dist"/>
<property name="src.dir" value="src"/>
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[revision].[ext]" />
</target>
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
<fileset dir="${hive.lib.dir}" />
<fileset dir="${hadoop.lib.dir}" includes="*jar"/>
</path>
<target name="compile" depends="resolve">
<mkdir dir="${build.dir}/classes" />
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" classpathref="lib.path.id" />
</target>
<target name="jar" depends="compile">
<delete file="${dist.dir}/dataiku-hive-udf.jar" />
<jar destfile="${dist.dir}/dataiku-hive-udf.jar" basedir="${build.dir}/classes" />
</target>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${lib.dir}" />
</target>
</project>