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 <property name="time.pattern" value="hh:mm:ss" />
17 <format property="time" pattern="${time.pattern}" />
20 <!-- ================================================= -->
21 <!-- siman-common: Build Siman-Common project -->
22 <!-- ================================================= -->
23 <target name="siman-common" description="Builds Siman-Common project">
24 <ant dir="../${siman-common.project.name}" />
27 <!-- ================================================= -->
28 <!-- copy-config: Copy parametrized config files -->
29 <!-- ================================================= -->
30 <macrodef name="copy-config">
31 <attribute name="mode" />
33 <echo message="Generating configuration in @{mode} mode" />
34 <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
35 <fileset dir="${config.src.dir}/templates">
38 <filter token="timesimple" value="${timesimple}"/>
39 <filter token="timesimple" value="${timesimple}"/>
42 <filtersfile file="${config.src.dir}/@{mode}.properties" />
48 <!-- ================================================= -->
49 <!-- debug-config: Generate parametrized config files -->
50 <!-- ================================================= -->
51 <target name="debug-config" description="Generate parametrized debug config files">
52 <copy-config mode="debug" />
55 <!-- =================================================== -->
56 <!-- release-config: Generate parametrized config files -->
57 <!-- =================================================== -->
58 <target name="release-config" description="Generate parametrized release config files">
59 <copy-config mode="release" />
62 <!-- ===================================================================== -->
63 <!-- build-dist : Create the war file -->
64 <!-- ===================================================================== -->
65 <target name="build-war" depends="clean, siman-common, release-config" description="Builds the WAR distribution">
66 <echo message="build ${webapp.name}.war" />
68 <mkdir dir="${siman.dist.dir}" />
69 <war destfile="${siman.dist.dir}/${webapp.name}.war" webxml="${basedir}/${siman.content.dir}/WEB-INF/web.xml">
70 <fileset dir="${siman.content.dir}" />
71 <classes dir="${siman.bin.dir}/classes">
72 <present present="srconly" targetdir="${config.release.dir}" />
74 <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
76 <attribute name="Built-By" value="${app.author}" />
77 <attribute name="Version" value="${app.version}" />
78 <attribute name="Built-Date" value="${timesimple}" />
80 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
81 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
82 <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
83 <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
87 <!-- ================================================= -->
88 <!-- clean: Clean the dist directory -->
89 <!-- ================================================= -->
90 <target name="clean" description="clean the build directory">
91 <echo message="deleting files in ${siman.dist.dir}" />
92 <delete includeemptydirs="true" failonerror="false">
93 <fileset dir="${siman.dist.dir}" includes="**/*" />