buildframework/helium/tools/logging/logging.ant.xml
author timothy.murphy@nokia.com
Fri, 30 Apr 2010 16:55:36 +0100
branchfix
changeset 514 92300322d8f8
parent 217 0f5e3a7fb6af
child 628 7c4a911dc066
permissions -rw-r--r--
Better release notes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     2
<!-- 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     3
============================================================================ 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     4
Name        : logging.ant.xml 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     5
Part of     : Helium 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     6
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     8
All rights reserved.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    13
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    14
Initial Contributors:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    16
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    17
Contributors:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    18
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    19
Description:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    20
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    21
============================================================================
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    22
-->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    23
<!--* @package framework -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    24
<project name="logging" xmlns:hlm="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    25
    <description>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    26
        Targets related to log parsing, rendaring, upload to diamonds etc.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    27
    </description>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    28
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    29
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    30
    <!-- This is where the preparation build logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    31
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    32
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    33
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    34
    <property name="prep.log.dir" location="${build.log.dir}/prep"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    35
    <!-- This is where the compile logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    36
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    37
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    38
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    39
    <property name="compile.log.dir" location="${build.log.dir}/compile"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    40
    <!-- This is where the ats test logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    41
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    42
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    43
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    44
    <property name="test.log.dir" location="${build.log.dir}/test"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    45
    <!-- This is where the archive logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    46
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    47
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    48
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    49
    <property name="archive.log.dir" location="${build.log.dir}/archive"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    50
    <!-- This is where the roms logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    51
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    52
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    53
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    54
    <property name="roms.log.dir" location="${build.log.dir}/roms"/>       
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    55
    <!-- This is where the post build logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    56
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    57
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    58
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    59
    <property name="post.log.dir" location="${build.log.dir}/post"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    60
    <!-- This is where the localisation logs are stored.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    61
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    62
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    63
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    64
    <property name="localisation.log.dir" location="${build.log.dir}/localisation"/>    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    65
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    66
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    67
    <!-- Macro to record content to a separate log file without recording in the main log. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    68
    <macrodef name="recordStartMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    69
        <attribute name="name"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    70
        <attribute name="emacsmode" default="false"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    71
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    72
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    73
                <available file="${build.log.dir}" type="dir"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    74
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    75
                    <hlm:record name="${build.log.dir}/@{name}" action="start" append="true" emacsmode="@{emacsmode}" loglevel="${ant.loglevel}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    76
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    77
            </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    78
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    79
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    80
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    81
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    82
    <!-- Macro to stop recording content to a separate log file without recording in the main log. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    83
    <macrodef name="recordStopMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    84
        <attribute name="name"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    85
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    86
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    87
                <available file="${build.log.dir}/@{name}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    88
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    89
                    <hlm:record name="${build.log.dir}/@{name}" action="stop" append="true"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    90
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    91
            </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    92
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    93
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    94
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    95
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    96
    <!--Macro to stop recording to the main log file (if present) and record to
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    97
        a separate log file that is filtered after logging is stopped. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    98
    <macrodef name="filterRecordStartMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    99
        <attribute name="pattern" default=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   100
        <attribute name="category" default=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   101
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   102
            <hlm:record name="${build.cache.log.dir}/temp_ant_build.log" action="start" loglevel="${ant.loglevel}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   103
                <hlm:recordfilter category="@{category}" regexp="@{pattern}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   104
            </hlm:record>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   105
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   106
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   107
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   108
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   109
    <!--Macro to stop recording the seperate filtered log file, filter the passwords
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   110
    and start recording in main log file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   111
    <macrodef name="filterRecordStopMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   112
        <attribute name="log" default="${build.log}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   113
        <attribute name="append" default="true"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   114
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   115
            <hlm:record name="${build.cache.log.dir}/temp_ant_build.log" action="stop"/>                    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   116
            <concat destfile="@{log}" append="@{append}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   117
                <filelist dir="${build.cache.log.dir}" files="temp_ant_build.log"/>                        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   118
            </concat>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   119
            <delete file="${build.cache.log.dir}/temp_ant_build.log" failonerror="false"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   120
            <echo>End of filtering @{log} for passwords</echo>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   121
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   122
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   123
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   124
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   125
    <!-- Extract logs from text file and process error/warnings/components name etc
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   126
    into xml file.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   127
    @deprecated Please consider using the metadata framework.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   128
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   129
    <scriptdef name="logextract" language="jython"  uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   130
        <attribute name="file" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   131
        <attribute name="outputfile" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   132
        <element name="fileset" type="fileset"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   133
        <element name="logfilterset" classname="com.nokia.ant.types.LogFilterSet"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   134
        <![CDATA[
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   135
import os.path
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   136
import log2xml
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   137
import java.io
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   138
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   139
def convertFile(inputfile, outputfile, config):
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   140
    if (outputfile != None):
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   141
        print "output file not none"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   142
        print "output file: %s" % outputfile
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   143
        targetfile = str(outputfile)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   144
    else:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   145
        #print "output file: %s" % outputfile
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   146
        targetfile = "%s.xml" % inputfile
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   147
        #print "targetFile %s" % targetfile
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   148
    if not os.path.exists(targetfile) or \
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   149
       (os.path.exists(targetfile) and os.path.getmtime(inputfile) > os.path.getmtime(targetfile)):
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   150
        self.getProject().log("Converting %s..." % inputfile)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   151
        log2xml.convert(inputfile, targetfile, False, config)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   152
    else:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   153
        self.getProject().log("Extracted log is uptodate: %s" % inputfile)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   154
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   155
config = log2xml.DEFAULT_CONFIGURATION
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   156
logfilterset = elements.get("logfilterset")
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   157
if logfilterset != None and logfilterset.size() > 0:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   158
    # if any logfilterset are dfined then
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   159
    # it override the default configuration
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   160
    config = {}
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   161
    for filtersetid in range(logfilterset.size()):
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   162
        filterset = logfilterset.get(filtersetid)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   163
        if filterset.isReference():
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   164
            filterset = filterset.getRefid().getReferencedObject(project)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   165
        filters = filterset.getFilters()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   166
        for filterid in range(filters.size()):
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   167
            if not filters.get(filterid).getCategory() in config:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   168
                config[filters.get(filterid).getCategory()] = []
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   169
            config[filters.get(filterid).getCategory()].append(str(filters.get(filterid).getRegex()))
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   170
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   171
fileset = elements.get("fileset")
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   172
outputfile = attributes.get("outputfile")
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   173
if fileset != None and fileset.size() > 0:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   174
    for filesetid in range(fileset.size()):
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   175
        dirscanner = fileset.get(filesetid).getDirectoryScanner(project)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   176
        for filename in dirscanner.getIncludedFiles():
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   177
            inputfile = str(java.io.File(dirscanner.getBasedir(), str(filename)).getAbsolutePath())
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   178
            convertFile(inputfile, outputfile, config)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   179
elif attributes.get("file") != None:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   180
    inputfile = str(java.io.File(str(attributes.get("file"))).getAbsolutePath())
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   181
    convertFile(inputfile, outputfile, config)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   182
else:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   183
    self.log("No input specified.")
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   184
        ]]>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   185
    </scriptdef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   186
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   187
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   188
    <!--Macro to stop recording to the main log file (if present) and record to
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   189
        a separate log file into a temporary location (doesn't need the build aread to work). -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   190
    <macrodef name="tempRecordStartMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   191
        <attribute name="name"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   192
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   193
            <mkdir dir="${build.cache.log.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   194
            <hlm:record name="${build.cache.log.dir}/@{name}" action="start" loglevel="${ant.loglevel}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   195
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   196
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   197
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   198
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   199
    <!--Macro to restart  the main log file (if present) and stop recording to
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   200
        a separate log file into a temporary location the file is next xml summarized 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   201
        and potentially copied to the build area (if exists). Else those files will get copied during the 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   202
        build area preparation. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   203
    <macrodef name="tempRecordStopMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   204
        <attribute name="name"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   205
        <attribute name="phase" default=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   206
        <attribute name="database" default="${metadata.dbfile}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   207
        <attribute name="filterref" default="filterset.temprecord"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   208
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   209
            <mkdir dir="${build.cache.log.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   210
            <mkdir dir="${build.log.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   211
            <mkdir dir="${build.cache.log.dir}/signals"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   212
            <hlm:record name="${build.cache.log.dir}/@{name}" action="stop" loglevel="${ant.loglevel}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   213
            <!--Temporary solution, the logextract in general 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   214
                needs to be handled in a better way (not all logs needs to be processed,
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   215
                logextract / counting errors could be merged and logextract should be
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   216
                executed on a need basis and not to process for all stopmacro.-->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   217
            <!-- Todo: metadata: replace logextract -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   218
            <hlm:metadatarecord database="@{database}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   219
                <hlm:antmetadatainput>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   220
                    <fileset casesensitive="false" file="${build.cache.log.dir}/@{name}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   221
                    <metadatafilterset refid="@{filterref}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   222
                </hlm:antmetadatainput>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   223
            </hlm:metadatarecord>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   224
            <hlm:generateBuildStatus dbfile="@{database}" output-dir="${build.cache.log.dir}/signals" file="@{name}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   225
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   226
                <isset property="@{phase}.log.dir" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   227
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   228
                    <mkdir dir="${@{phase}.log.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   229
                    <copy todir="${@{phase}.log.dir}" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   230
                        <fileset casesensitive="false" file="${build.cache.log.dir}/@{name}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   231
                    </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   232
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   233
                <else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   234
                    <copy todir="${build.log.dir}" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   235
                        <fileset casesensitive="false" file="${build.cache.log.dir}/@{name}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   236
                    </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   237
                </else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   238
            </if>            
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   239
            <copy todir="${build.signal.status.dir}" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   240
                <fileset casesensitive="false" dir="${build.cache.log.dir}/signals" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   241
            </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   242
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   243
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   244
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   245
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   246
    <!-- Macro to start logging to a separate log file.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   247
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   248
    This will stop logging to the main ant_build log file until stopSpecificLogMacro
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   249
    is called. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   250
    <macrodef name="startSpecificLogMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   251
        <attribute name="name"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   252
        <attribute name="regexp" default=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   253
        <attribute name="backup" default="false"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   254
        <attribute name="phase" default=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   255
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   256
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   257
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   258
                <isset property="@{phase}.log.dir" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   259
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   260
                    <mkdir dir="${@{phase}.log.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   261
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   262
            </if> 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   263
            <mkdir dir="@{name}/.."/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   264
            <hlm:record name="@{name}" action="start" loglevel="verbose" backup="@{backup}" backupProperty="backup.file.name">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   265
                <hlm:recordfilter category="@{phase}" regexp="@{regexp}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   266
            </hlm:record>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   267
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   268
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   269
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   270
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   271
    <!--Macro to restart  the main log file (if present) and stop recording to
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   272
        a separate log file. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   273
    <macrodef name="stopSpecificLogMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   274
        <attribute name="name"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   275
        <attribute name="phase" default=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   276
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   277
            <hlm:record name="@{name}" action="stop" loglevel="verbose"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   278
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   279
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   280
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   281
    <!-- Temp BMD macro -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   282
    <macrodef name="bmdLogExtractMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   283
        <attribute name="log"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   284
        <attribute name="metadatafilterset" default="common"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   285
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   286
            <hlm:metadatarecord database="${metadata.dbfile}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   287
                <hlm:textmetadatainput>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   288
                    <fileset casesensitive="false" file="@{log}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   289
                    <metadatafilterset refid="@{metadatafilterset}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   290
                </hlm:textmetadatainput>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   291
            </hlm:metadatarecord>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   292
            <!-- todo: check to add for usage and add genbuildstatus macro -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   293
            <basename property="log.name" file="@{log}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   294
            <fmpp sourceFile="${helium.dir}/tools/common/templates/db2xml.xml.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   295
                         outputfile="@{log}.xml">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   296
                <data expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   297
                    dbPath: ${metadata.dbfile}
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   298
                    log: ${log.name}
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   299
                    ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   300
                </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   301
            </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   302
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   303
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   304
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   305
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   306
    <!-- Merges all XML log files ending in ".log2.xml" in the build log directory
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   307
    into a single summary log file. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   308
    <target name="log-merge"  unless="metadata.enable">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   309
        <mkdir dir="${build.log.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   310
        <dependset>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   311
            <srcfileset dir="${build.log.dir}" includes="**/${build.id}*.log.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   312
            <targetfileset file="${build.summary.file}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   313
        </dependset>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   314
        <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   315
            <not>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   316
                <available file="${build.summary.file}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   317
            </not>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   318
            <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   319
                <echo>Merging all *.log.xml files</echo>        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   320
                <mkdir dir="${build.log.dir}/summary"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   321
                <xmltask  dest="${build.summary.file}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   322
                    <insert path="/"  >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   323
                    <![CDATA[
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   324
                    <logSummary/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   325
                    ]]>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   326
                    </insert>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   327
                </xmltask>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   328
                <for param="file">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   329
                    <path>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   330
                        <fileset dir="${build.log.dir}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   331
                            <include name="**/${build.id}*.log.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   332
                        </fileset>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   333
                        <fileset dir="${temp.build.dir}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   334
                            <include name="**/${build.id}*.log.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   335
                        </fileset>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   336
                    </path>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   337
                    <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   338
                        <echo>Inserting @{file} into summary.</echo>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   339
                        <!--<xmltask source="${build.summary.file}"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   340
                                 dest="${build.summary.file}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   341
                           <insert path="/logSummary" file="@{file}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   342
                        </xmltask>-->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   343
                        <hlm:assertPropertySet property="build.summary.file" message="Property build.summary.file is not defined." />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   344
                        <script language="jython" setbeans="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   345
# Temporary solution
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   346
import log2xml
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   347
log2xml.append_summary(project.getProperty('build.summary.file'), r'@{file}')
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   348
                        </script>                        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   349
                    </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   350
                </for>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   351
            </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   352
            <else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   353
                <echo>Summary XML log file does not need updating.</echo>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   354
            </else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   355
        </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   356
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   357
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   358
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   359
    <!-- Outputs an HTML readable version of the summary log. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   360
    <target name="render-log-summary">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   361
        <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   362
            <and>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   363
                <available file="${build.log.dir}/${build.id}_info.log.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   364
                <available file="${metadata.dbfile}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   365
            </and>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   366
            <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   367
                <fmpp sourceFile="${helium.dir}/tools/common/templates/log/summary_metadata_orm.html.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   368
                             outputfile="${build.log.dir}/${build.id}_summary.html">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   369
                    <freemarkerLinks expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   370
                        macro: ${helium.dir}/tools/common/templates/macro
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   371
                    </freemarkerLinks>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   372
                    <data expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   373
                        dbPath: ${metadata.dbfile}
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   374
                        loginfo: xml(${build.log.dir}/${build.id}_info.log.xml)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   375
                        ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   376
                    </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   377
                </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   378
                <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   379
                    <not>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   380
                        <available file="${build.log.dir}/${build.id}_summary.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   381
                    </not>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   382
                    <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   383
                        <echo message="Error: failed to generate Summary file" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   384
                    </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   385
                </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   386
            </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   387
        </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   388
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   389
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   390
    <!-- Prepare email for build summary -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   391
    <target name="logger-email" depends="log-merge">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   392
        <fmpp sourceRoot="${helium.dir}/tools/common/templates/log" includes="email.html.ftl" outputRoot="${build.log.dir}/summary"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   393
              replaceExtension="html.ftl, html">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   394
            <data expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   395
                doc: xml(${build.summary.file})
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   396
                ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   397
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   398
        </fmpp>        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   399
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   400
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   401
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   402
    <!-- Test target to show how Diamond metadata could be rendered. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   403
    <target name="render-diamonds-data" depends="log-merge">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   404
        <mkdir dir="${build.log.dir}/summary/diamonds"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   405
        <fmpp sourceRoot="${helium.dir}/tools/common/templates/diamonds"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   406
              outputRoot="${build.log.dir}/summary/diamonds" includes="diamonds.xml.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   407
              replaceExtension="xml.ftl, xml">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   408
            <data expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   409
                doc: xml(${build.summary.file})
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   410
                ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   411
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   412
        </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   413
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   414
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   415
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   416
    <!-- Render the CC dashboad summary. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   417
    <target name="render-cc-summary" depends="log-merge">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   418
        <mkdir dir="${build.log.dir}/summary"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   419
        <fmpp sourceFile="${helium.dir}/tools/common/templates/log/cc_summary_metadata_orm.html.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   420
                     outputfile="${build.log.dir}/summary/${build.id}_cc_summary.html">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   421
            <data expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   422
                dbPath: ${metadata.dbfile}
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   423
                ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   424
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   425
        </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   426
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   427
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   428
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   429
    <!-- Creates a full summary log from all the build logs. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   430
    <target name="build-log-summary" depends="render-log-summary"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   431
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   432
    <!-- Test target to check signal. -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   433
    <target name="check-signal" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   434
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   435
    <!-- Starting the main ant_build log -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   436
    <target name="start-ant-log" >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   437
        <hlm:triggerlogger/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   438
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   439
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   440
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   441
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   442
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   443
</project>