]> SALOME platform Git repositories - tools/siman.git/blob
Salome HOME
bb7beb13fac48968fd3ca669720f40ddbfda8440
[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                                         <filtersfile file="${config.src.dir}/@{mode}.properties" />
34                                 </filterset>
35                                 <filterchain><expandproperties/></filterchain>
36                         </copy>
37                 </sequential>
38         </macrodef>
39
40         <!-- ================================================= -->
41         <!--  debug-config: Generate parametrized config files -->
42         <!-- ================================================= -->
43         <target name="debug-config" description="Generate parametrized debug config files">
44                 <copy-config mode="debug" />
45         </target>
46
47         <!-- =================================================== -->
48         <!--  release-config: Generate parametrized config files -->
49         <!-- =================================================== -->
50         <target name="release-config" description="Generate parametrized release config files">
51                 <copy-config mode="release" />
52         </target>
53
54         <!-- ===================================================================== -->
55         <!-- build-dist : Create the war file                                                      -->
56         <!-- ===================================================================== -->
57         <target name="build-war" depends="clean, siman-common, release-config" description="Builds the WAR distribution">
58                 <echo message="build ${webapp.name}.war" />
59
60                 <mkdir dir="${siman.dist.dir}" />
61                 <war destfile="${siman.dist.dir}/${webapp.name}.war" webxml="${basedir}/${siman.content.dir}/WEB-INF/web.xml">
62                         <fileset dir="${siman.content.dir}" />
63                         <classes dir="${siman.bin.dir}/classes">
64                                 <present present="srconly" targetdir="${config.release.dir}" />
65                         </classes>
66                         <zipfileset dir="${config.release.dir}" prefix="WEB-INF/classes" />
67                         <manifest>
68                                 <attribute name="Built-By" value="${app.author}" />
69                                 <attribute name="Version" value="${app.version}" />
70                                 <attribute name="Built-Date" value="${timesimple}" />
71                         </manifest>
72                         <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*.jar" />
73                         <lib dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*.jar" />
74                         <lib dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*.jar" />
75                         <lib dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*.jar" />
76                 </war>
77         </target>
78
79         <!-- ================================================= -->
80         <!--    clean: Clean the dist directory                            -->
81         <!-- ================================================= -->
82         <target name="clean" description="clean the build directory">
83                 <echo message="deleting files in ${siman.dist.dir}" />
84                 <delete includeemptydirs="true" failonerror="false">
85                         <fileset dir="${siman.dist.dir}" includes="**/*" />
86                 </delete>
87         </target>
88 </project>