]> SALOME platform Git repositories - tools/siman.git/blob
Salome HOME
0908c9c462d3d00aed8654f8df327320f83f6b59
[tools/siman.git] /
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                 <!-- Parameter "mode" can be "debug" or "release" -->
32                 <attribute name="mode" />
33                 <sequential>
34                         <echo message="Generating configuration in @{mode} mode" />
35                         <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
36                                 <fileset dir="${config.src.dir}/templates">
37                                 </fileset>
38                                 <filterset>
39                                         <filter token="datesimple" value="${datesimple}" />
40                                         <filter token="time" value="${time}" />
41                                         <filtersfile file="${config.src.dir}/@{mode}.properties" />
42                                         <filter token="config.src.dir" value="${basedir}${file.separator}${config.src.dir}${file.separator}templates" />
43                                 </filterset>
44                         </copy>
45                 </sequential>
46         </macrodef>
47
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" />
53         </target>
54
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" />
60         </target>
61
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" />
67
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                         <!-- Copy all sources except those which should be generated -->
72                         <classes dir="${siman.bin.dir}/classes">
73                                 <present present="srconly" targetdir="${config.release.dir}" />
74                         </classes>
75                         <!-- Copy generated sources -->
76                         <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
77                         <manifest>
78                                 <attribute name="Built-By" value="${app.author}" />
79                                 <attribute name="Version" value="${app.version}" />
80                                 <attribute name="Built-Date" value="${datesimple}" />
81                         </manifest>
82                         <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
83                         <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
84                         <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
85                         <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
86                 </war>
87         </target>
88
89         <!-- ================================================= -->
90         <!--    clean: Clean the dist directory                            -->
91         <!-- ================================================= -->
92         <target name="clean" description="clean the build directory">
93                 <echo message="deleting files in ${siman.dist.dir}" />
94                 <delete includeemptydirs="true" failonerror="false">
95                         <fileset dir="${siman.dist.dir}" includes="**/*" />
96                 </delete>
97         </target>
98 </project>