samples/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:03:12 +0200
changeset 189 3ca9cbfda1a5
parent 154 0fd5e9c500b9
child 258 eb43ed265ff1
permissions -rw-r--r--
Cleaning just the sources, not more, building just samples and not other ant tasks
jtulach@119
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@131
     2
<project name="samples" default="test" basedir=".">
jtulach@131
     3
    <property name="samples.dir" location="${ant.file.samples}/.."/>
jtulach@131
     4
    <dirset id="examples" dir="${samples.dir}">
jtulach@119
     5
        <include name="**/nbproject"/>
jtulach@119
     6
        <exclude name="apifest1/day3-intermezzo/**"/>
jtulach@120
     7
        <exclude name="apifest1/infrastructure/testing-template/**"/>
jtulach@119
     8
    </dirset>
jtulach@119
     9
    
jtulach@119
    10
    
jtulach@119
    11
    <target name="clean">
jtulach@131
    12
        <delete dir="${samples.dir}/build"/>
jtulach@119
    13
        <subant target="clean" antfile="../build.xml">
jtulach@119
    14
            <dirset refid="examples"/>
jtulach@119
    15
        </subant>
jtulach@119
    16
    </target>
jtulach@119
    17
jtulach@119
    18
    <target name="build">
jtulach@131
    19
        <ant dir="${samples.dir}/libs"/>
jtulach@119
    20
        <subant target="compile" antfile="../build.xml">
jtulach@119
    21
            <dirset refid="examples"/>
jtulach@119
    22
        </subant>
jtulach@119
    23
    </target>
jtulach@126
    24
jtulach@126
    25
    <target name="test" depends="build">
jtulach@126
    26
        <subant target="test" antfile="../build.xml" failonerror="false">
jtulach@126
    27
            <dirset refid="examples"/>
jtulach@126
    28
        </subant>
jtulach@126
    29
    </target>
jtulach@119
    30
    
jtulach@126
    31
    <target name="-version" unless="version">
jtulach@131
    32
        <exec dir="${samples.dir}" outputproperty="version" executable="/bin/sh">
jtulach@131
    33
            <arg file="${samples.dir}/version.sh"/>
jtulach@126
    34
        </exec>
jtulach@126
    35
    </target>
jtulach@126
    36
jtulach@189
    37
    <target name="sources" depends="-version,samples.clean">
jtulach@126
    38
        <fail unless="version"/>
jtulach@126
    39
        
jtulach@131
    40
        <loadfile srcfile="${samples.dir}/../../.hgignore" property="hgignore"/>
jtulach@131
    41
        <mkdir dir="${samples.dir}/build"/>
jtulach@189
    42
        <zip basedir="${samples.dir}" destfile="${samples.dir}/build/apidesign-${version}.zip">
jtulach@126
    43
            <not>
jtulach@126
    44
                <containsregexp expression="${hgignore}"/>
jtulach@126
    45
            </not>
jtulach@126
    46
            <not>
jtulach@126
    47
                <filename name="version.sh"/>
jtulach@126
    48
            </not>
jtulach@126
    49
        </zip>
jtulach@126
    50
    </target>
jtulach@119
    51
</project>