<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>
<!-- ================================================= -->
<target name="prepare-postgres" description="prepare configuration for Postgress">
<echo message="Prepare configuration for Postgress..." />
- <copy file="conf/debug_pg.properties" tofile="conf/debug.properties" overwrite="true"/>
- <copy file="conf/release_pg.properties" tofile="conf/release.properties" overwrite="true"/>
+ <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>
<!-- ================================================= -->
<target name="prepare-mysql" description="prepare configuration for MySql">
<echo message="Prepare configuration for MySql..." />
- <copy file="conf/debug_mysql.properties" tofile="conf/debug.properties" overwrite="true"/>
- <copy file="conf/release_mysql.properties" tofile="conf/release.properties" overwrite="true"/>
+ <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>