samples/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sun, 06 Jul 2008 00:24:58 +0200
changeset 270 c020523e86e1
parent 263 7e8e995065c5
child 274 e1a7420cea38
permissions -rw-r--r--
Ability to generate code snippets
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@262
     6
        <exclude name="nbproject"/>
jtulach@119
     7
        <exclude name="apifest1/day3-intermezzo/**"/>
jtulach@120
     8
        <exclude name="apifest1/infrastructure/testing-template/**"/>
jtulach@119
     9
    </dirset>
jtulach@119
    10
    
jtulach@119
    11
    
jtulach@119
    12
    <target name="clean">
jtulach@131
    13
        <delete dir="${samples.dir}/build"/>
jtulach@119
    14
        <subant target="clean" antfile="../build.xml">
jtulach@119
    15
            <dirset refid="examples"/>
jtulach@119
    16
        </subant>
jtulach@119
    17
    </target>
jtulach@119
    18
jtulach@119
    19
    <target name="build">
jtulach@131
    20
        <ant dir="${samples.dir}/libs"/>
jtulach@119
    21
        <subant target="compile" antfile="../build.xml">
jtulach@119
    22
            <dirset refid="examples"/>
jtulach@119
    23
        </subant>
jtulach@119
    24
    </target>
jtulach@126
    25
jtulach@126
    26
    <target name="test" depends="build">
jtulach@263
    27
        <subant target="test" antfile="../build.xml" failonerror="true">
jtulach@126
    28
            <dirset refid="examples"/>
jtulach@263
    29
            <property name="test-sys-prop.no.failures" value="true"/>
jtulach@126
    30
        </subant>
jtulach@126
    31
    </target>
jtulach@119
    32
    
jtulach@126
    33
    <target name="-version" unless="version">
jtulach@131
    34
        <exec dir="${samples.dir}" outputproperty="version" executable="/bin/sh">
jtulach@131
    35
            <arg file="${samples.dir}/version.sh"/>
jtulach@126
    36
        </exec>
jtulach@126
    37
    </target>
jtulach@126
    38
jtulach@258
    39
    <target name="sources" depends="-version,clean">
jtulach@126
    40
        <fail unless="version"/>
jtulach@126
    41
        
jtulach@260
    42
        <loadfile srcfile="${samples.dir}/../.hgignore" property="hgignore"/>
jtulach@131
    43
        <mkdir dir="${samples.dir}/build"/>
jtulach@189
    44
        <zip basedir="${samples.dir}" destfile="${samples.dir}/build/apidesign-${version}.zip">
jtulach@126
    45
            <not>
jtulach@126
    46
                <containsregexp expression="${hgignore}"/>
jtulach@126
    47
            </not>
jtulach@126
    48
            <not>
jtulach@126
    49
                <filename name="version.sh"/>
jtulach@126
    50
            </not>
jtulach@126
    51
        </zip>
jtulach@126
    52
    </target>
jtulach@270
    53
jtulach@270
    54
    <target name="snippets">
jtulach@270
    55
        <property name="snippets.dir" location="build/snippets"/>
jtulach@270
    56
        <ant dir="../java/ant"/>
jtulach@270
    57
        <taskdef name="grepcopy" classname="org.apidesign.infra.ant.GrepCopy" classpath="../java/ant/dist/apidesign-ant-tasks.jar"/>
jtulach@270
    58
        <grepcopy target="${snippets.dir}">
jtulach@270
    59
            <fileset dir=".">
jtulach@270
    60
                <include name="**/*"/>
jtulach@270
    61
                <exclude name="**/build/**/*"/>
jtulach@270
    62
            </fileset>
jtulach@270
    63
        </grepcopy>
jtulach@270
    64
    </target>
jtulach@119
    65
</project>