buildframework/helium/tools/rombuild/imaker.ant.xml
changeset 179 d8ac696cc51f
parent 1 be27ed110b50
child 217 0f5e3a7fb6af
child 593 4367a1b2db65
equal deleted inserted replaced
1:be27ed110b50 179:d8ac696cc51f
    22 -->
    22 -->
    23 <project name="rombuild.imaker" xmlns:hlm="http://www.nokia.com/helium">
    23 <project name="rombuild.imaker" xmlns:hlm="http://www.nokia.com/helium">
    24     <description>
    24     <description>
    25         ROM image creation using iMaker (future implementation).
    25         ROM image creation using iMaker (future implementation).
    26     </description>
    26     </description>
    27 
       
    28     <!-- Defining the default rom image creation templates. -->
       
    29     <property name="imaker.fmpp.makefile" location="${helium.dir}/tools/common/templates/imaker/build_imaker_roms_signing.mk.ftl"/>
       
    30     <property name="imaker.fmpp.ant" location="${helium.dir}/tools/common/templates/imaker/build_imaker_roms.ant.xml.ftl"/>
       
    31     
       
    32     
       
    33     <!-- The iMaker task. -->
       
    34     <macrodef name="imaker" uri="http://www.nokia.com/helium">
       
    35         <element name="config"/>
       
    36         <attribute name="engine" default="ebs"/>
       
    37         <attribute name="name" default=""/>
       
    38         <attribute name="signal" default="true"/>
       
    39         <sequential>
       
    40             <hlm:tempRecordStartMacro name="${build.id}@{name}.roms.log"/>
       
    41             <hlm:imaker2tdd property="internal.imaker.tdd" dir="${build.drive}/">
       
    42                 <config/>
       
    43             </hlm:imaker2tdd>
       
    44             <echo>
       
    45 Generated TDD:
       
    46 ${internal.imaker.tdd}
       
    47             </echo>
       
    48             <mkdir dir="${build.log.dir}"/>
       
    49             <if>
       
    50                 <matches pattern="ec(-helium)?" string="@{engine}"/>
       
    51                 <then>
       
    52                     <fmpp sourceFile="${imaker.fmpp.makefile}"
       
    53                         outputFile="${temp.build.dir}/build_imaker_roms@{name}.mk">
       
    54                         <data expandProperties="yes">
       
    55                             data: ${internal.imaker.tdd}
       
    56                             ant: antProperties()
       
    57                         </data>
       
    58                     </fmpp>
       
    59                     <exec executable="${ec.emake}" dir="${build.drive}/">
       
    60                         <arg value="--emake-build-label=${build.id}@{name}-ROMS"/>
       
    61                         <arg value="--emake-class=${ec.build.class}"/>
       
    62                         <arg value="--emake-annofile=${build.log.dir}\${build.id}@{name}.ROMS.emake.anno.xml"/>
       
    63                         <arg value="--emake-autodepend=1"/>
       
    64                         <arg value="--emake-annodetail=basic,history,file,waiting"/>                            
       
    65                         <arg line="-f ${temp.build.dir}/build_imaker_roms@{name}.mk all"/>
       
    66                     </exec>
       
    67                 </then>
       
    68                 <else>
       
    69                     <fmpp sourceFile="${imaker.fmpp.ant}"
       
    70                         outputFile="${temp.build.dir}/build_imaker_roms@{name}.ant.xml">
       
    71                         <data expandProperties="yes">
       
    72                             data: ${internal.imaker.tdd}
       
    73                             ant: antProperties()
       
    74                         </data>
       
    75                     </fmpp>
       
    76                     <ant antfile="${temp.build.dir}/build_imaker_roms@{name}.ant.xml" target="all" />
       
    77                 </else>
       
    78             </if>
       
    79             
       
    80             <hlm:tempRecordStopMacro name="${build.id}@{name}.roms.log" filterref="filterset.imaker"/>
       
    81             <!-- Todo: metadata: insert assertions for metadata parsing here -->
       
    82             <if>
       
    83                 <istrue value="@{signal}"/>
       
    84                 <then>
       
    85                     <hlm:signalMacro logfile="${build.log.dir}/${build.id}@{name}.roms.log" 
       
    86                         signal.input="rombuildSignalInput" />
       
    87                 </then>
       
    88             </if>
       
    89         </sequential>
       
    90     </macrodef>
       
    91 
       
    92     <!--
       
    93         This task implements the transformation of iMaker introspection into a TDD for FMPP.
       
    94         Syntax will be like:
       
    95         <pre>
       
    96         <hlm:imaker2tdd property="internal.imaker.tdd">
       
    97             <imakerconfigurationset>
       
    98                 <imakerconfiguration>
       
    99                     <makefileset>
       
   100                         <include name="**/PRODUCT/*ui.mk"/>
       
   101                     </makefileset>
       
   102                     <categoryset>
       
   103                         <include name="build"/>
       
   104                         <include name="release"/>
       
   105                         <include name="test"/>
       
   106                     </categoryset>
       
   107                 </imakerconfiguration>
       
   108             </imakerconfigurationset>
       
   109         </hlm:imaker2tdd>                 
       
   110         </pre>
       
   111     -->
       
   112     
       
   113     <scriptdef name="imaker2tdd" language="jython" uri="http://www.nokia.com/helium">
       
   114         <element name="imakerconfigurationset" classname="com.nokia.ant.types.imaker.ConfigurationSet"/>
       
   115         <attribute name="property"/>
       
   116         <attribute name="file"/>
       
   117         <attribute name="dir"/>
       
   118         <![CDATA[
       
   119 import imaker
       
   120 import traceback
       
   121 import ant
       
   122 import logging
       
   123 logging.getLogger('imaker.api').addHandler(ant.AntHandler(self))
       
   124 try:
       
   125     imaker.ant_task_configuration(project, self, elements, attributes)
       
   126 except Exception, e:
       
   127     traceback.print_exc()
       
   128     # Propagate the exception
       
   129     raise e
       
   130 ]]>
       
   131     </scriptdef>
       
   132 
    27 
   133     <!--
    28     <!--
   134        This task merges all files mentioned in the fileset and output them in filename output file. 
    29        This task merges all files mentioned in the fileset and output them in filename output file. 
   135     -->
    30     -->
   136     <scriptdef name="mergeConfigXML" language="beanshell"  uri="http://www.nokia.com/helium">
    31     <scriptdef name="mergeConfigXML" language="beanshell"  uri="http://www.nokia.com/helium">
   188     <!-- Future official target for building roms using iMaker.
    83     <!-- Future official target for building roms using iMaker.
   189          To configure that target you have to define an imakerconfigurationset type identified by
    84          To configure that target you have to define an imakerconfigurationset type identified by
   190          'imaker.rom.config'.
    85          'imaker.rom.config'.
   191     -->
    86     -->
   192     <target name="build-roms" depends="rombuild-imaker-create-buildinfo">
    87     <target name="build-roms" depends="rombuild-imaker-create-buildinfo">
   193         <property name="imaker.engine" value="${build.system}" />
    88         <mkdir dir="${roms.log.dir}"/>
       
    89         <if>
       
    90             <not>
       
    91                 <isset property="imaker.engine" />
       
    92             </not>
       
    93             <then>
       
    94                 <if>
       
    95                     <or>
       
    96                         <equals arg1="${build.system}" arg2="ec-helium" />
       
    97                         <equals arg1="${build.system}" arg2="sbs-ec" />
       
    98                     </or>
       
    99                     <then>
       
   100                         <property name="imaker.engine" value="imaker.engine.ec" />
       
   101                     </then>
       
   102                 </if>
       
   103             </then>
       
   104         </if>
       
   105         <property name="imaker.engine" value="imaker.engine.default" />        
   194         <property name="imaker.rom.name" value=""/>
   106         <property name="imaker.rom.name" value=""/>
   195         <hlm:imaker engine="${imaker.engine}" name="${imaker.rom.name}">
   107         <hlm:imaker epocroot="${build.drive}/" engineRefid="${imaker.engine}"
   196             <config>
   108                         output="${roms.log.dir}/${build.id}${imaker.rom.name}.roms.log" verbose="true">
   197                 <imakerconfigurationset refid="imaker.rom.config"/>
   109             <hlm:imakerconfigurationset refid="imaker.rom.config" />
   198             </config>
       
   199         </hlm:imaker>
   110         </hlm:imaker>
   200         <if>
   111         <if>
   201             <istrue value="${blocks.enabled}" />
   112             <istrue value="${blocks.enabled}" />
   202             <then>
   113             <then>
   203                 <mkdir dir="${blocks.config.dir}" />
   114                 <mkdir dir="${blocks.config.dir}" />
   214                 </exec>
   125                 </exec>
   215             </then>
   126             </then>
   216         </if>
   127         </if>
   217     </target>
   128     </target>
   218     
   129     
       
   130     <!-- iMaker engine configuration -->
       
   131     <hlm:defaultEngine id="imaker.engine.default" threads="${number.of.threads}" />
       
   132 
       
   133     <hlm:emakeEngine id="imaker.engine.ec">
       
   134         <arg value="--emake-annofile=${roms.log.dir}/${build.id}${imaker.rom.name}.anno.xml"/>
       
   135         <arg value="--emake-root=${env.EMAKE_ROOT}${path.separator}${helium.dir}"/>
       
   136         <arg value="--emake-annodetail=basic,history,file,waiting"/>
       
   137         <arg value="--emake-historyfile=${roms.log.dir}/${build.id}${imaker.rom.name}.emake.data" />
       
   138         <arg value="--emake-class=${ec.build.class}" />
       
   139     </hlm:emakeEngine>
       
   140     
   219 </project>
   141 </project>