author | Jaroslav Tulach <jtulach@netbeans.org> |
Thu, 16 May 2013 08:18:24 +0200 | |
changeset 406 | b5f24c7c2a8e |
parent 322 | c12a563d36a4 |
permissions | -rw-r--r-- |
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@322 | 12 |
<target name="clean" description="Cleans all build products"> |
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@322 | 19 |
<target name="build" description="Compiles all samples" > |
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@322 | 26 |
<target name="test" depends="build" description="Executes tests for all samples"> |
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@322 | 39 |
<target name="sources" depends="-version,clean" description="Creates source distribution of the samples"> |
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@328 | 54 |
<target name="snippets" description="Extracts code snippets"> |
jtulach@270 | 55 |
<property name="snippets.dir" location="build/snippets"/> |
jtulach@328 | 56 |
<ant dir="../java/ant" target="snippets"> |
jtulach@328 | 57 |
<property name="snippets.dir" value="${snippets.dir}"/> |
jtulach@328 | 58 |
<property name="snippets.repo" value="http://source.apidesign.org/hg/apidesign"/> |
jtulach@328 | 59 |
<property name="snippets.path" value="samples/"/> |
jtulach@328 | 60 |
<property name="snippets.code.dir" location="."/> |
jtulach@328 | 61 |
</ant> |
jtulach@270 | 62 |
</target> |
jtulach@119 | 63 |
</project> |