buildframework/helium/tools/common/logging.ant.xml
changeset 179 d8ac696cc51f
parent 1 be27ed110b50
equal deleted inserted replaced
1:be27ed110b50 179:d8ac696cc51f
    24     <description>
    24     <description>
    25         Targets related to log parsing, rendaring, upload to diamonds etc.
    25         Targets related to log parsing, rendaring, upload to diamonds etc.
    26     </description>
    26     </description>
    27     <!-- Merges all XML log files ending in ".log2.xml" in the build log directory
    27     <!-- Merges all XML log files ending in ".log2.xml" in the build log directory
    28     into a single summary log file. -->
    28     into a single summary log file. -->
    29     <target name="log-merge" unless="metadata.enable" >
    29     <target name="log-merge"  unless="metadata.enable">
    30         <mkdir dir="${build.log.dir}"/>
    30         <mkdir dir="${build.log.dir}"/>
    31         <dependset>
    31         <dependset>
    32             <srcfileset dir="${build.log.dir}" includes="${build.id}*.log.xml"/>
    32             <srcfileset dir="${build.log.dir}" includes="**/${build.id}*.log.xml"/>
    33             <targetfileset file="${build.summary.file}"/>
    33             <targetfileset file="${build.summary.file}"/>
    34         </dependset>
    34         </dependset>
    35         <if>
    35         <if>
    36             <not>
    36             <not>
    37                 <available file="${build.summary.file}"/>
    37                 <available file="${build.summary.file}"/>
    47                     </insert>
    47                     </insert>
    48                 </xmltask>
    48                 </xmltask>
    49                 <for param="file">
    49                 <for param="file">
    50                     <path>
    50                     <path>
    51                         <fileset dir="${build.log.dir}">
    51                         <fileset dir="${build.log.dir}">
    52                             <include name="${build.id}*.log.xml"/>
    52                             <include name="**/${build.id}*.log.xml"/>
       
    53                         </fileset>
       
    54                         <fileset dir="${temp.build.dir}">
       
    55                             <include name="**/${build.id}*.log.xml"/>
    53                         </fileset>
    56                         </fileset>
    54                     </path>
    57                     </path>
    55                     <sequential>
    58                     <sequential>
    56                         <echo>Inserting @{file} into summary.</echo>
    59                         <echo>Inserting @{file} into summary.</echo>
    57                         <!--<xmltask source="${build.summary.file}"
    60                         <!--<xmltask source="${build.summary.file}"
    74     </target>
    77     </target>
    75     
    78     
    76     
    79     
    77     <!-- Outputs an HTML readable version of the summary log. -->
    80     <!-- Outputs an HTML readable version of the summary log. -->
    78     <target name="render-log-summary">
    81     <target name="render-log-summary">
    79         <fmpp sourceFile="${helium.dir}/tools/common/templates/log/summary_metadata.html.ftl"
    82         <if>
    80                      outputfile="${build.log.dir}/summary/${build.id}_summary.html">
    83             <and>
    81             <freemarkerLinks expandProperties="yes">
    84                 <available file="${build.log.dir}/${build.id}_info.log.xml"/>
    82                 macro: ${helium.dir}/tools/common/templates/macro
    85                 <available file="${metadata.dbfile}"/>
    83             </freemarkerLinks>
    86             </and>
    84             <data expandProperties="yes">
    87             <then>
    85                 dbPath: ${metadata.dbfile}
    88                 <fmpp sourceFile="${helium.dir}/tools/common/templates/log/summary_metadata.html.ftl"
    86                 loginfo: xml(${build.log.dir}/${build.id}_info.log.xml)
    89                              outputfile="${build.log.dir}/${build.id}_summary.html">
    87                 ant: antProperties()
    90                     <freemarkerLinks expandProperties="yes">
    88             </data>
    91                         macro: ${helium.dir}/tools/common/templates/macro
    89         </fmpp>
    92                     </freemarkerLinks>
       
    93                     <data expandProperties="yes">
       
    94                         dbPath: ${metadata.dbfile}
       
    95                         loginfo: xml(${build.log.dir}/${build.id}_info.log.xml)
       
    96                         ant: antProperties()
       
    97                     </data>
       
    98                 </fmpp>
       
    99                 <if>
       
   100                     <not>
       
   101                         <available file="${build.log.dir}/${build.id}_summary.html"/>
       
   102                     </not>
       
   103                     <then>
       
   104                         <echo message="Error: failed to generate Summary file" />
       
   105                     </then>
       
   106                 </if>
       
   107             </then>
       
   108         </if>
    90     </target>
   109     </target>
    91     
   110     
    92     <!-- Prepare email for build summary -->
   111     <!-- Prepare email for build summary -->
    93     <target name="logger-email" depends="log-merge">
   112     <target name="logger-email" depends="log-merge">
    94         <fmpp sourceRoot="${helium.dir}/tools/common/templates/log" includes="email.html.ftl" outputRoot="${build.log.dir}/summary"
   113         <fmpp sourceRoot="${helium.dir}/tools/common/templates/log" includes="email.html.ftl" outputRoot="${build.log.dir}/summary"