-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
81 lines (73 loc) · 3.23 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="ARE">
<target name="init" description="init">
<property environment="env" />
<property name="name" value="ARE"/>
<property name="src" value="${basedir}/src"/>
<property name="web_content" value="${basedir}/WebContent"/>
<property name="lib" value="${web_content}/WEB-INF/lib"/>
<property name="version" value="${env.VERSION}" />
<property name="build" value="${basedir}/build"/>
<property name="build.src" value="${basedir}/build/ARE/src"/>
<property name="build.dest" value="${basedir}/build/ARE/WEB-INF/classes"/>
<property name="buildwar.dest" value="${basedir}/build/ARE"/>
<property name="war.dest" value="${basedir}/build/war"/>
<!--<property name="tomcatlib.dir" value="/opt/uoa/tomcat/lib"/>-->
<property name="tomcatlib.dir" value="/usr/share/tomcat7/lib"/>
<path id="classpath">
<fileset dir="${tomcatlib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
</target>
<target name="prepare" depends="init" description="prepare">
<delete dir="${build}"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<mkdir dir="${buildwar.dest}"/>
<mkdir dir="${war.dest}"/>
<copy todir="${build.src}">
<fileset dir="${src}"/>
</copy>
<copy todir="${buildwar.dest}">
<fileset dir="${web_content}"/>
</copy>
</target>
<target name="build" depends="prepare" description="build">
<echo message="version=${version}" />
<javac includeantruntime="false" srcdir="${build.src}" destdir="${build.dest}">
<classpath refid="classpath"/>
<compilerarg value="-g:lines,vars,source" />
<compilerarg line="-encoding UTF-8" />
</javac>
<copy todir="${build.dest}">
<fileset dir="${build.src}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/*.sci"/>
</fileset>
</copy>
<exec executable="sh" outputproperty="noOfFiles">
<arg value="-c" />
<arg value="/bin/sed -e 's/__build_number__/${version}/g' ${buildwar.dest}/WEB-INF/conf/app.properties > ${buildwar.dest}/WEB-INF/conf/app.properties.bak" />
</exec>
<exec executable="sh" outputproperty="noOfFiles">
<arg value="-c" />
<arg value="/bin/mv ${buildwar.dest}/WEB-INF/conf/app.properties.bak ${buildwar.dest}/WEB-INF/conf/app.properties" />
</exec>
</target>
<target name="war" depends="build" description="build war">
<delete dir="${build.src}"/>
<war warfile="${war.dest}/ARE.war" webxml="${buildwar.dest}/WEB-INF/web.xml">
<lib dir="${buildwar.dest}/WEB-INF/lib"/>
<classes dir="${build.dest}"/>
<fileset dir="${buildwar.dest}"/>
</war>
</target>
<target name="clean" depends="init" description="clean">
<delete dir="${build}"/>
</target>
</project>