buildframework/helium/builder/python/macros.ant.xml
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
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" encoding="UTF-8"?>
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="helium-python-builder" xmlns:ivy="antlib:org.apache.ivy.ant"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
  xmlns:contrib="antlib:net.sf.antcontrib">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
  
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
    <property name="bin.dir" location="${builder.dir}/../build/${ant.project.name}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
    <import file="../java/common.ant.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
    <dirname property="python.builder.dir" file="${ant.file.helium-python-builder}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
    <property name="nose.result.dir" location="${module.temp.dir}/xunit/nose" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
    <target name="resolve">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    32
        <mkdir dir="${lib.dir}" />
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    33
        <mkdir dir="${lib.dir}/zipsafe" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    34
        <mkdir dir="${lib.dir}/zipnotsafe" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    35
        <delete dir="${lib.dir}/zipnotsafe" includes="**/*" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    36
        
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
        <ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
        <!-- 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
    40
        <ivy:resolve file="${ivy.file}" log="download-only"/>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    41
        <ivy:retrieve pattern="${lib.dir}/zipsafe/[artifact].[ext]" type="egg" log="download-only"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    42
        <ivy:retrieve pattern="${lib.dir}/zipsafe/[artifact].[ext]" type="py" log="download-only"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    43
        <ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" type="jar" log="download-only"/>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
    <target name="checkstyle"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
    <target name="junit"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
    <target name="quality"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
    <target name="package" depends="clean,resolve">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
        <mkdir dir="${module.bin.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
        <exec executable="python" failonerror="true" dir="${basedir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
            <env key="PYTHONPATH" path="${python.builder.dir}/lib/setuptools-0.6c11-py2.5.egg" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
            <arg line="setup.py -q bdist_egg -d ${module.bin.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
        <delete dir="${basedir}/build"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
        <delete includeemptydirs="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
            <fileset dir="${basedir}/lib" includes="*.egg-info/"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
        </delete>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
        <move file="${module.bin.dir}/${ant.project.name}-0.1-py2.6.egg" tofile="${module.bin.dir}/${ant.project.name}.egg" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
        <ivy:publish artifactspattern="${module.bin.dir}/[artifact].[ext]" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
                        resolver="local"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
                        status="integration"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
                        forcedeliver="true"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
                        pubrevision="1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
                        overwrite="true"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
        />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
    <target name="test">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
        <condition property="target" value="pt" else="unittest">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
            <isset property="nose.args"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
        </condition>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
        <mkdir dir="${nose.result.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
        <property name="nose.args" value="${basedir}/lib/${ant.project.name}tests ${basedir}/lib/${ant.project.name}cpythontests"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
        <exec osfamily="windows" executable="cmd" dir="${basedir}" failonerror="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
            <env key="ANT_ARGS" value="-lib ${lib.dir} -lib ${builder.dir}\antlibs" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
            <env key="JYTHONPATH" value="${builder.dir}\python\lib\jython-2.5-py2.5.egg" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
            <env key="TEST_DATA" path="${basedir}/tests" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
            <arg value="/C" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
            <arg value="${ant.home}\bin\ant.bat -f tests.ant.xml ${target} &quot;-Dbuilder.dir=${builder.dir}&quot; &quot;-Dnose.args=${nose.args}&quot; &amp;&amp; exit /b %%ERRORLEVEL%%" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
        <exec osfamily="unix" executable="${ant.home}/bin/ant" dir="${basedir}" failonerror="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
            <env key="ANT_ARGS" value="-lib ${lib.dir} -lib ${builder.dir}/antlibs" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
            <env key="JYTHONPATH" value="${builder.dir}/python/lib/jython-2.5-py2.5.egg" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
            <env key="TEST_DATA" path="${basedir}/tests" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
            <arg line="-f tests.ant.xml ${target} -Dbuilder.dir=${builder.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
            <arg value="-Dnose.args=${nose.args}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
    </target>  
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
    <target name="clean">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
</project>