<?xml version="1.0"?>
<!-- 
============================================================================ 
Name        : func_add_test.ant.xml 
Part of     : Helium AntLib

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="test-metadata-regex" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
    <description>Helium Antlib metadata unittests.</description>
    
    <dirname property="project.dir" file="${ant.file.test-metadata-regex}" />

    <path id="lib.path">
        <fileset dir="${project.dir}/../../../bin" includes="*.jar"/>
    </path>
    
    <taskdef resource="com/nokia/helium/metadata/ant/antlib.xml" classpathref="lib.path" uri="http://www.nokia.com/helium" />
    <taskdef name="fmpp" classname="fmpp.tools.AntTask" classpathref="lib.path" onerror="report"/>


    <hlm:metadatafilterset id="all-regex-filterfile">
        <metadatafilterset filterfile="${project.dir}/../data/common.csv" />
    </hlm:metadatafilterset>

    <target name="s60-clean-log">
        <delete file="${project.dir}/../output/log_s60_filterfile.sqlite" failonerror="false"/>
        <echo message="all regular expression validation" />
        <echo message="database:${project.dir}/../output/log_s60_filterfile.sqlite" />
        <hlm:metadatarecord database="${project.dir}/../output/log_s60_filterfile.sqlite">
            <hlm:sbsmetadatainput>
                <fileset dir="${project.dir}/../data/">
                    <include  name="S60*.log"/>
                </fileset>
                <metadatafilterset refid="all-regex-filterfile" />
            </hlm:sbsmetadatainput>
        </hlm:metadatarecord>
    </target>


    <hlm:metadatafilterset id="text_log_metadata_input">
        <metadatafilterset filterfile="${project.dir}/../data/common.csv" />
    </hlm:metadatafilterset>


    <target name="log_metadata_input">
        <delete file="${project.dir}/../output/log_text_metadata_input.sqlite" failonerror="false" />
        <echo message="text log metadata input validation" />
        <echo message="database:${project.dir}/../output/log_text_metadata_input.sqlite" />
        <hlm:metadatarecord database="${project.dir}/../output/log_text_metadata_input.sqlite">
            <hlm:textmetadatainput>
                <fileset dir="${project.dir}/../data/">
                    <include  name="*_fixslashes*.log"/>
                </fileset>
                <metadatafilterset refid="text_log_metadata_input" />
            </hlm:textmetadatainput>
        </hlm:metadatarecord>
    </target>

    <target name="parallel_record_test">
        <!-- <delete file="${project.dir}/../output/s60_parallel.sqlite" failonerror="false" /> -->
        <!-- 
        <parallel>
            <sequential>
                <echo message="sbs parallel input validation" />
                <echo message="database:${project.dir}/../output/s60_parallel.db" />
                <hlm:metadatarecord database="${project.dir}/../output/s60_parallel.sqlite">
                    <hlm:sbsmetadatainput>
                        <fileset dir="${project.dir}/../data/">
                            <include  name="*s60_1.log"/>
                        </fileset>
                        <metadatafilterset refid="text_log_metadata_input" />
                    </hlm:sbsmetadatainput>
                </hlm:metadatarecord>
            </sequential>
            <sequential>
                <echo message="sbs parallel input validation" />
                <echo message="database:${project.dir}/../output/s60_parallel.sqlite" />
                <hlm:metadatarecord database="${project.dir}/../output/s60_parallel.sqlite">
                    <hlm:sbsmetadatainput>
                        <fileset dir="${project.dir}/../data/">
                            <include  name="*s60_2.log"/>
                        </fileset>
                        <metadatafilterset refid="text_log_metadata_input" />
                    </hlm:sbsmetadatainput>
                </hlm:metadatarecord>
            </sequential>
            <sequential>
                <echo message="sbs parallel input validation" />
                <echo message="database:${project.dir}/../output/s60_parallel.sqlite" />
                <hlm:metadatarecord database="${project.dir}/../output/s60_parallel.sqlite">
                    <hlm:sbsmetadatainput>
                        <fileset dir="${project.dir}/../data/">
                            <include  name="*s60_3.log"/>
                        </fileset>
                        <metadatafilterset refid="text_log_metadata_input" />
                    </hlm:sbsmetadatainput>
                </hlm:metadatarecord>
            </sequential>
        </parallel> -->
        <fmpp sourceFile="${project.dir}/../../src/templates/scan2.html.ftl"
                     outputfile="${project.dir}/../output/s60_scan2.html">
            <freemarkerLinks expandProperties="yes">
                macro: ${project.dir}/../../src/templates
            </freemarkerLinks>
            <data expandProperties="yes">
                dbPath: ${project.dir}/../output/s60_parallel.sqlite
                doc: xml(${project.dir}/../data/s60_info.xml)
                ant: antProperties()
            </data>
        </fmpp>
        <hlm:generateBuildStatus dbfile="${project.dir}/../output/s60_parallel.sqlite" output-dir="${env.TEMP}" file="test-scanlog-metadata-1.log"/>
    </target>


    <target name="all_ido_logs">
        <delete file="${project.dir}/../output/all_ido_logs.sqlite" failonerror="false" />
        <echo message="text log metadata input validation" />
        <hlm:metadatarecord database="${project.dir}/../output/all_ido_logs.sqlite">
            <hlm:textmetadatainput>
                <fileset dir="${project.dir}/../data/ido_logs">
                    <include  name="*.log"/>
                    <exclude name="*_ant_*.log"/>
                </fileset>
                <metadatafilterset refid="text_log_metadata_input" />
            </hlm:textmetadatainput>
            <hlm:antmetadatainput>
                <fileset dir="${project.dir}/../data/ido_logs">
                    <include  name="*_ant_*.log"/>
                </fileset>
                <metadatafilterset refid="text_log_metadata_input" />
            </hlm:antmetadatainput>
        </hlm:metadatarecord>
    </target>

    <target name="abld_ido_logs">
        <delete file="${project.dir}/../output/abld_ido_logs.sqlite" failonerror="false" />
        <echo message="text log metadata input validation" />
        <hlm:metadatarecord database="${project.dir}/../output/abld_ido_logs.sqlite">
            <hlm:abldmetadatainput>
                <fileset dir="${project.dir}/../data/ido_abld_logs">
                    <include  name="*_compile*.log"/>
                </fileset>
                <metadatafilterset refid="text_log_metadata_input" />
            </hlm:abldmetadatainput>
        </hlm:metadatarecord>
    </target>

    <target name="ant_ido_logs">
        <delete file="${project.dir}/../output/ant_ido_logs.sqlite" failonerror="false" />
        <echo message="text log metadata input validation" />
        <hlm:metadatarecord database="${project.dir}/../output/ant_ido_logs.sqlite">
            <hlm:antmetadatainput>
                <fileset dir="${project.dir}/../data/ido_logs">
                    <include  name="*_ant_*.log"/>
                </fileset>
                <metadatafilterset refid="text_log_metadata_input" />
            </hlm:antmetadatainput>
        </hlm:metadatarecord>
    </target>

    <target name="readdata">
        <delete file="${project.dir}/../output/readdata.html" failonerror="false" />
        <fmpp sourceFile="${project.dir}/../../src/templates/readdata.xml.ftl"
                     outputfile="${project.dir}/../output/readdata.html">
            <freemarkerLinks expandProperties="yes">
                macro: ${project.dir}/../../src/templates
            </freemarkerLinks>
            <data expandProperties="yes">
                dbPath: ${project.dir}/../output/log_text_metadata_input.sqlite
                ant: antProperties()
            </data>
        </fmpp>
    </target>

    <target name="generate-summary">
        <delete file="${project.dir}/../output/summary.html" failonerror="false" />
        <fmpp sourceFile="${project.dir}/../../src/templates/summary.html.ftl"
                     outputfile="${project.dir}/../output/summary.html">
            <freemarkerLinks expandProperties="yes">
                macro: ${project.dir}/../../src/templates/macro
            </freemarkerLinks>
            <data expandProperties="yes">
                dbPath: ${project.dir}/../output/all_ido_logs.sqlite
                loginfo: xml(${project.dir}/../data/ido_logs/IDO_lcdo_tb92-ci_MCL.92.64_info.log.xml)
                ant: antProperties()
            </data>
        </fmpp>
    </target>

    <target name="generate-cc-summary">
        <property name="build.id" value="100.test" />
        <delete file="${project.dir}/../output/cc-summary.html" failonerror="false" />
        <fmpp sourceFile="${project.dir}/../../src/templates/cc_summary.html.ftl"
                     outputfile="${project.dir}/../output/cc-summary.html">
            <freemarkerLinks expandProperties="yes">
                macro: ${project.dir}/../../src/templates/macro
            </freemarkerLinks>
            <data expandProperties="yes">
                dbPath: ${project.dir}/../output/all_ido_logs.sqlite
                loginfo: xml(${project.dir}/../data/ido_logs/IDO_lcdo_tb92-ci_MCL.92.64_info.log.xml)
                ant: antProperties()
            </data>
        </fmpp>
    </target>
</project>