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
    <target name="help"
13
            description="Provides detailed help.">
14
    <echo>Generates an executable .jar file that runs the generator example...</echo>
15
    </target>
16
17
18
    <target name="init">
19
        <taskdef name="qmake"     classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.QMakeTask"/>
20
        <taskdef name="make"      classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.MakeTask"/>
21
        <taskdef name="generator" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.GeneratorTask"/>
22
        <taskdef name="qtjambi-platform-jar" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.PlatformJarTask"/>
23
        <taskdef name="qtjambi-initialize" classpath="${outputDir}/ant-qtjambi.jar" classname="com.trolltech.tools.ant.InitializeTask"/>
24
25
        <qtjambi-initialize verbose="true" configuration="${qtjambi.config}" />
26
27
        <mkdir dir="${outputDir}/platform-output"/>
28
    </target>
29
30
    <target name="compile"
31
        depends="init">
32
33
        <generator dir="${outputDir}/generator_example"
34
           outputDirectory="${outputDir}"
35
           typesystem="${sourceDir}/generator_example/typesystem_generatorexample.txt"
36
           header="${sourceDir}/generator_example/global.h"/>
37
38
    <qmake config="${qtjambi.configuration}"
39
           dir="${outputDir}/generator_example"
40
           pro="${sourceDir}/generator_example/generator_example.pro" />
41
42
    <make dir="${outputDir}/generator_example" />
43
44
45
    <javac destdir="${outputDir}/platform-output"
46
           debug="true">
47
            <src path="${outputDir}"/>
48
            <src path="${sourceDir}"/>
49
            <include name="com/trolltech/examples/generator/*.java"/>
50
            <include name="com/trolltech/examples/GeneratorExample.java"/>
51
    </javac>
52
    </target>
53
54
    <target name="package"
55
        depends="init"
56
        description="Creating .jar file with native libs...">
57
58
        <qtjambi-platform-jar cacheKey="genex-${qtjambi.compiler}-${DSTAMP}-${TSTAMP}"
59
                              outdir="${outputDir}/platform-output">
60
61
            <!-- Qt Libraries... -->
62
            <library name="QtCore"    type="qt" rootPath="${qtjambi.qtdir}" />
63
            <library name="QtGui"     type="qt" rootPath="${qtjambi.qtdir}" />
64
65
            <!-- Qt Plugins... -->
66
            <library name="qjpeg" type="plugin" rootPath="${qtjambi.qtdir}" subdir="plugins/imageformats" load="never"/>
67
        <plugin path="plugins" />
68
69
            <!-- Qt Jambi Libraries -->
70
            <library name="qtjambi"                  type="qtjambi" rootPath="${outputDir}" />
71
            <library name="com_trolltech_qt_core"    type="qtjambi" rootPath="${outputDir}" />
72
            <library name="com_trolltech_qt_gui"     type="qtjambi" rootPath="${outputDir}" />
73
74
        <!-- The generator examplelibrary -->
75
            <library name="com_trolltech_examples_generator" type="qtjambi" rootPath="${outputDir}" />
76
77
        </qtjambi-platform-jar>
78
79
        <jar destfile="${outputDir}/qtjambi-generator-example-${qtjambi.osname}-${qtjambi.compiler}-${qtjambi.version}.jar">
80
            <fileset dir="${outputDir}/platform-output" />
81
        <fileset dir="${sourceDir}" includes="com/trolltech/examples/generator/images/*"/>
82
            <manifest>
83
                <attribute name="Built-By" value="${user.name} - ${TODAY}"/>
84
                <attribute name="Main-Class" value="com.trolltech.examples.GeneratorExample"/>
85
                <attribute name="Class-Path" value="qtjambi-${qtjambi.version}.jar" />
86
            </manifest>
87
88
        </jar>
89
90
        <delete dir="${outputDir}/platform-output"/>
91
92
    </target>
93
94
    <target name="all"
95
        depends="init, compile, package" />
96
97
</project>