configtool/build.xml
author terytkon
Wed, 02 Jun 2010 10:50:41 +0300
changeset 1 fe41c66bacc7
parent 0 30eb2d538f02
permissions -rw-r--r--
Changed rest of the sfl licences to epl :)

<!--****************************************************************************
 * Configuration tool main build file
 * This ant build.xml will compile all Configuration tool plugins
 ****************************************************************************-->
 
<project name="ConfigurationTool" default="build">
  <import file="generatedoc-build.xml"/>

	<!-- import common properties for this plugin -->
	<property file="common.properties"/>
	<property file="install.properties"/>
	<property file="version.properties"/>
	<property file="test.properties"/>
  
  <!-- Gets the svnversion with the svnversion command and stores the output to svnrevision. 
       The target is executed only if the svnrevision has not been set. 
       -->
  <target name="get-svnversion" unless="svnrevision">
  	<echo message="build.xml get-svnversion" level="debug"/>
    <exec dir="." executable="svnversion" outputproperty="svnrevision" />
    <echo message="svnrevision ${svnrevision}" level="debug"/>
  </target>

  <!-- generate a build property file -->
  <target name="update-properties" depends="get-svnversion">
    <echo message="build.xml update-properties" level="debug"/>
    <tstamp prefix="build"/>
    <echo file="${common.buildproperties}">
    common.builddate      =${build.DSTAMP}
    common.svnversion     =${svnrevision}
    common.releaseversion =${releaseversion}
    </echo> <!-- common.releaseversion =${version} -->
    <!-- replace the possible : characters because the do not work in filenames-->
    <replace file="${common.buildproperties}" token=":"/>
    <echo message="wrote ${common.buildproperties}." />
    <property file="${common.buildproperties}"/>
  </target>

	<!-- All target will perform cleanbuild, test, install-->
	<target name="all" depends="clean-install, cleanbuild, install, pack, test">
		<echo message="build.xml all" level="debug"/>
	  <iterate target="all" />
	</target>

	<!-- All target will clean and then commit all the build steps-->
	<target name="cleanbuild" depends="clean, init">
			<echo message="build.xml cleanbuild" level="debug"/>
	    <iterate target="build" />
	</target>

	<!-- Build target will commit all the build steps and can be used for incremental 
	building, because ant recognized changed files -->
  <target name="build" depends="info">
			<echo message="build.xml build" level="debug"/>  
	    <iterate target="build" />
	</target>

  <target name="info" depends="update-properties">
			<echo message="build.xml info" level="debug"/>  
    <echoproperties/>     
  </target>

  <target name="clean">
		<echo message="build.xml clean" level="debug"/>  
    <delete dir="${common.dist}" quiet="true" />
    <delete file="${common.buildproperties}" quiet="true" />
	  <iterate target="clean"/>
  </target>
  
	<target name="init" depends="info">
			<echo message="build.xml init" level="debug"/>	
    <mkdir dir="${common.dist}"/>
    <iterate target="init"/>
	</target>

	<target name="resource">
			<echo message="build.xml resource" level="debug"/>	
	    <iterate target="resource"/>
	</target>

	<target name="compile">
			<echo message="build.xml compile" level="debug"/>	
	    <iterate target="compile"/>
	</target>
	
	<target name="jar">
			<echo message="build.xml jar" level="debug"/>	
	    <iterate target="jar"/>
	</target>
	
	<!-- perform test step of install -->
	<target name="test">
			<echo message="build.xml test" level="debug"/>
	    <iterate target="test"/>
	</target>
	
	<!-- perform test step of install -->
	<target name="perltest">
			<echo message="build.xml perltest" level="debug"/>
	    <subant target="perltest">
	    <filelist 
	    		dir=".">
	    		<file name ="perltests/build.xml"/>
	    </filelist>		
	    </subant>
	</target>
	

  <!-- iterate the target command through the subfolders that have build.xml -->
	<macrodef name="iterate">
	    <attribute name="target"/>
	    <sequential>
	        <subant target="@{target}">
		        <filelist 
						    id="plugins" 
						    dir=".">
						    <file name="com.nokia.tools.s60ct.javaversionchecker/build.xml"/>
		            <file name="com.nokia.S60CT.common/build.xml"/>
		            <file name="com.nokia.S60CT/build.xml"/>
		            <file name="com.nokia.S60CT.generate/build.xml"/>
		            <file name="com.nokia.S60CT.CenRep/build.xml"/>
		            <file name="com.nokia.S60CT.CenRep.edit/build.xml"/>
		            <file name="com.nokia.S60CT.genconfml/build.xml"/>
		            <file name="com.nokia.S60CT.iby/build.xml"/>
		            <file name="com.nokia.S60CT.edit/build.xml"/>
		            <file name="com.nokia.S60CT.CenRep.gui/build.xml"/>
		            <file name="com.nokia.S60CT.CLI/build.xml"/>
		            <file name="com.nokia.S60CT.gui/build.xml"/>
		            <file name="com.nokia.S60CT.validation/build.xml"/>
			    			<file name="com.nokia.S60CT.search/build.xml"/>

		            <!-- tests -->
 		            <file name="tests/build.xml"/>

		            <!-- could not compile ? <file name="com.nokia.S60CT.generate.test/build.xml"/> -->		            
		            <!-- could not compile ? <file name="com.nokia.S60CT.CenRep.tests/build.xml"/> -->
						</filelist>
	        </subant>
	    </sequential>
	</macrodef>	
	
		<macrodef name="unittest">
	    <attribute name="target"/>
	    <sequential>
	        <subant target="@{target}">
		        <filelist id="plugins" dir=".">
		            <file name="com.nokia.tools.s60ct.javaversionchecker/build.xml"/>
		            <file name="com.nokia.S60CT/build.xml"/>
		            <!--<file name="com.nokia.S60CT.generate/build.xml"/>-->
		            <file name="com.nokia.S60CT.CenRep/build.xml"/>
		            <!--<file name="com.nokia.S60CT.iby/build.xml"/>-->
		            <file name="com.nokia.S60CT.edit/build.xml"/>
		            <file name="com.nokia.S60CT.CLI/build.xml"/>
		            <file name="com.nokia.S60CT.gui/build.xml"/>
		            <file name="com.nokia.S60CT.validation/build.xml"/>
		            
 		            <!--<file name="tests/build.xml"/>-->
						</filelist>
	        </subant>
	    </sequential>
	</macrodef>	
	
	  	
	<!-- perform install, wchich means copying created files to -->
	<target name="install" depends="">
		<echo message="build.xml install" level="debug"/>	
	  <mkdir dir="${install.dir}/${install.pluginsdir}"/>
	  <!-- First copy all preinstall data and binaries -->
	  <copy todir="${install.dir}">
  	  <fileset id="install.preinstallfiles" dir="${install.src.preinstall}" includes="**/*"/>
	  </copy>  	
	  <!-- Second copy all lib and built java archives -->
	  <copy todir="${install.dir}/${install.pluginsdir}">  	
  	  <fileset id="install.ownpluginfiles" dir="${common.dist}" includes="${install.src.ownplugins}"/>
  	  <fileset id="install.libpluginfiles" dir="${common.lib}" includes="${install.src.libplugins}"/>
	  </copy>	  
	</target>
	
  <!-- perform clean step of install -->
	<target name="clean-install" depends="">
			<echo message="build.xml clean-install" level="debug"/>	
	  <delete dir="${install.dir}"/>
	</target>
	   
	<!-- perform package step of install -->
	<target name="pack">
		<echo message="build.xml pack" level="debug"/>	
	  <zip destfile="${install.zip.outfile}_${releaseversion}-${common.builddate}-${common.svnversion}.zip" basedir="${install.dir}"/>
	</target>
  	
</project>