Salome HOME
Exclude the CASTEM translations from France version of the som.properties
[tools/siman.git] / Workspace / Siman / build.xml
index 1c355957f2b3959f10784b3329979412ee88a380..d585c6df03d84c4280a3330a4ce99e4f9aabcaab 100644 (file)
        </tstamp>
 
        <!-- ================================================= -->
-       <!--    siman-common: Build Siman-Common project           -->
+       <!--    launcher: Build launcher jar                   -->
+       <!-- ================================================= -->
+       <target name="launcher" depends="compile-java" description="Builds launcher jar">
+               <delete file="${siman.content.dir}/jap/splat-launcher.jar" />
+               <jar destfile="${siman.content.dir}/jap/splat-launcher.jar">
+                       <zipfileset dir="${siman.bin.dir}/classes">
+                               <include name="org/splat/launcher/**" />
+                       </zipfileset>
+                       <manifest>
+                <attribute name="Built-By" value="${app.author}" />
+                <attribute name="Version" value="${app.version}" />
+                               <attribute name="Built-Date" value="${datesimple}" />
+                       </manifest>
+               </jar>
+       </target>
+       
+       <!-- ================================================= -->
+       <!--    launcher: Sign launcher jar                    -->
+       <!-- ================================================= -->
+       <target name="sign-launcher" depends="launcher" description="Signs launcher jar">
+               <!-- jarsigner -verbose -keystore launcherkeystore -signedjar splat-signedlauncher.jar splat-launcher.jar launcheralias-->
+               <delete file="${siman.content.dir}/jap/splat-signedlauncher.jar" />
+               <signjar verbose="on" keystore="${siman.content.dir}/jap/launcherkeystore" signedjar="${siman.content.dir}/jap/splat-signedlauncher.jar" jar="${siman.content.dir}/jap/splat-launcher.jar" alias="launcheralias" storepass="launcher" />
+       </target>
+
+       <!-- ================================================= -->
+       <!--    siman-common: Build Siman-Common project       -->
        <!-- ================================================= -->
        <target name="siman-common" description="Builds Siman-Common project">
                <ant dir="../${siman-common.project.name}" />
                <sequential>
                        <echo message="Generating configuration in @{mode} mode" />
                        <!-- Copy files from config source directory according to the given mode -->
+            <loadfile property="customer" srcfile="${config.src.dir}/customer.txt"/>
+            <loadfile property="som" srcfile="${config.src.dir}/${customer}_som.properties"/>
+                       <echo message="som: ${som}"/>
+            <loadfile property="som.en" srcfile="${config.src.dir}/${customer}_som_en.properties"/>
                        <copy todir="${basedir}/${config.@{mode}.dir}" overwrite="true">
                                <fileset dir="${config.src.dir}/templates">
                                </fileset>
                                <!-- Transform the files from templates substituting properties values -->
                                <filterset>
-                                       <filter token="datesimple" value="${datesimple}" />
+                    <filter token="som" value="${som}" />
+                    <filter token="som.en" value="${som.en}" />
+                    <filter token="datesimple" value="${datesimple}" />
                                        <filter token="time" value="${time}" />
                                        <!-- Get properties to substitute according to the given mode -->
                                        <filtersfile file="${config.src.dir}/@{mode}.properties" />
                <copy-config mode="release" />
        </target>
 
-    <!-- ===================================================================== -->
-    <!-- compile-java : compile the java classes                               -->
-    <!-- ===================================================================== -->
-    <target name="compile-java" depends="clean, siman-common" description="Builds the java classes">
-        <echo message="Compile Siman java classes" />
-<!--           <delete dir="${siman.bin.dir}/temp" quiet="true"/>-->
-        <mkdir dir="temp"/>
-        <javac target="1.6" srcdir="${siman.src.dir}"  destdir="temp" debug="${compiler.debug}" 
-               nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" 
-               optimize="${compiler.optimize}" deprecation="${compiler.deprecation}">
-            <classpath>
-                <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.ext.dir}" includes="**/*" />
-                <fileset dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*" />
-                <fileset dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*" />
-                <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*" />
-                <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*" />
-                <fileset dir="${siman.content.dir}/WEB-INF/lib" includes="**/*" />
-             </classpath>
-            <exclude name="test/**" />
-        </javac>
-    </target>
+       <!-- ===================================================================== -->
+       <!-- compile-java : compile the java classes                               -->
+       <!-- ===================================================================== -->
+       <target name="compile-java" depends="clean, siman-common" description="Builds the java classes">
+               <echo message="Compile Siman java classes" />
+               <!--            <delete dir="${siman.bin.dir}/temp" quiet="true"/>-->
+               <mkdir dir="temp" />
+               <javac target="1.6" srcdir="${siman.src.dir}" destdir="temp" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memoryMaximumSize="${compiler.max.memory}" optimize="${compiler.optimize}" deprecation="${compiler.deprecation}">
+                       <classpath>
+                               <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.ext.dir}" includes="**/*" />
+                               <fileset dir="${basedir}/../${splat.project.name}/${splat.dist.dir}" includes="**/*" />
+                               <fileset dir="${basedir}/../${splat.project.name}/${splat.lib.dir}" includes="**/*" />
+                               <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.dist.dir}" includes="**/*" />
+                               <fileset dir="${basedir}/../${siman-common.project.name}/${siman-common.lib.dir}" includes="**/*" />
+                               <fileset dir="${siman.content.dir}/WEB-INF/lib" includes="**/*" />
+                       </classpath>
+                       <exclude name="test/**" />
+               </javac>
+       </target>
 
        <!-- ===================================================================== -->
        <!-- build-dist : Create the war file                                                      -->
        <!-- ===================================================================== -->
-       <target name="build-war" depends="clean, siman-common, compile-java, release-config" description="Builds the WAR distribution">
+       <target name="build-war" depends="clean, sign-launcher, launcher, siman-common, compile-java, release-config" description="Builds the WAR distribution">
                <echo message="build ${webapp.name}.war" />
 
                <mkdir dir="${siman.dist.dir}" />
                        <fileset dir="${siman.dist.dir}" includes="**/*" />
                </delete>
        </target>
+
+    <!-- ================================================= -->
+    <!--    prepare-postgres: Prepare config for Postgress -->
+    <!-- ================================================= -->
+    <target name="prepare-postgres" description="prepare configuration for Postgress">
+        <echo message="Prepare configuration for Postgress..." />
+        <copy file="${config.src.dir}/debug_pg.properties" tofile="${config.src.dir}/debug.properties" overwrite="true"/>
+        <copy file="${config.src.dir}/release_pg.properties" tofile="${config.src.dir}/release.properties" overwrite="true"/>
+        <antcall target="debug-config"/>
+    </target>
+       
+    <!-- ================================================= -->
+    <!--    prepare-postgres: Prepare config for MySql     -->
+    <!-- ================================================= -->
+    <target name="prepare-mysql" description="prepare configuration for MySql">
+        <echo message="Prepare configuration for MySql..." />
+        <copy file="${config.src.dir}/debug_mysql.properties" tofile="${config.src.dir}/debug.properties" overwrite="true"/>
+        <copy file="${config.src.dir}/release_mysql.properties" tofile="${config.src.dir}/release.properties" overwrite="true"/>
+        <antcall target="debug-config"/>
+    </target>
+
+    <!-- ================================================= -->
+    <!--    prepare-customer: Prepare config for the given customer -->
+    <!-- ================================================= -->
+    <macrodef name="prepare-customer">
+        <!-- Parameter "customer" can be equal to "cea" or "edf" -->
+        <attribute name="customer" />
+        <sequential>
+            <echo message="Prepare config for the customer @{customer}" />
+            <echo message="@{customer}" file="${config.src.dir}/customer.txt"/>
+            <copy file="${config.src.dir}/@{customer}_som.xml" tofile="WebContent/conf/som.xml" overwrite="true"/>
+            <antcall target="debug-config"/>
+        </sequential>
+    </macrodef>
+       
+    <!-- ================================================= -->
+    <!--    prepare-cea: Prepare config for CEA            -->
+    <!-- ================================================= -->
+    <target name="prepare-cea" description="prepare configuration for CEA">
+        <echo message="Prepare configuration for CEA..." />
+        <prepare-customer customer="cea" />
+    </target>
+
+    <!-- ================================================= -->
+    <!--    prepare-cea: Prepare config for EDF            -->
+    <!-- ================================================= -->
+    <target name="prepare-edf" description="prepare configuration for EDF">
+        <echo message="Prepare configuration for EDF..." />
+        <prepare-customer customer="edf" />
+    </target>
 </project>