]> SALOME platform Git repositories - tools/siman.git/blob
Salome HOME
175372c0a2728e2769549059415c6ffdf51f5233
[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="timesimple" pattern="${time.simple.pattern}" />
13         </tstamp>
14
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}" />
20         </target>
21
22         <!-- ================================================= -->
23         <!--    copy-config: Copy parametrized config files        -->
24         <!-- ================================================= -->
25         <macrodef name="copy-config">
26                 <attribute name="mode" />
27                 <sequential>
28                         <echo message="Generating configuration in @{mode} mode" />
29                         <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
30                                 <fileset dir="${config.src.dir}/templates">
31                                 </fileset>
32                                 <filterset>
33                                     <filter token="timesimple" value="${timesimple}"/>
34                                 </filterset>
35                                 <filterset>
36                                         <filtersfile file="${config.src.dir}/@{mode}.properties" />
37                                 </filterset>
38                         </copy>
39                 </sequential>
40         </macrodef>
41
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" />
47         </target>
48
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" />
54         </target>
55
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" />
61
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}" />
67                         </classes>
68                         <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
69                         <manifest>
70                                 <attribute name="Built-By" value="${app.author}" />
71                                 <attribute name="Version" value="${app.version}" />
72                                 <attribute name="Built-Date" value="${timesimple}" />
73                         </manifest>
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" />
78                 </war>
79         </target>
80
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="**/*" />
88                 </delete>
89         </target>
90 </project>