samples/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 18:51:38 +0200
changeset 263 7e8e995065c5
parent 262 e59755da1aa6
child 270 c020523e86e1
permissions -rw-r--r--
Tests of all modules are executed and can fail the build
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="samples" default="test" basedir=".">
     3     <property name="samples.dir" location="${ant.file.samples}/.."/>
     4     <dirset id="examples" dir="${samples.dir}">
     5         <include name="**/nbproject"/>
     6         <exclude name="nbproject"/>
     7         <exclude name="apifest1/day3-intermezzo/**"/>
     8         <exclude name="apifest1/infrastructure/testing-template/**"/>
     9     </dirset>
    10     
    11     
    12     <target name="clean">
    13         <delete dir="${samples.dir}/build"/>
    14         <subant target="clean" antfile="../build.xml">
    15             <dirset refid="examples"/>
    16         </subant>
    17     </target>
    18 
    19     <target name="build">
    20         <ant dir="${samples.dir}/libs"/>
    21         <subant target="compile" antfile="../build.xml">
    22             <dirset refid="examples"/>
    23         </subant>
    24     </target>
    25 
    26     <target name="test" depends="build">
    27         <subant target="test" antfile="../build.xml" failonerror="true">
    28             <dirset refid="examples"/>
    29             <property name="test-sys-prop.no.failures" value="true"/>
    30         </subant>
    31     </target>
    32     
    33     <target name="-version" unless="version">
    34         <exec dir="${samples.dir}" outputproperty="version" executable="/bin/sh">
    35             <arg file="${samples.dir}/version.sh"/>
    36         </exec>
    37     </target>
    38 
    39     <target name="sources" depends="-version,clean">
    40         <fail unless="version"/>
    41         
    42         <loadfile srcfile="${samples.dir}/../.hgignore" property="hgignore"/>
    43         <mkdir dir="${samples.dir}/build"/>
    44         <zip basedir="${samples.dir}" destfile="${samples.dir}/build/apidesign-${version}.zip">
    45             <not>
    46                 <containsregexp expression="${hgignore}"/>
    47             </not>
    48             <not>
    49                 <filename name="version.sh"/>
    50             </not>
    51         </zip>
    52     </target>
    53 </project>