-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
56 lines (47 loc) · 2.37 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
<project name="zm-taglib" default="jar">
<import file="../zm-zcs/ant-global.xml" />
<property environment="env"/>
<property name="root.dir" location=""/>
<property name="jarfile" location="${build.dir}/zimbrataglib.jar" />
<target name="docs" depends="jar" description="build tld docs in build/docs directory">
<java fork="true" jar="jars/tlddoc.jar" failonerror="true">
<arg line="-d ${build.dir}/docs"/>
<arg value="${jarfile}"/>
</java>
</target>
<target name="clean" description="Removes any built/temporary files">
<delete dir="${build.dir}"/>
</target>
<target name="copy-build-dependencies" description="Temporarily copies com folder from build/classes and resources/*.properties to root directory">
<copy todir="${root.dir}">
<fileset dir="${root.dir}/resources/">
<include name="*.properties"/>
</fileset>
</copy>
<copy todir="${root.dir}/com">
<fileset dir="${build.dir}/classes/com"/>
</copy>
</target>
<target name="delete-duplicate-dependencies" description="Deletes the temporarily copied ZimbraTL.properties file from root directory">
<delete>
<fileset dir="${root.dir}/" includes="*.properties"/>
</delete>
<delete includeEmptyDirs="true">
<fileset dir="${root.dir}/" includes="com/"/>
</delete>
</target>
<!--
The includes param in antcall copies an entire directory and adds it to the file jar.
In case of resources folder we need only the property files inside it but it copies the entire directory structure.
Hence, temporarily copying all the .properties files and /com folder from build/classes to root directory, adding them in the includes param and then deleting later.
-->
<target name="jar" depends="compile, copy-build-dependencies" description="Creates the jar file">
<antcall target="zimbra-jar">
<param name="implementation.title" value="Zimbra Taglib"/>
<!-- Overriding the base directory path used in ant-global.xml's zimbra-jar target -->
<param name="jar.build.dir" value="." />
<param name="includes" value="com/**, META-INF/**, *.properties" />
</antcall>
<antcall target="delete-duplicate-dependencies"></antcall>
</target>
</project>