root/jemdros/build.xml

Revision 215, 6.4 kB (checked in by chris, 1 year ago)

Check in jemdros code.

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 /****************************************************
4 **  Edit For Each Project
5 **
6 **  You should expect to have to edit the following
7 **  section for each project.
8 ****************************************************/
9 -->
10
11 <!--Project. Configuration that affects the project as a whole, project name etc.-->
12
13 <project basedir="." default="jar" name="com.qwirx.jemdros">
14
15     <property name="package" value="com.qwirx"/>
16
17 <!--Compile. Location of source files, destination of compiled files, files to include in compilation etc.-->
18     <property name="build.directory" value="tmp"/>
19     <property name="source.directory" value="src"/>
20     <property name="lib.directory" value="lib/"/>
21     <property name="build.compiler" value="modern"/>
22 <!--Allow shell environment variables to be called with the "env." prefix -->   
23         <property environment="env"/>
24        
25     <path id="classpath">
26         <fileset dir="${lib.directory}">
27             <include name="**/*.jar"/>
28         </fileset>
29     </path>
30
31         <!--Distribution. Where the distributable results of the build are placed.-->
32     <property name="distribution.directory" value="dist"/>
33
34         <!--Jar. Name of the jar file produced by the build process -->
35     <!--name and location of the jar file to build-->
36     <property name="jar.directory" value="${distribution.directory}"/>
37     <property name="jar.name" value="com.qwirx.jemdros.jar"/>
38     <property name="jar.basedirectory" value="${build.directory}"/>
39        
40     <!--exclude all unit test files from the jar file-->
41     <!-- <property name="jar.excludes" value="**/test/**"/> -->
42
43 <!--Resources. The location of other resources other than source code-->
44     <property name="jsp.directory" value="jsp"/>   
45
46 <!--These are to put in the released Jar's manifest. -->
47     <property name="release.version" value="${RELEASE_VERSION}"/>
48
49 <!--
50 /****************************************************
51 **  Restricted Edit
52 **
53 **  You shouldn't have to edit anything below.
54 ****************************************************/ -->
55
56
57
58 <!--
59 /*****************************************************
60 **  Initialise
61 ******************************************************/-->
62     <target name="init">
63         <tstamp/>
64     </target>
65        
66 <!--
67 /*****************************************************
68 **  Compile: Delete the build directory, recreate it and compile all the source code
69 ******************************************************/-->
70     <target name="compile" depends="init" unless="build.compiled">
71         <delete dir="${build.directory}"/>
72         <mkdir dir="${build.directory}"/>
73                 <javac classpathref="classpath"
74                         srcdir="${source.directory}"
75                         destdir="${build.directory}"
76                         source="1.3" target="1.3" debug="yes" />
77         <copy todir="${build.directory}">
78             <fileset dir="${source.directory}">
79                 <include name="**/*.xsl"/>
80                 <include name="**/*.html"/>
81                 <include name="**/*.js"/>
82             </fileset>
83         </copy>
84                 <property name="build.compiled" value="true"/>
85     </target>
86        
87         <target name="javac">
88                 <javac debug="on" optimize="off"
89                 destdir="${build.directory}"
90                         includes="com/qwirx/db/**/*.java">
91                 <src path="${source.directory}" />
92                         <classpath refid="classpath"/>
93         </javac>
94         </target>
95        
96 <!--
97 /*****************************************************
98 **  Compile Tests: Compile all the source code in test dir
99 ******************************************************/-->
100     <target name="compile-tests" depends="compile">
101         <javac deprecation="on" debug="on" optimize="off" destdir="${build.directory}" srcdir="${test.source.directory}">
102             <classpath refid="classpath"/>
103         </javac>
104         <copy todir="${build.directory}">
105             <fileset dir="${test.source.directory}">
106                 <include name="*.properties"/>
107                 <include name="**/*.properties"/>
108             </fileset>
109         </copy>
110     </target>
111
112 <!--
113 /*****************************************************
114 **  Compile Tests: Compile all the source code in test dir
115 **    Assume that compile has already happened, to save us
116 **    compiling the main stuff twice.  But have check aswell
117 ******************************************************/-->
118     <target name="compile-tests-after-war">
119                 <fail message="Compile has not happened" unless="build.compiled"/>
120         <javac deprecation="on" debug="on" optimize="off" destdir="${build.directory}" srcdir="${test.source.directory}">
121             <classpath refid="classpath"/>
122         </javac>
123         <copy todir="${build.directory}">
124             <fileset dir="${test.source.directory}">
125                 <include name="*.properties"/>
126                 <include name="**/*.properties"/>
127             </fileset>
128         </copy>
129     </target>
130
131 <!--
132 /*****************************************************
133 **  Build Jar file
134 ******************************************************/
135 -->
136     <target name="jar" depends="compile">
137         <mkdir dir="${jar.directory}"/>
138         <jar jarfile="${jar.directory}/${jar.name}" basedir="${jar.basedirectory}">
139                   <manifest>
140                     <section name="org/aidworld">
141                       <attribute name="Implementation-Title" value="loband"/>
142                       <attribute name="Implementation-Version" value="${release.version}, ${TODAY}"/>
143                       <attribute name="Implementation-Vendor" value="aidworld"/>
144                     </section>
145                   </manifest>
146         </jar>
147     </target>
148
149 <!--
150 /*****************************************************
151 **  Build .War file
152 ******************************************************/-->
153     <target name="war" depends="jar">
154         <mkdir dir="${war.directory}"/>
155         <war warfile="${war.directory}/${war.filename}" webxml="${war.webxml}">
156             <classes dir="${build.directory}">
157                 <include name="*.*"/>
158                 <exclude name="web.xml"/>
159             </classes>
160             <classes dir="${properties.directory}">
161                 <include name="*.properties"/>
162             </classes>
163             <lib dir="${lib.directory}">
164                 <include name="*.jar"/>
165                 <include name="*.zip"/>
166                 <exclude name="servlet.jar"/>
167                 <exclude name="xercesImpl.jar"/>
168             </lib>
169             <lib dir="${jar.directory}">
170                 <include name="*.jar"/>
171             </lib>
172             <fileset dir="${jsp.directory}">
173                 <exclude name="WEB-INF/web.xml"/>
174                 </fileset>
175         </war>
176     </target>
177 </project>
Note: See TracBrowser for help on using the browser.