sf-tools/build.xml
author Simon Howkins <simonh@symbian.org>
Wed, 20 Oct 2010 15:19:52 +0100
changeset 1313 116cb28ed586
parent 1299 da1ff046acdc
permissions -rw-r--r--
Removed the tools copy of create-canonical-sysdef-file, as it can use the common version. Removed test for Helium 7 as it's now standard.

<?xml version="1.0" encoding="UTF-8"?>
<project name="SF-TOOLS-CONFIG" xmlns:hlm="http://www.nokia.com/helium">
  <!-- location of this config -->
  <dirname property="sf.tools.config.dir" file="${ant.file.SF-TOOLS-CONFIG}"/>

  <!-- import package properties -->
  <import file="${sf.tools.config.dir}/tools_props.ant.xml" optional="true"/>
  
  <!-- use sf-tools -->
  <property name="qt.qmake.ant.template" value="${sf.tools.config.dir}/run-qmake.ant.xml.ftl"/> <!-- override helium default to use our own template -->

  <!-- import common properties/targets/references -->
  <import file="../common/build.xml" />
  
  <!-- import package references -->
  <import file="${sf.tools.config.dir}/tools_refs.ant.xml"  optional="true"/>
  
  <target name="sf-build-noprep" depends="sf-platform-bootstrap-gt,sf-compile,sf-postbuild">
    <echo>[SF-BUILD-NOPREP] INFO:(tools)</echo>
    <echo>[SF-BUILD-NOPREP] WARNING: Not generating model from packages</echo>
  </target>
    
    <target name="sf-platform-bootstrap-gt" >
    <echo>INFO: Bootstrap files required by SBSv2</echo>
    <!-- do initial stuff to get raptor working -->
    <copy todir="${build.drive}/epoc32/include/variant/" failonerror="true" verbose="true">
        <fileset dir="${build.drive}/${sf.spec.bldmefirst.gt.hrh}" includes="*.hrh"/>
    </copy>
    <copy file="${build.drive}/${sf.spec.bldmefirst.gt.variant}" tofile="${build.drive}/epoc32/tools/variant/variant.cfg" failonerror="true" verbose="true" overwrite="true" preservelastmodified="true" />
    <if><isset property="sf.spec.bldmefirst.gt.hrh.os"/>
    <then>
      <copy file="${build.drive}/${sf.spec.bldmefirst.gt.hrh.os}" tofile="${build.drive}/epoc32/include/variant/Symbian_OS.hrh" failonerror="false" overwrite="true" verbose="true" preservelastmodified="true" />
    </then>
    </if>
    
    <echo>INFO: Explicit export of files needed for tools build</echo>
    <exec executable="cmd" dir="${build.drive}" failonerror="false" output="${build.log.dir}/${build.id}_bootstrap_export.log">
        <arg value="/c sbs.bat EXPORT --export-only -b /sf/os/kernelhwsrv/kernel/eka/bld.inf -b /sf/os/kernelhwsrv/userlibandfileserver/fileserver/group/bld.inf -k -c tools2"/>
    </exec>

    <echo message="INFO Getting bootstrap environment listing"/>
    <antcall target="sf-list-dir" inheritAll="false">
      <param name="sf.dir.location" value="epoc32"/> 
      <param name="sf.dir.exclude"  value="epoc32/build"/>     
      <param name="sf.list.name" value="bootstrap"/>
    </antcall>    
  </target>
  
  
  
  
 <target name="sf-compile" depends="sf-platform-bootstrap-gt">

   <!-- turn comma separated list into sbs friendly -c list, and _ separated list for friendly log names -->
   <propertyregex property="i.sf.spec.sbs.config.expanded"         override="true" input="${sf.spec.sbs.config}" regexp="(,)" replace=" -c " defaultValue="${sf.spec.sbs.config}" global="true"  casesensitive="false"/>
   <propertyregex property="i.sf.spec.sbs.config.expanded.logname" override="true" input="${sf.spec.sbs.config}" regexp="(,)" replace="_"    defaultValue="${sf.spec.sbs.config}" global="true"  casesensitive="false"/>
   <echo message="INFO Target : ${i.sf.spec.sbs.config.expanded}"/>
   <echo message="INFO Logname: ${i.sf.spec.sbs.config.expanded.logname} + Config: ${sf.spec.sysdef.configurations.list}"/>

   <!-- define sbs args, log name etc -->
   <hlm:sbsinput id="sf.build">
        <sbsOptions>
            <arg line="-c ${i.sf.spec.sbs.config.expanded}"/>
            <arg line="-k" />
            <arg line="-t ${sf.spec.sbs.retry.limit}"/>
            <arg line="${sf.spec.sbs.options}"/>
            <arg name="--filters" value="&quot;${sf.spec.sbs.filter.list}&quot;"/>
            <arg name="--logfile" value="${compile.log.dir}/${build.id}_${i.sf.spec.sbs.config.expanded.logname}_compile.log" />
            <arg name="--makefile" value="${compile.log.dir}/${build.id}_${i.sf.spec.sbs.config.expanded.logname}_Makefile" />
        </sbsOptions>
   </hlm:sbsinput>
    
    <!-- call helium's compile-main target using the sbsInput args defined above -->
    <echo message="INFO Building target(s): ${i.sf.spec.sbs.config.expanded}"/>
    <antcall target="compile-main" inheritAll="false" inheritRefs="true">
      <param name="build.system"               value="${sf.spec.build.system}" />
      <param name="sysdef.configurations.list" value="${sf.spec.sysdef.configurations.list}" />
      <param name="sbs.inputs.list"            value="sf.build"/>
      <reference refid="sf.spec.tools.system.definition.files" torefid="system.definition.files" />
    </antcall> 

 </target>

 <target name="sf-create-manifest">

 <!-- turn comma separated list into sbs friendly -c list, and _ separated list for friendly log names -->
   <propertyregex property="i.sf.spec.sbs.config.expanded"         override="true" input="${sf.spec.sbs.config}" regexp="(,)" replace=" -c " defaultValue="${sf.spec.sbs.config}" global="true"  casesensitive="false"/>
   <propertyregex property="i.sf.spec.sbs.config.expanded.logname" override="true" input="${sf.spec.sbs.config}" regexp="(,)" replace="_"    defaultValue="${sf.spec.sbs.config}" global="true"  casesensitive="false"/>
   
   <echo message="INFO Creating WHAT output for target : ${i.sf.spec.sbs.config.expanded}"/>
   <echo message="INFO Logname: ${i.sf.spec.sbs.config.expanded.logname} + Config: ${sf.spec.sysdef.configurations.list}"/>
   
   <!-- define sbs args, log name etc -->
   <exec executable="cmd" dir="${build.drive}" failonerror="false" output="${build.drive}/manifest_binaries_${sf.spec.job.name}.txt">
            <arg line="/c sbs.bat"/>
            <arg line="-c ${i.sf.spec.sbs.config.expanded}"/>
            <arg line="-s ${build.drive}\output\build\canonical_system_definition.xml"/>
            <arg line="${sf.spec.sbs.options}"/>
            <arg line="-k"/>
            <arg line="--what"/>
            <!-- output only what is found on disk -->
            <arg line=" | perl -pe &quot;while ($line=&lt;STDIN&gt;) { my $orig =$line; chomp $line; print $orig if (-e &quot;$line&quot;); };&quot;"/>
            <arg line=" | perl -pe &quot;s/^${build.drive}\\//; s/\\/\//g; &quot;"/> <!-- remove drive and backslash to fwdslash-->
            <arg line=" | findstr /B /V tools"/> <!-- ignore raptor exports into root of drive-->
   </exec>

   </target>
 
 <target name="sf-package-binary" depends="sf-create-manifest">

    <exec executable="7z" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_${sf.spec.job.name}.log">
        <arg value="a"/>
        <arg value="-t${sf.spec.package.zip.format}"/>
        <arg value="-i@${build.drive}/manifest_binaries_${sf.spec.job.name}.txt"/>
        <arg value="${build.drive}/output/zips/release/binaries_${sf.spec.job.name}.zip"/>
        <arg value="manifest_binaries_${sf.spec.job.name}.txt"/>
    </exec>

    <antcall target="sf-zip-content">
        <param name="zip.config.file" value="${temp.build.dir}/zip.cfg.xml.ftl"/>
        <param name="zip.target.name" value="bin-${sf.spec.job.name}-metadata" />
    </antcall>
 </target>
 
 <!-- do nothing for this in a tools build -->
 <target name="sf-copy-rom-logs"/>
    
</project>