samples/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 21:30:10 +0100
changeset 409 40cabcdcd2be
parent 322 c12a563d36a4
permissions -rw-r--r--
Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
     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" description="Cleans all build products">
    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" description="Compiles all samples" >
    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" description="Executes tests for all samples">
    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" description="Creates source distribution of the samples">
    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 
    54     <target name="snippets" description="Extracts code snippets">
    55         <property name="snippets.dir" location="build/snippets"/>
    56         <ant dir="../java/ant" target="snippets">
    57             <property name="snippets.dir" value="${snippets.dir}"/>
    58             <property name="snippets.repo" value="http://source.apidesign.org/hg/apidesign"/>
    59             <property name="snippets.path" value="samples/"/>
    60             <property name="snippets.code.dir" location="."/>
    61         </ant>
    62     </target>
    63 </project>