1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- ****************************************************** -->
3 <!-- Copyright (c) 2006 - Berlin Brown -->
4 <!-- Ant script that is located in the Tomcat webapp directory and -->
5 <!-- writes classes to this particular directory -->
6 <!-- Description: Testing ruby with with spring web application -->
7 <!-- Date: 11/1/2006 -->
9 <!-- + 3/10/2008 - updated core libraries to most recent versions, spring, etc -->
10 <!-- + 3/14/2008 - Moved classpath to property file -->
11 <!-- ****************************************************** -->
12 <project name="OpenBotlist Main Build File" default="package" basedir=".">
14 <property file="build.properties" />
15 <property name="build.dir" value="${basedir}/build"/>
16 <property name="build.classes.dir" value="${basedir}/build/classes"/>
17 <property name="src.dir" value="${basedir}/src"/>
18 <property name="scala.src.dir" value="${basedir}/apps_src/scala"/>
19 <property name="lib.dir" value="${basedir}/WEB-INF/lib"/>
20 <property name="lib.runtime.dir" value="${basedir}/runtime-lib"/>
21 <property name="lib.servlet.dir" value="${basedir}/servlet-lib"/>
22 <property file="${basedir}/build_classpath.properties" />
24 <!-- Web Apps Directory -->
25 <property name="default.tomcat.webapps" value="${tomcat.home}/webapps" />
27 <!-- Import the classpath usage and variable names -->
28 <import file="${basedir}/build_classpath_paths.xml" />
30 <target name="help" description="Initialization">
32 <echo message="Running with Tomcat Home=${tomcat.home}" />
33 <echo message="Classpth properties, lib.dir=${classpath.lib.dir}" />
35 Additional Targets and Usage:
37 scala.compile - to compile the scala source, use this target.
38 To build the complete release package,
39 you must compile this manually.
40 full.deploy - Compile the source, including scala source.
41 Deploy to the application server.
44 <fail unless="classpath.include">Error loading build_classpath.property file. Make sure it exists.</fail>
47 <!-- Target: Prepare -->
48 <target name="prepare" depends="help">
49 <mkdir dir="${build.dir}"/>
50 <mkdir dir="${build.classes.dir}"/>
53 <!-- Target: Compile -->
54 <target name="compile" depends="prepare">
55 <javac deprecation="true"
58 destdir="${build.classes.dir}"
60 <classpath refid="classpath"/>
61 <compilerarg value="-Xlint" />
66 <!-- **************************************** -->
67 <!-- Add support for scala compiles, used with liftweb apps -->
68 <!-- Date Created: 12/29/2007 -->
69 <!-- **************************************** -->
70 <taskdef resource="scala/tools/ant/antlib.xml">
71 <classpath refid="classpath.scala" />
74 <!-- Target: Compile Scala Source -->
75 <target name="scala.compile" depends="compile">
76 <scalac srcdir="${scala.src.dir}"
77 destdir="${build.classes.dir}"
78 classpathref="classpath.scala" force="never">
79 <include name="**/*.scala"/>
83 <!-- Target: Build -->
84 <target name="package" depends="prepare">
87 <!-- Target: Tomcat.deploy -->
88 <target name="tomcat.deploy" depends="package">
89 <!-- Copy WEB-INF Classes Directory -->
90 <!-- With this build configuration, this assumes that the build script
91 is located with the webapp directory -->
92 <copy todir="${basedir}/WEB-INF/classes">
93 <fileset dir="${basedir}/build/classes">
97 <!-- End of Target Tomcat Deploy -->
100 <target name="full.deploy" depends="package, compile, scala.compile, tomcat.deploy">
103 <!-- Jar/War the Web Archive File -->
104 <!-- Note: using jar task because we are working out of a web-application -->
106 <target name="jar.webapp" depends="package">
107 <fail unless="appname.war">APPNAME.WAR must be set, see the build.properties file</fail>
109 <fileset dir="${build.dir}">
110 <include name="**/*.zip"/>
111 <include name="**/*.jar"/>
112 <include name="**/*.war"/>
115 <jar destfile="${basedir}/build/${appname.war}.war" basedir="${basedir}" />
118 <!-- Build beans jar -->
119 <target name="jar.botlist.beans" depends="compile">
120 <jar jarfile="${build.dir}/botlistbeans.jar">
121 <fileset dir="${basedir}/WEB-INF/classes" >
122 <include name="org/spirit/bean/impl/**/*.class"/>
127 <!-- Zip the development code base -->
128 <target name="zip.codebase" depends="clean,prepare">
129 <fail unless="appname.war">APPNAME.WAR must be set, see the build.properties file</fail>
130 <zip destfile="${basedir}/build/${appname.war}_src.zip" basedir="${basedir}" />
133 <!-- Generate Version -->
134 <target name="generate.vers" depends="package">
135 <exec executable="${basedir}/getsvnversion.sh" spawn="false" failonerror="false"></exec>
136 <java classname="org.spirit.util.version.BotListVersionReader">
137 <classpath refid="classpath" />
139 <pathelement location="${basedir}" />
142 <arg value="${basedir}/WEB-INF/classes/version.properties"/>
147 <target name="clean">
148 <delete dir="${build.dir}" />
150 <fileset dir="${basedir}/WEB-INF/tools">
151 <!-- Delete compiled python files, make sure not to remove your *.py files -->
152 <include name="**/*.pyc" />
154 <fileset dir="${basedir}/WEB-INF/classes">
155 <include name="**/*.class" />
156 <include name="**/*.log" />
157 <exclude name="**/*.properties" />
158 <exclude name="**/*.xml" />
160 <!-- Clean files against entire project. NOTE: this can be a dangerous task -->
161 <fileset dir="${basedir}">
162 <include name="**/*.log" />
163 <include name="**/Thumbs.db" />
167 <!-- End of Main Clean -->
169 <!-- Clean the logs -->
170 <target name="clean.logs">
171 <!-- Check if the ant property setting has been set -->
172 <fail unless="tomcat.home">TOMCAT_HOME must be set, see the build.properties file</fail>
174 <!-- Remove all the log files including those without log extension -->
175 <fileset dir="${tomcat.home}/logs">
182 <!-- End of the File -->