buildframework/helium/tools/preparation/overlays.ant.xml
author Richard Taylor <richard.i.taylor@nokia.com>
Tue, 23 Feb 2010 11:25:17 +0000
branchwip
changeset 333 0fe3c56ad89c
parent 1 be27ed110b50
permissions -rw-r--r--
release note: prototype System Definition v3 support

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
============================================================================ 
Name        : overlays.ant.xml 
Part of     : Helium 

Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved.
This component and the accompanying materials are made available
under the terms of the License "Eclipse Public License v1.0"
which accompanies this distribution, and is available
at the URL "http://www.eclipse.org/legal/epl-v10.html".

Initial Contributors:
Nokia Corporation - initial contribution.

Contributors:

Description:

============================================================================
-->
<project name="overlays" xmlns:hlm="http://www.nokia.com/helium">
    <description>
    Scans the overlay structure and creates  report.
    </description>
    <!-- Scans the overlay structure used in SAL projects. 
         Creates report page from which build managers can 
         easibly see the files that need to be merged. -->
    <target name="scan-overlays">
        <if>
            <isreference refid="overlay.files" type="fileset"/>
            <then>
                <pathconvert refid="overlay.files" property="overlay.files.path"/>
                <hlm:python>
        
import comments

files = r'${overlay.files.path}'.split(';')

# Create a comment parser that extracts branchInfo XML elements in comments
parser = comments.CommentParser(files, 'branchInfo')
doc = parser.scan()

# Write the XML content to a log file
logfile = open(r'${overlays.log.file}', 'w')
doc.xml(logfile, indent=u"yes")
logfile.close()
        
                </hlm:python>
                <xslt in="${overlays.log.file}" out="${overlays.log.file}.html" style="${helium.dir}/tools/preparation/overlayLog_to_html.xslt"/>
            </then>
            <!-- Need to define an 'id' to match the refid in this file, for schema validation. -->
            <else>
                <!-- An XML element with an 'id' attribute is created to allow successful XML validation.
                This serves no other purpose. -->
                <property id="overlay.files" name="overlay.files.id" value="invalid" />
                <echo>WARNING: 'overlay.files' reference not defined. Overlay scanning will not happen.</echo>
            </else>
        </if>
    </target>
</project>