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