-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
58 lines (51 loc) · 2.52 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
<?xml version="1.0"?>
<project name="zm-gql" default="compile" xmlns:ivy="antlib:org.apache.ivy.ant">
<import file="../zm-zcs/ant-global.xml" />
<!-- Properties -->
<property name="ext.name" value="${ant.project.name}" />
<property name="zimbra.extension.class" value="com.zimbra.graphql.resources.GQLExtension" />
<property name="implementation.title" value="Extension with Zimbra GraphQL resources"/>
<property name="dist.lib.dir" location="${dist.dir}/lib"/>
<property name="dist.lib.ext.dir" location="${dist.lib.dir}/ext"/>
<property name="build.dir" location="build"/>
<property name="classes.dir" location="${build.dir}/classes"/>
<property name="extension.deploy.dir" location="${zimbra.home.dir}/lib/ext/${ext.name}"/>
<target name="build-init">
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.lib.dir}"/>
<mkdir dir="${dist.lib.ext.dir}"/>
</target>
<!-- builds the server extension jar -->
<target name="jar" depends="compile,zimbra-jar" description="Creates the jar file" />
<!-- deploy to the server extension directory -->
<target name="deploy" depends="jar">
<delete dir="${extension.deploy.dir}"/>
<mkdir dir="${extension.deploy.dir}"/>
<ivy:install organisation="com.graphql-java" module="graphql-java" revision="9.0" settingsRef="dev.settings" from="chain-resolver" to="build-dist" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="io.leangen.graphql" module="spqr" revision="0.9.7" settingsRef="dev.settings" from="chain-resolver" to="build-dist" overwrite="true" transitive="true" type="jar"/>
<echo> Copying ${build.dir}/${jar.file} and ${dist.dir}/*.jar to ${extension.deploy.dir}</echo>
<copy todir="${extension.deploy.dir}">
<fileset dir="${build.dir}" includes="${jar.file}" />
<fileset dir="${dist.dir}" includes="*.jar" />
</copy>
</target>
<!-- removes the server extension directory -->
<target name="undeploy">
<delete dir="${extension.deploy.dir}"/>
</target>
<!-- clean build directory -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<!-- clean build directory and ivy cache -->
<target name="clean-all" depends="clean">
<ivy:cleancache/>
</target>
<!-- used by packaging scripts -->
<target name="dist" depends="jar" description="Copies jar to dist dir so that packaging scripts can pick it up from there">
<copy todir="${dist.lib.ext.dir}">
<fileset dir="${build.dir}" includes="${jar.file}" />
</copy>
</target>
</project>