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="datesimple" 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 <!-- Parameter "mode" can be equal to "debug" or "release" -->
32 <attribute name="mode" />
34 <echo message="Generating configuration in @{mode} mode" />
35 <!-- Copy files from config source directory according to the given mode -->
36 <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
37 <fileset dir="${config.src.dir}/templates">
39 <!-- Transform the files from templates substituting properties values -->
41 <filter token="datesimple" value="${datesimple}" />
42 <filter token="time" value="${time}" />
43 <!-- Get properties to substitute according to the given mode -->
44 <filtersfile file="${config.src.dir}/@{mode}.properties" />
45 <!-- Substitute the complete config source directory path value in files -->
46 <filter token="config.src.dir" value="${basedir}${file.separator}${config.src.dir}${file.separator}templates" />
52 <!-- ================================================= -->
53 <!-- debug-config: Generate parametrized config files -->
54 <!-- ================================================= -->
55 <target name="debug-config" description="Generate parametrized debug config files">
56 <copy-config mode="debug" />
59 <!-- =================================================== -->
60 <!-- release-config: Generate parametrized config files -->
61 <!-- =================================================== -->
62 <target name="release-config" description="Generate parametrized release config files">
63 <copy-config mode="release" />
66 <!-- ===================================================================== -->
67 <!-- compile-java : compile the java classes -->
68 <!-- ===================================================================== -->
69 <target name="compile-java" depends="clean, siman-common" description="Builds the java classes">
70 <echo message="Compile Siman java classes" />
71 <!-- <delete dir="${siman.bin.dir}/temp" quiet="true"/>-->
73 <javac target="1.6" srcdir="${siman.src.dir}" destdir="temp" debug="${compiler.debug}"
74 nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}"
75 optimize="${compiler.optimize}" deprecation="${compiler.deprecation}">
77 <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.ext.dir}" includes="**/*" />
78 <fileset dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*" />
79 <fileset dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*" />
80 <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*" />
81 <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*" />
82 <fileset dir="${siman.content.dir}/WEB-INF/lib" includes="**/*" />
84 <exclude name="test/**" />
88 <!-- ===================================================================== -->
89 <!-- build-dist : Create the war file -->
90 <!-- ===================================================================== -->
91 <target name="build-war" depends="clean, siman-common, compile-java, release-config" description="Builds the WAR distribution">
92 <echo message="build ${webapp.name}.war" />
94 <mkdir dir="${siman.dist.dir}" />
95 <war destfile="${siman.dist.dir}/${webapp.name}.war" webxml="${basedir}/${siman.content.dir}/WEB-INF/web.xml">
96 <fileset dir="${siman.content.dir}" />
97 <!-- Copy all sources except those which should be generated -->
98 <classes dir="${siman.bin.dir}/classes">
99 <present present="srconly" targetdir="${config.release.dir}" />
101 <!-- Copy generated sources -->
102 <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
104 <attribute name="Built-By" value="${app.author}" />
105 <attribute name="Version" value="${app.version}" />
106 <attribute name="Built-Date" value="${datesimple}" />
108 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
109 <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
110 <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
111 <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
115 <!-- ================================================= -->
116 <!-- clean: Clean the dist directory -->
117 <!-- ================================================= -->
118 <target name="clean" description="clean the build directory">
119 <echo message="deleting files in ${siman.dist.dir}" />
120 <delete includeemptydirs="true" failonerror="false">
121 <fileset dir="${siman.dist.dir}" includes="**/*" />