Salome HOME
*** empty log message ***
[tools/siman.git] / Workspace / .metadata / .plugins / org.eclipse.core.resources / .history / b1 / f09e1226d803001210aca2509c1ad977
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <project name="Siman-War" default="build-war">
3
4         <property environment="env" />
5
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" />
9
10         <property name="time.simple.pattern" value="dd/MM/yyyy" />
11         <tstamp>
12                 <format property="datesimple" pattern="${time.simple.pattern}" />
13         </tstamp>
14
15         <property name="time.pattern" value="hh:mm:ss" />
16         <tstamp>
17                 <format property="time" pattern="${time.pattern}" />
18         </tstamp>
19
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}" />
25         </target>
26
27         <!-- ================================================= -->
28         <!--    copy-config: Copy parametrized config files        -->
29         <!-- ================================================= -->
30         <macrodef name="copy-config">
31                 <attribute name="mode" />
32                 <sequential>
33                         <echo message="Generating configuration in @{mode} mode" />
34                         <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
35                                 <fileset dir="${config.src.dir}/templates">
36                                 </fileset>
37                                 <filterset>
38                                         <filter token="datesimple" value="${datesimple}" />
39                                         <filter token="time" value="${time}" />
40                                         <filtersfile file="${config.src.dir}/@{mode}.properties" />
41                                         <filter token="config.src.dir" value="${basedir}${file.separator}${config.src.dir}${file.separator}templates" />
42                                 </filterset>
43                         </copy>
44                 </sequential>
45         </macrodef>
46
47         <!-- ================================================= -->
48         <!--  debug-config: Generate parametrized config files -->
49         <!-- ================================================= -->
50         <target name="debug-config" description="Generate parametrized debug config files">
51                 <copy-config mode="debug" />
52         </target>
53
54         <!-- =================================================== -->
55         <!--  release-config: Generate parametrized config files -->
56         <!-- =================================================== -->
57         <target name="release-config" description="Generate parametrized release config files">
58                 <copy-config mode="release" />
59         </target>
60
61         <!-- ===================================================================== -->
62         <!-- build-dist : Create the war file                                                      -->
63         <!-- ===================================================================== -->
64         <target name="build-war" depends="clean, siman-common, release-config" description="Builds the WAR distribution">
65                 <echo message="build ${webapp.name}.war" />
66
67                 <mkdir dir="${siman.dist.dir}" />
68                 <war destfile="${siman.dist.dir}/${webapp.name}.war" webxml="${basedir}/${siman.content.dir}/WEB-INF/web.xml">
69                         <fileset dir="${siman.content.dir}" />
70                         <!-- Copy all sources except those which should be generated -->
71                         <classes dir="${siman.bin.dir}/classes">
72                                 <present present="srconly" targetdir="${config.release.dir}" />
73                         </classes>
74                         <!-- Copy generated sources -->
75                         <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
76                         <manifest>
77                                 <attribute name="Built-By" value="${app.author}" />
78                                 <attribute name="Version" value="${app.version}" />
79                                 <attribute name="Built-Date" value="${datesimple}" />
80                         </manifest>
81                         <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
82                         <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
83                         <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
84                         <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
85                 </war>
86         </target>
87
88         <!-- ================================================= -->
89         <!--    clean: Clean the dist directory                            -->
90         <!-- ================================================= -->
91         <target name="clean" description="clean the build directory">
92                 <echo message="deleting files in ${siman.dist.dir}" />
93                 <delete includeemptydirs="true" failonerror="false">
94                         <fileset dir="${siman.dist.dir}" includes="**/*" />
95                 </delete>
96         </target>
97 </project>