|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <!-- |
|
3 ============================================================================ |
|
4 Name : build.xml |
|
5 Part of : Helium AntLib |
|
6 |
|
7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
8 All rights reserved. |
|
9 This component and the accompanying materials are made available |
|
10 under the terms of the License "Eclipse Public License v1.0" |
|
11 which accompanies this distribution, and is available |
|
12 at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
13 |
|
14 Initial Contributors: |
|
15 Nokia Corporation - initial contribution. |
|
16 |
|
17 Contributors: |
|
18 |
|
19 Description: |
|
20 |
|
21 ============================================================================ |
|
22 --> |
|
23 <project name="helium-python-builder" xmlns:ivy="antlib:org.apache.ivy.ant" |
|
24 xmlns:contrib="antlib:net.sf.antcontrib"> |
|
25 |
|
26 <property name="bin.dir" location="${builder.dir}/../build/${ant.project.name}" /> |
|
27 <import file="../java/common.ant.xml" /> |
|
28 <dirname property="python.builder.dir" file="${ant.file.helium-python-builder}" /> |
|
29 <property name="nose.result.dir" location="${module.temp.dir}/xunit/nose" /> |
|
30 |
|
31 <target name="resolve"> |
|
32 <ivy:settings file="${ivy.settings.dir}/ivysettings.xml" /> |
|
33 |
|
34 <!-- the call to resolve is not mandatory, retrieve makes an implicit call if we don't --> |
|
35 <ivy:resolve file="${ivy.file}" log="download-only"/> |
|
36 <ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" log="download-only"/> |
|
37 </target> |
|
38 |
|
39 <target name="checkstyle"/> |
|
40 <target name="junit"/> |
|
41 <target name="quality"/> |
|
42 |
|
43 <target name="package" depends="clean,resolve"> |
|
44 <mkdir dir="${module.bin.dir}" /> |
|
45 <exec executable="python" failonerror="true" dir="${basedir}"> |
|
46 <env key="PYTHONPATH" path="${python.builder.dir}/lib/setuptools-0.6c11-py2.5.egg" /> |
|
47 <arg line="setup.py -q bdist_egg -d ${module.bin.dir}" /> |
|
48 </exec> |
|
49 <delete dir="${basedir}/build"/> |
|
50 <delete includeemptydirs="true"> |
|
51 <fileset dir="${basedir}/lib" includes="*.egg-info/"/> |
|
52 </delete> |
|
53 <move file="${module.bin.dir}/${ant.project.name}-0.1-py2.6.egg" tofile="${module.bin.dir}/${ant.project.name}.egg" /> |
|
54 |
|
55 <ivy:publish artifactspattern="${module.bin.dir}/[artifact].[ext]" |
|
56 resolver="local" |
|
57 status="integration" |
|
58 forcedeliver="true" |
|
59 pubrevision="1.0" |
|
60 overwrite="true" |
|
61 /> |
|
62 </target> |
|
63 |
|
64 <target name="test"> |
|
65 <condition property="target" value="pt" else="unittest"> |
|
66 <isset property="nose.args"/> |
|
67 </condition> |
|
68 <mkdir dir="${nose.result.dir}" /> |
|
69 <property name="nose.args" value="${basedir}/lib/${ant.project.name}tests ${basedir}/lib/${ant.project.name}cpythontests"/> |
|
70 <exec osfamily="windows" executable="cmd" dir="${basedir}" failonerror="true"> |
|
71 <env key="ANT_ARGS" value="-lib ${lib.dir} -lib ${builder.dir}\antlibs" /> |
|
72 <env key="JYTHONPATH" value="${builder.dir}\python\lib\jython-2.5-py2.5.egg" /> |
|
73 <env key="TEST_DATA" path="${basedir}/tests" /> |
|
74 <arg value="/C" /> |
|
75 <arg value="${ant.home}\bin\ant.bat -f tests.ant.xml ${target} "-Dbuilder.dir=${builder.dir}" "-Dnose.args=${nose.args}" && exit /b %%ERRORLEVEL%%" /> |
|
76 </exec> |
|
77 <exec osfamily="unix" executable="${ant.home}/bin/ant" dir="${basedir}" failonerror="true"> |
|
78 <env key="ANT_ARGS" value="-lib ${lib.dir} -lib ${builder.dir}/antlibs" /> |
|
79 <env key="JYTHONPATH" value="${builder.dir}/python/lib/jython-2.5-py2.5.egg" /> |
|
80 <env key="TEST_DATA" path="${basedir}/tests" /> |
|
81 <arg line="-f tests.ant.xml ${target} -Dbuilder.dir=${builder.dir}" /> |
|
82 <arg value="-Dnose.args=${nose.args}" /> |
|
83 </exec> |
|
84 </target> |
|
85 |
|
86 <target name="clean"> |
|
87 </target> |
|
88 |
|
89 </project> |