-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
117 lines (101 loc) · 5.97 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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant"
name="OvoData"
default="all">
<description>Ovation OData Web-service</description>
<property name="dir.src" value="${basedir}/src"/>
<property name="dir.compile" value="${basedir}/classes"/>
<property name="dir.war" value="${basedir}/war"/>
<property name="dir.lib" value="${basedir}/lib"/>
<property name="dir.3rdparty-tmp" value="${basedir}/3pjars"/>
<property name="dir.distrib" value="${basedir}/distrib"/>
<property name="dir.dotcloud" value="${basedir}/dotcloud/odata"/>
<property name="jar.release" value="ovodata.jar"/>
<property name="war.release" value="ovodata.war"/>
<property name="war.release.root" value="ROOT.war"/>
<property name="guava.jar.path" value="${dir.lib}/guava-10.0.1.jar"/>
<property name="odata4j.jar.path" value="${dir.lib}/odata4j-0.6.0-bundle.jar"/>
<property name="ovation.jar.path" value="${dir.lib}/ovation-1.2.jar"/>
<property name="javax.servlet.jar.path" value="${dir.lib}/javax.servlet-api-3.0.1.jar"/>
<property name="junit.jar.path" value="${dir.lib}/junit-4.10.jar"/>
<fileset id="set.jars" dir="${dir.lib}">
<include name="guava-r09.jar" />
<include name="odata4j-0.6.0-bundle.jar" />
<include name="ovation-1.2.jar" />
</fileset>
<target name="all" depends="clean, war" description="clean build of source, jar and war">
</target>
<target name="clean" description="delete all build products">
<delete dir="${dir.compile}" failonerror="no"/>
<delete dir="${dir.distrib}" failonerror="no"/>
</target>
<target name="init" depends="resolve" description="build war">
<mkdir dir="${dir.compile}"/>
</target>
<target name="compile" depends="init" description="build war">
<javac nowarn="no" fork="no" compiler="javac1.6" source="1.6" target="1.6" debug="yes" verbose="no" srcdir="${dir.src}" destdir="${dir.compile}" includeantruntime="false">
<classpath>
<fileset refid="set.jars"/>
<filelist files="${javax.servlet.jar.path}"/>
<filelist files="${junit.jar.path}"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile" description="build war">
<mkdir dir="${dir.distrib}"/>
<!-- jarring is so fast it's faster to blow away old jar than compare timestamps -->
<delete file="${dir.distrib}/${jar.release}"/>
<jar jarfile="${dir.distrib}/${jar.release}">
<fileset dir="${dir.compile}"/>
<manifest>
<attribute name="Main-Class" value="ovation.odata.service.StandaloneJerseyServer"/>
</manifest>
<!-- we have to exclude any rsa signature files and manifests - the rest i remove just to keep things focussed and the jar smaller -->
<zipfileset includes="**/*" excludes="javax/servlet/** META-INF/MANIFEST.MF META-INF/*.rsa META-INF/*.sf META-INF/maven/** META-INF/LICENSE* META-INF/NOTICE* META-INF/DEPENDENCIES*" src="${ovation.jar.path}"/>
<zipfileset includes="**/*" excludes="javax/servlet/** META-INF/MANIFEST.MF META-INF/*.rsa META-INF/*.sf META-INF/maven/** META-INF/LICENSE* META-INF/NOTICE* META-INF/DEPENDENCIES*" src="${odata4j.jar.path}"/>
<zipfileset includes="**/*" excludes="javax/servlet/** META-INF/MANIFEST.MF META-INF/*.rsa META-INF/*.sf META-INF/maven/** META-INF/LICENSE* META-INF/NOTICE* META-INF/DEPENDENCIES*" src="${guava.jar.path}"/>
<zipfileset includes="**/*" excludes="javax/servlet/** META-INF/MANIFEST.MF META-INF/*.rsa META-INF/*.sf META-INF/maven/** META-INF/LICENSE* META-INF/NOTICE* META-INF/DEPENDENCIES*" src="${junit.jar.path}"/>
</jar>
</target>
<target name="war" depends="jar" description="build war">
<war basedir="${dir.war}" includes="**/*" warfile="${dir.distrib}/${war.release}">
<lib file="${dir.distrib}/${jar.release}"/>
</war>
<copy file="${dir.distrib}/${war.release}" tofile="${dir.dotcloud}/${war.release.root}"/>
</target>
<target name="runserver" depends="jar" description="run test server">
<exec executable="${basedir}/run_server"/>
</target>
<!--IVY-->
<property environment="env"/>
<property name="ivy.install.version" value="2.2.0"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${basedir}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<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"
description="--> retrieve dependencies with ivy"
depends="init-ivy"
>
<ivy:retrieve/>
</target>
</project>