-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
83 lines (71 loc) · 3.08 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
<project basedir="." default="dist-jar">
<!-- Allow override properties -->
<property file="${user.home}/.build.properties" />
<property file="build.properties" />
<!-- Property default values. May be overridden using above files or via command-line args -->
<property name="jar.name" value="alfresco-persistence-layer.jar" />
<property name="config.includes" value="**/*.*" />
<property name="build.lib.dir" value="webapps/alfresco/WEB-INF/lib" />
<property name="src" value="source/java" />
<!-- Additional property values. Generally should not be overridden -->
<property name="config.dir" value="${basedir}/config" />
<property name="build.dir" value="${basedir}/build" />
<property name="build.jar.dir" value="${build.dir}/jar" />
<property name="dist.dir" value="${build.dir}/dist" />
<condition property="build.debug" value="on">
<isset property="debug" />
</condition>
<condition property="build.debuglevel" value="lines,vars,source">
<isset property="debug" />
</condition>
<condition property="build.debug" value="off">
<not>
<isset property="debug" />
</not>
</condition>
<!-- Main build target definitions -->
<target name="deploy" depends="copy-tomcat-jar" />
<!-- Clean out the build and distribution directories -->
<target name="clean" description="Clean out all build directories">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<!-- Create required prerequisite directory structure -->
<target name="prepare" description="Create initial build structures">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${build.jar.dir}" />
</target>
<target name="compile" depends="prepare" description="Compile the source " >
<javac srcdir="${src}" destdir="${build.jar.dir}" debug="${build.debug}" debuglevel="${build.debuglevel}">
<classpath>
<fileset dir="${tomcat.repo.home}/webapps/alfresco/WEB-INF/lib">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="build-jar" description="Assemble configuration and resource files in a JAR file structure">
<!-- Copy configuration files, web scripts, etc. directly into the JAR so they appear on the
classpath. -->
<copy todir="${build.jar.dir}" includeEmptyDirs="false">
<fileset dir="${config.dir}" includes="${config.includes}" />
</copy>
<mkdir dir="${build.jar.dir}/META-INF" />
</target>
<!-- Build the JAR file -->
<target name="dist-jar" depends="clean, prepare, compile, build-jar" description="Build a JAR file containing configuration and resource files">
<jar destfile="${dist.dir}/${jar.name}">
<fileset dir="${build.jar.dir}" />
</jar>
</target>
<!--
Copy JAR file into a local Tomcat instance.
-->
<target name="copy-tomcat-jar" depends="dist-jar" description="Copy JAR file into a local Tomcat instance">
<mkdir dir="${tomcat.repo.home}/${build.lib.dir}" />
<copy todir="${tomcat.repo.home}/${build.lib.dir}">
<fileset file="${dist.dir}/${jar.name}" />
</copy>
</target>
</project>