1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <project name="Siman-War" default="build-war">
4 <property environment="env" />
6 <property file="build.properties" description="set the build parameters" />
7 <property file="../${siman-common.project.name}/build.properties" description="set the build parameters" />
8 <property file="../${splat.project.name}/build.properties" description="set the build parameters" />
10 <property name="time.simple.pattern" value="dd/MM/yyyy" />
12 <format property="timesimple" pattern="${time.simple.pattern}" />
15 <!-- ================================================= -->
16 <!-- siman-common: Build Siman-Common project -->
17 <!-- ================================================= -->
18 <target name="siman-common" description="Builds Siman-Common project">
19 <ant dir="../${siman-common.project.name}" />
22 <!-- ================================================= -->
23 <!-- copy-config: Copy parametrized config files -->
24 <!-- ================================================= -->
25 <macrodef name="copy-config">
26 <attribute name="mode" />
28 <echo message="Generating configuration in @{mode} mode" />
29 <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
30 <fileset dir="${config.src.dir}/templates">
33 <filtersfile file="${config.src.dir}/@{mode}.properties" />
35 <filterchain><expandproperties/></filterchain>
40 <!-- ================================================= -->
41 <!-- debug-config: Generate parametrized config files -->
42 <!-- ================================================= -->
43 <target name="debug-config" description="Generate parametrized debug config files">
44 <copy-config mode="debug" />
47 <!-- =================================================== -->
48 <!-- release-config: Generate parametrized config files -->
49 <!-- =================================================== -->
50 <target name="release-config" description="Generate parametrized release config files">
51 <copy-config mode="release" />
54 <!-- ===================================================================== -->
55 <!-- build-dist : Create the war file -->
56 <!-- ===================================================================== -->
57 <target name="build-war" depends="clean, siman-common, release-config" description="Builds the WAR distribution">
58 <echo message="build ${webapp.name}.war" />
60 <mkdir dir="${siman.dist.dir}" />
61 <war destfile="${siman.dist.dir}/${webapp.name}.war" webxml="${basedir}/${siman.content.dir}/WEB-INF/web.xml">
62 <fileset dir="${siman.content.dir}" />
63 <classes dir="${siman.bin.dir}/classes">
64 <present present="srconly" targetdir="${config.release.dir}" />
66 <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
68 <attribute name="Built-By" value="${app.author}" />
69 <attribute name="Version" value="${app.version}" />
70 <attribute name="Built-Date" value="${timesimple}" />
72 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
73 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
74 <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
75 <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
79 <!-- ================================================= -->
80 <!-- clean: Clean the dist directory -->
81 <!-- ================================================= -->
82 <target name="clean" description="clean the build directory">
83 <echo message="deleting files in ${siman.dist.dir}" />
84 <delete includeemptydirs="true" failonerror="false">
85 <fileset dir="${siman.dist.dir}" includes="**/*" />