buildframework/helium/builder/java/macros.ant.xml
author Zheng Shen <zheng.shen@nokia.com>
Tue, 20 Jul 2010 15:02:28 +0800
changeset 617 3a747a240983
parent 588 c7c26511138f
child 628 7c4a911dc066
permissions -rw-r--r--
ROM Tools 12.2.0.4 Postlinker 2.2.5 Revert package_definition.xml to changeset 360bd6b35136
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
<?xml version="1.0"?>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
<!-- 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
Name        : build.xml 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Part of     : Helium AntLib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
<project name="build-macros" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:au="org.apache.ant.antunit"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
    xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
    <import file="common.ant.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
    <path id="emma.classpath">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
        <fileset dir="${builder.dir}/antlibs">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
            <include name="**/*.jar" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
    </path>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    32
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
    <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="emma.classpath"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
    <taskdef classpathref="emma.classpath" resource="emma_ant.properties" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    36
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
    <target name="clean">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
        <delete dir="${module.temp.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    41
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
    <target name="resolve">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
        <mkdir dir="${lib.dir}"/> <!-- not usually necessary, ivy creates the directory IF there are dependencies -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
        <ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
        <!-- the call to resolve is not mandatory, retrieve makes an implicit call if we don't -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
        <ivy:resolve file="${ivy.file}" log="download-only"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
        <ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" log="download-only"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    51
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
    <target name="report" depends="resolve" description="--> generates a report of dependencies">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
        <ivy:report todir="${build.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    56
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
    <target name="quality" depends="checkstyle" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    59
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
    <target name="checkstyle" depends="resolve">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
        <mkdir dir="${module.temp.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
        <echo>Running checkstyle on ${ant.project.name}.</echo>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
        <cs:checkstyle config="${builder.dir}/java/config/java_checkstyle_config.xml">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
            <classpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
                <path refid="lib.path.id" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
                <pathelement location="${jar.file}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
                <pathelement location="${module.bin.dir}/${ant.project.name}.jar" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
            </classpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
            <fileset dir="${src.dir}" includes="**/*.java"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
            <formatter type="plain"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
            <formatter type="xml" toFile="${module.temp.dir}/checkstyle_errors.xml"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
        </cs:checkstyle>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    75
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
    <target name="compile" depends="resolve" description="--> compile the project">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
        <mkdir dir="${classes.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
        <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="lib.path.id" debug="true" source="1.6" target="1.6" listfiles="true"> 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
            <compilerarg value="-Xlint:unchecked" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
            <compilerarg value="-Xlint:deprecation" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
            <compilerarg value="-Werror" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
        </javac>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    85
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
    <target name="ivy-new-version"  unless="ivy.new.revision">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
        <!-- default module version prefix value 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
        <property name="module.version.prefix" value="${module.version.target}-dev-b" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
        -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
        <!-- asks to ivy an available version number
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
        <ivy:info file="${ivy.file}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
        <ivy:buildnumber 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
            organisation="${ivy.organisation}" module="${ivy.module}" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
            revision="${module.version.prefix}" defaultBuildNumber="1" revSep=""/> -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    97
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
    <target name="local-version">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
        <!--<tstamp>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
            <format property="now" pattern="yyyyMMddHHmmss"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
        </tstamp>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
        <property name="ivy.new.revision" value="${module.version.target}-local-${now}"/>-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   105
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
    <target name="version" depends="ivy-new-version">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
        <!-- create version file in classpath for later inclusion in jar 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
        <mkdir dir="${classes.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
        <echo message="version=${ivy.new.revision}" file="${classes.dir}/${ant.project.name}.properties" append="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
        <!-- load generated version properties file 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
        <property file="${classes.dir}/${ant.project.name}.properties" />-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   115
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
    <target name="package" depends="local-version,version,compile" description="--> make a jar file for this project">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
        <delete dir="${module.bin.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
        <mkdir dir="${module.bin.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
        <jar destfile="${module.bin.dir}/${ant.project.name}.jar">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
            <fileset dir="${classes.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   121
            <fileset dir="${src.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
                <exclude name="**/distribution.policy.S60" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
                <exclude name="**/*.java" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
            </fileset>                
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
            <manifest>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
                <section name="common">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
                    <attribute name="Implementation-Title" value="${ant.project.name}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
                    <attribute name="Implementation-Vendor" value="Nokia" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
                </section>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
            </manifest>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
        </jar>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   133
        <!--copy file="${module.bin.dir}/${ant.project.name}.jar" todir="${bin.dir}" /-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   134
        <!--
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   135
        <mkdir dir="${bin.dir}/com.nokia.helium/${ant.project.name}/${version}" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   136
        <copy file="${bin.dir}/com.nokia.helium/${ant.project.name}/${version}/${ant.project.name}.jar" todir="${module.bin.dir}" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
        [organisation]/[module]/[color]/[revision]/[artifact].[ext] 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
        pubrevision="${version}"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
        pubdate="${now}"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
        -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
        <ivy:publish artifactspattern="${module.bin.dir}/[artifact].[ext]" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
                        resolver="local"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
                        status="integration"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
                        forcedeliver="true"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   146
                        pubrevision="1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   147
                        overwrite="true"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
        />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   149
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   150
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
    <target name="test" depends="junit,antunit"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   153
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   154
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   155
    <target name="junit" depends="resolve">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   156
        <mkdir dir="${build.temp.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   157
        <if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   158
            <available type="dir" file="${basedir}/tests/src"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   159
            <then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   160
                <echo>JUnit test module ${ant.project.name}</echo>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   161
                <delete dir="${module.temp.dir}/junit_classes"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   162
                <delete>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   163
                    <fileset dir="${module.temp.dir}" includes="**/*_junit.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   164
                    <fileset dir="${module.temp.dir}" includes="backup/*.jar" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   165
                </delete>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   166
                <mkdir dir="${module.temp.dir}/junit_classes" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   167
                <javac srcdir="${basedir}/tests/src" destdir="${module.temp.dir}/junit_classes" debug="true"> 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   168
                    <classpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   169
                        <fileset dir="${module.temp.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   170
                            <include name="**/*.jar"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   171
                        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   172
                    </classpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   173
                    <include name="**/*.java" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   174
                </javac>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   175
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   176
                <mkdir dir="${module.temp.dir}/backup" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   177
                <copy file="${jar.file}" todir="${module.temp.dir}/backup/" overwrite="true"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   178
                <emma enabled="true" verbosity="quiet">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   179
                    <instr destdir="${module.temp.dir}/backup/" metadatafile="${module.temp.dir}/metadata_junit.emma" merge="true" mode="overwrite">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   180
                        <instrpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   181
                            <fileset dir="${module.temp.dir}/backup/" includes="${ant.project.name}.jar" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   182
                        </instrpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   183
                    </instr>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   184
                </emma>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   185
                
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   186
                <mkdir dir="${junit.result.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   187
                <delete file="${module.temp.dir}/coverage.emma" failonerror="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   188
                <junit fork="yes" printsummary="yes" haltonfailure="yes">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   189
                    <formatter type="brief" usefile="false"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   190
                    <formatter type="xml" usefile="true"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   191
                    <jvmarg value="-Demma.coverage.out.file=${module.temp.dir}/coverage_junit.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   192
                    <jvmarg value="-Demma.coverage.out.merge=true" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   193
                    <jvmarg value="-Dtestdir=${basedir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   194
                    <classpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   195
                        <fileset dir="${module.temp.dir}/backup/">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   196
                            <include name="**/*.jar"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   197
                        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   198
                        <fileset dir="${lib.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   199
                            <include name="**/*.jar"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   200
                        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   201
                        <fileset dir="${builder.dir}/antlibs">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   202
                            <include name="**/*.jar"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   203
                        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   204
                        <pathelement path="${module.temp.dir}/junit_classes" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   205
                        <fileset dir="${ant.home}/lib">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   206
                            <include name="**/*.jar"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   207
                        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   208
                    </classpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   209
                    <batchtest fork="yes" todir="${junit.result.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   210
                        <fileset dir="${basedir}/tests/src">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   211
                            <include name="**/*Test*.java"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   212
                        </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   213
                    </batchtest>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   214
                </junit>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   215
                <delete dir="${module.temp.dir}/backup/" failonerror="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   216
                
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   217
                <emma enabled="true" verbosity="quiet">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   218
                    <report sourcepath="${src.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   219
                        <infileset dir="${module.temp.dir}" includes="*_junit.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   220
                        <txt outfile="${module.temp.dir}/coverage.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   221
                        <html outfile="${module.temp.dir}/coverage.html" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   222
                        <xml outfile="${module.temp.dir}/coverage.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   223
                    </report>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   224
                </emma>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   225
                <if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   226
                    <available file="${module.temp.dir}/coverage.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   227
                    <then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   228
                        <loadfile property="message" srcFile="${module.temp.dir}/coverage.txt"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   229
                        <echo message="${message}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   230
                    </then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   231
                </if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   232
            </then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   233
        </if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   234
        <if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   235
            <resourcecount count="0" when="gt">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   236
                <fileset dir="${components.temp.dir}/" includes="*/*.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   237
            </resourcecount>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   238
            <then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   239
                <emma enabled="true" verbosity="quiet">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   240
                    <report sourcepath="${src.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   241
                        <infileset dir="${components.temp.dir}/" includes="*/*.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   242
                        <txt outfile="${build.temp.dir}/coverage.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   243
                        <html outfile="${build.temp.dir}/coverage.html" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   244
                        <xml outfile="${build.temp.dir}/coverage.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   245
                    </report>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   246
                </emma>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   247
            </then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   248
        </if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   249
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   250
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   251
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   252
    <target name="antunit">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   253
        <mkdir dir="${build.temp.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   254
        <if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   255
            <available type="dir" file="${basedir}/tests"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   256
            <then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   257
                <trycatch property="antunitModule.error">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   258
                    <try>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   259
                        <!-- Temporarly replacing the jar file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   260
                             with an instrumented one to do the 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   261
                             actual coverage measurment
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   262
                         -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   263
                        <mkdir dir="${module.temp.dir}/backup" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   264
                        <delete>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   265
                            <fileset dir="${module.temp.dir}" includes="**/*_antunit.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   266
                        </delete>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   267
                        <copy file="${jar.file}" todir="${module.temp.dir}/backup/" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   268
                        <emma enabled="true" verbosity="quiet">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   269
                            <instr destdir="${module.temp.dir}/backup/" metadatafile="${module.temp.dir}/metadata_antunit.emma" merge="true" mode="overwrite">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   270
                                <instrpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   271
                                    <fileset dir="${module.temp.dir}/backup/" includes="${ant.project.name}.jar" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   272
                                </instrpath>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   273
                            </instr>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   274
                        </emma>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   275
                        <pathconvert pathsep="${path.separator}" property="python.path">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   276
                            <fileset dir="${lib.dir}" includes="**/*.egg"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   277
                            <dirset dir="${lib.dir}"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   278
                        </pathconvert>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   279
                        <exec osfamily="windows" executable="cmd" dir="${basedir}/tests" failonerror="true">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   280
                            <env key="ANT_ARGS" value="-lib ${lib.dir} -lib ${module.temp.dir}/backup/${ant.project.name}.jar -lib ${builder.dir}/antlibs -Dpython.path=${python.path}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   281
                            <env key="PYTHONPATH" value="${python.path}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   282
                            <env key="JYTHONPATH" value="${python.path}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   283
                            <arg line="/c build.bat unittest " />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   284
                            <arg value="-Dbuilder.dir=${builder.dir}" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   285
                        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   286
                        <exec osfamily="unix" executable="./bld.sh" dir="${basedir}/tests" failonerror="true">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   287
                            <env key="ANT_ARGS" value="-lib ${lib.dir} -lib ${module.temp.dir}/backup/${ant.project.name}.jar -lib ${builder.dir}/antlibs -Dpython.path=${python.path}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   288
                            <env key="PYTHONPATH" value="${python.path}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   289
                            <env key="JYTHONPATH" value="${python.path}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   290
                            <arg line="unittest" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   291
                            <arg value="-Dbuilder.dir=${builder.dir}" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   292
                        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   293
                        <move todir="${module.temp.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   294
                            <fileset dir="${basedir}/tests" includes="**/coverage.ec" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   295
                            <chainedmapper>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   296
                                <filtermapper>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   297
                                    <replacestring from="/" to="_" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   298
                                    <replacestring from="\" to="_" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   299
                                </filtermapper>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   300
                                <regexpmapper from="^(.*)\.ec$$" to="\1_antunit.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   301
                            </chainedmapper>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   302
                        </move>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   303
                        <emma enabled="true" verbosity="quiet">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   304
                            <report sourcepath="${src.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   305
                                <infileset dir="${module.temp.dir}/" includes="*_antunit.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   306
                                <txt outfile="${module.temp.dir}/coverage_antunit.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   307
                                <html outfile="${module.temp.dir}/coverage_antunit.html" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   308
                                <xml outfile="${module.temp.dir}/coverage_antunit.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   309
                            </report>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   310
                        </emma>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   311
                        <if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   312
                            <available file="${module.temp.dir}/coverage_antunit.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   313
                            <then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   314
                                <loadfile property="message" srcFile="${module.temp.dir}/coverage_antunit.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   315
                                <echo message="${message}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   316
                            </then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   317
                        </if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   318
                    </try>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   319
                    <catch>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   320
                        <fail message="${antunitModule.error}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   321
                    </catch>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   322
                    <finally>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   323
                        <delete>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   324
                            <fileset dir="${module.temp.dir}" includes="backup/*.jar" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   325
                        </delete>                                
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   326
                    </finally>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   327
                </trycatch>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   328
            </then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   329
        </if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   330
        <if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   331
            <resourcecount count="0" when="gt">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   332
                <fileset dir="${build.temp.dir}/" includes="*/*.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   333
            </resourcecount>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   334
            <then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   335
                <emma enabled="true" verbosity="quiet">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   336
                    <report sourcepath="${src.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   337
                        <infileset dir="${components.temp.dir}/" includes="*/*.emma" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   338
                        <txt outfile="${build.temp.dir}/coverage.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   339
                        <html outfile="${build.temp.dir}/coverage.html" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   340
                        <xml outfile="${build.temp.dir}/coverage.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   341
                    </report>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   342
                </emma>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   343
            </then>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   344
        </if>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   345
    </target>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   346
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   347
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   348
    <target name="unittest" depends="antunit"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   349
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   350
</project>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   351
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   352