-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
129 lines (116 loc) · 6.38 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
<?xml version="1.0"?>
<project name="zm-oauth-social" default="jar" 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.oauth.resources.OAuth2Extension" />
<property name="implementation.title" value="Extension with various OAuth2 authorization and authentication 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}"/>
<property name="extension.common.deploy.dir" location="${zimbra.home.dir}/lib/ext-common"/>
<property name="oauth-social-common.jar.file" value="zm-oauth-social-common.jar" />
<property name="oauth-social.jar.file" value="zm-oauth-social.jar" />
<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 tar for use with extension loader -->
<target name="tar" depends="oauth-social-jar,oauth-social-common-jar" description="Creates the tar file">
<mkdir dir="${build.dir}/zm-oauth-social"/>
<mkdir dir="${build.dir}/zm-oauth-social/ext"/>
<mkdir dir="${build.dir}/zm-oauth-social/ext-common"/>
<copy file="${build.dir}/${oauth-social.jar.file}" tofile="${build.dir}/zm-oauth-social/ext/zmoauthsocial.jar"/>
<copy file="${build.dir}/${oauth-social-common.jar.file}" todir="${build.dir}/zm-oauth-social/ext-common"/>
<tar destfile="${build.dir}/zm-oauth-social.tar">
<tarfileset dir="${build.dir}/zm-oauth-social" prefix="/zm-oauth-social" includes="**"/>
</tar>
</target>
<!-- builds the server extension jar -->
<target name="jar" depends="compile,zimbra-jar" description="Creates the jar file" />
<target name="oauth-social-jar" depends="compile"
description="Creates the zm-oauth-social.jar file which is used by for oauth functionality">
<antcall target="zimbra-jar">
<param name="implementation.title" value="Zimbra Oauth Social Client Jar"/>
<param name="jar.file" value="${oauth-social.jar.file}"/>
<param name="includes"
value="com/zimbra/oauth/handlers/impl/**,
com/zimbra/oauth/resources/**,
com/zimbra/oauth/schedulers/impl/**,
com/zimbra/oauth/managers/ClassManager.class,
com/zimbra/oauth/utilities/**"/>
</antcall>
</target>
<target name="oauth-social-common-jar" depends="compile"
description="Creates the zm-oauth-social-common.jar file which is used by other extensions">
<antcall target="zimbra-jar">
<param name="implementation.title" value="Zimbra OAuth Social Common Jar"/>
<param name="jar.file" value="${oauth-social-common.jar.file}"/>
<param name="includes"
value="com/zimbra/oauth/cache/**,com/zimbra/oauth/token/**,
com/zimbra/oauth/handlers/**,com/zimbra/oauth/models/**,
com/zimbra/oauth/schedulers/**,
com/zimbra/oauth/utilities/OAuth2HttpConstants.class,
com/zimbra/oauth/utilities/OAuth2CacheUtilities.class,
com/zimbra/oauth/utilities/OAuth2Constants.class,
com/zimbra/oauth/utilities/OAuth2DataSource*.class,
com/zimbra/oauth/utilities/OAuth2JsonUtilities.class,
com/zimbra/oauth/utilities/OAuth2Utilities.class"/>
<param name="excludes"
value="com/zimbra/oauth/handlers/impl/**,
com/zimbra/oauth/schedulers/impl/**"/>
</antcall>
</target>
<!-- 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.auth0" module="java-jwt" revision="3.2.0" settingsRef="dev.settings" from="chain-resolver" to="build-dist" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="com.fasterxml.jackson.core" module="jackson-annotations" revision="2.10.1" settingsRef="dev.settings" from="chain-resolver" to="build-dist" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="com.fasterxml.jackson.core" module="jackson-core" revision="2.10.1" settingsRef="dev.settings" from="chain-resolver" to="build-dist" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="com.fasterxml.jackson.core" module="jackson-databind" revision="2.10.1" 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="${oauth-social.jar.file}" />
<fileset dir="${dist.dir}" includes="*.jar" />
</copy>
<copy todir="${extension.common.deploy.dir}">
<fileset dir="${build.dir}" includes="${oauth-social-common.jar.file}" />
</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>
<!-- Doclet -->
<target name="doclet" depends="jar,set-dev-version">
<javadoc destdir="build/javadoc" classpathref="class.path">
<packageset dir="src/java" defaultexcludes="yes">
<include name="com/zimbra/oauth/**" />
</packageset>
<doclet name="com.tenxerconsulting.swagger.doclet.ServiceDoclet" pathref="class.path">
<param name="-docBasePath" value="/${ant.project.name}-docs-latest"/>
<param name="-apiBasePath" value="/"/>
<param name="-apiVersion" value="${dev.version}"/>
</doclet>
</javadoc>
</target>
</project>