| 1 |
<project default="all" basedir="."> |
| 2 |
|
| 3 |
<property environment="env"/> |
| 4 |
|
| 5 |
<tstamp/> |
| 6 |
|
| 7 |
<property name="sourceDir" value="." /> |
| 8 |
<property name="outputDir" value="." /> |
| 9 |
|
| 10 |
<property name="jambiLib" value="${outputDir}/lib" /> |
| 11 |
|
| 12 |
<condition property="qtjambi.osx"> |
| 13 |
<os family="mac"/> |
| 14 |
</condition> |
| 15 |
|
| 16 |
<target name="help" |
| 17 |
description="Provides detailed help."> |
| 18 |
<echo>Generates an executable .jar file that runs the generator example...</echo> |
| 19 |
</target> |
| 20 |
|
| 21 |
|
| 22 |
<target name="init"> |
| 23 |
<taskdef name="qmake" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.QMakeTask"/> |
| 24 |
<taskdef name="make" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.MakeTask"/> |
| 25 |
<taskdef name="generator" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.GeneratorTask"/> |
| 26 |
<taskdef name="qtjambi-platform-jar" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.PlatformJarTask"/> |
| 27 |
<taskdef name="qtjambi-initialize" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.InitializeTask"/> |
| 28 |
|
| 29 |
<qtjambi-initialize verbose="true" configuration="${qtjambi.config}" /> |
| 30 |
</target> |
| 31 |
|
| 32 |
<target name="compile.native" |
| 33 |
depends="init"> |
| 34 |
|
| 35 |
<generator dir="${outputDir}/autotestlib" |
| 36 |
outputDirectory="${outputDir}" |
| 37 |
typesystem="${sourceDir}/autotestlib/build.txt" |
| 38 |
header="${sourceDir}/autotestlib/global.h"/> |
| 39 |
|
| 40 |
<qmake config="${qtjambi.configuration}" |
| 41 |
dir="${outputDir}/autotestlib" |
| 42 |
pro="${sourceDir}/autotestlib/autotestlib.pro" /> |
| 43 |
|
| 44 |
<make dir="${outputDir}/autotestlib" /> |
| 45 |
</target> |
| 46 |
|
| 47 |
|
| 48 |
<target name="compile.java"> |
| 49 |
<javac destdir="${outputDir}" |
| 50 |
debug="true"> |
| 51 |
<src path="${outputDir}"/> |
| 52 |
<src path="${sourceDir}"/> |
| 53 |
<include name="com/trolltech/autotests/*.java"/> |
| 54 |
<include name="com/trolltech/autotests/generated/*.java"/> |
| 55 |
</javac> |
| 56 |
</target> |
| 57 |
|
| 58 |
<target name="run.osx" if="qtjambi.osx"> |
| 59 |
<delete dir="${outputDir}/junitxml" /> |
| 60 |
<delete dir="${outputDir}/TestResults" /> |
| 61 |
<mkdir dir="${outputDir}/junitxml"/> |
| 62 |
<mkdir dir="${outputDir}/TestResults"/> |
| 63 |
<junit fork="yes" printsummary="true" haltonfailure="no" timeout="20000"> |
| 64 |
<jvmarg value="-XstartOnFirstThread"/> |
| 65 |
<formatter type="xml" /> |
| 66 |
<batchtest fork="yes" todir="${xml}"> |
| 67 |
<fileset includes="com/trolltech/autotests/Test*.java"/> |
| 68 |
</batchtest> |
| 69 |
</junit> |
| 70 |
</target> |
| 71 |
|
| 72 |
<target name="run.other" unless="qtjambi.osx"> |
| 73 |
<delete dir="${outputDir}/junitxml" /> |
| 74 |
<delete dir="${outputDir}/TestResults" /> |
| 75 |
<mkdir dir="${outputDir}/junitxml"/> |
| 76 |
<mkdir dir="${outputDir}/TestResults"/> |
| 77 |
<junit fork="yes" printsummary="true" haltonfailure="no" timeout="20000"> |
| 78 |
<formatter type="xml" /> |
| 79 |
<batchtest fork="yes" todir="${outputDir}/junitxml"> |
| 80 |
<fileset dir="${sourceDir}" includes="com/trolltech/autotests/Test*.java"/> |
| 81 |
</batchtest> |
| 82 |
</junit> |
| 83 |
</target> |
| 84 |
|
| 85 |
<target name="run" depends="init, run.other, run.osx" description="Runs tests and generates report in TestReport subdir"> |
| 86 |
<junitreport todir="${outputDir}/junitxml"> |
| 87 |
<fileset dir="${outputDir}/junitxml"> |
| 88 |
<include name="TEST-*.xml" /> |
| 89 |
</fileset> |
| 90 |
<report format="frames" todir="${outputDir}/TestResults" /> |
| 91 |
</junitreport> |
| 92 |
</target> |
| 93 |
|
| 94 |
<target name="compile" |
| 95 |
depends="compile.native, compile.java"/> |
| 96 |
|
| 97 |
<target name="all" |
| 98 |
depends="init, compile, run" /> |
| 99 |
|
| 100 |
</project> |