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 <filter token="timesimple" value="${timesimple}"/>
36 <filtersfile file="${config.src.dir}/@{mode}.properties" />
42 <!-- ================================================= -->
43 <!-- debug-config: Generate parametrized config files -->
44 <!-- ================================================= -->
45 <target name="debug-config" description="Generate parametrized debug config files">
46 <copy-config mode="debug" />
49 <!-- =================================================== -->
50 <!-- release-config: Generate parametrized config files -->
51 <!-- =================================================== -->
52 <target name="release-config" description="Generate parametrized release config files">
53 <copy-config mode="release" />
56 <!-- ===================================================================== -->
57 <!-- build-dist : Create the war file -->
58 <!-- ===================================================================== -->
59 <target name="build-war" depends="clean, siman-common, release-config" description="Builds the WAR distribution">
60 <echo message="build ${webapp.name}.war" />
62 <mkdir dir="${siman.dist.dir}" />
63 <war destfile="${siman.dist.dir}/${webapp.name}.war" webxml="${basedir}/${siman.content.dir}/WEB-INF/web.xml">
64 <fileset dir="${siman.content.dir}" />
65 <classes dir="${siman.bin.dir}/classes">
66 <present present="srconly" targetdir="${config.release.dir}" />
68 <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
70 <attribute name="Built-By" value="${app.author}" />
71 <attribute name="Version" value="${app.version}" />
72 <attribute name="Built-Date" value="${timesimple}" />
74 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
75 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
76 <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
77 <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
81 <!-- ================================================= -->
82 <!-- clean: Clean the dist directory -->
83 <!-- ================================================= -->
84 <target name="clean" description="clean the build directory">
85 <echo message="deleting files in ${siman.dist.dir}" />
86 <delete includeemptydirs="true" failonerror="false">
87 <fileset dir="${siman.dist.dir}" includes="**/*" />