hackedteam/core-blackberry

View on GitHub
bb-tools/antenna samples/demos/build.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>

<project name="demos" default="build" basedir=".">

    <!-- Define the Wireless Toolkit home directory. Needed by the tasks. -->

    <property name="wtk.home" value="c:\Java\wtk-1.0.4"/>
    <property name="smtk.home" value="c:\Java\smtk"/>

    <!-- Define some additional properties for this project. Not required. -->

    <property name="midlet.name" value="demos"/>
    <property name="midlet.home" value="${wtk.home}/apps/${midlet.name}"/>

    <!-- Define the tasks. -->
    
    <taskdef resource="antenna.properties"/>
          
    <target name="clean">
        <delete failonerror="false" dir="classes"/>
        <delete failonerror="false" dir="tmpclasses"/>
        <delete failonerror="false">
            <fileset dir=".">
                <exclude name="build.xml"/>
            </fileset>
        </delete>
    </target>
    
    <target name="build">

        <!-- Make a JAD file from scratch, don't copy the original one. -->

        <wtkjad jadfile="${midlet.name}.jad"
                name="Sun Samples - Demos"
                vendor="Sun Microsystems"
                version="1.0.3">
                    
            <midlet name="Colors"
                    icon="/icons/ColorChooser.png"
                    class="example.chooser.Color"/>
                    
            <midlet name="Properties"
                    icon="/icons/App.png"
                    class="example.PropExample"/>
                    
            <midlet name="Http"
                    class="example.http.HttpTest"/>
                    
            <midlet name="FontTestlet"
                    icon=""
                    class="example.fonts.FontTestlet"/>
                    
            <midlet name="Stock"
                    icon="/icons/Stock.png"
                    class="example.stock.StockMIDlet"/>
                    
            <midlet name="Tickets"
                    icon="/icons/Auction.png"
                    class="example.auction.TicketAuction"/>
                    
            <midlet name="ManyBalls"
                    icon="/icons/ManyBalls.png"
                    class="example.manyballs.ManyBalls"/>

            <!-- Test for if/unless parameters. Since "oops" is not
                 defined, this MIDlet entry should not make it into the
                 JAD file. -->
                                        
            <midlet name="Oops"
                    icon="/icons/oops.png"
                    class="no.class.for.Oops"
                    if="oops"/>
                         
        </wtkjad>
             
        <mkdir dir="classes"/>

        <!-- Compile everything, but don't preverify (yet). -->

        <wtkbuild srcdir="${midlet.home}/src"
                  destdir="classes"
                  preverify="false"/>

        <!-- Package everything. Most of the necessary information is
             contained in the JAD file. Also preverify the result this
             time. To obfuscate everything, set the corresponding
             parameter to "true" (requires RetroGuard or ProGuard). The
             version parameter increments the MIDlet-Version by one. -->

        <wtkpackage jarfile="${midlet.name}.jar"
                    jadfile="${midlet.name}.jad"
                    obfuscate="false"
                    autoversion="true">

            <!-- Package our newly compiled classes and the
                 resources from the WTK's demo application. -->

            <fileset dir="classes"/>
            <fileset dir="${midlet.home}/res"/>
                            
        </wtkpackage>

        <!-- Obfuscate. -->

        <wtkobfuscate jarfile="${midlet.name}.jar"
                      jadfile="${midlet.name}.jad"/>
        
        <!-- Preverify things, this time separately to test the
             corresponding task. -->

        <wtkpreverify jarfile="${midlet.name}.jar"
                      jadfile="${midlet.name}.jad"/>
            
        <!-- Convert the JAR file into a MIDP for PalmOS PRC file. -->

        <wtkmakeprc jadfile="${midlet.name}.jad"
                    prcfile="${midlet.name}.prc"/>

        <!-- Start the MIDlet suite -->
                        
        <wtkrun jadfile="${midlet.name}.jad" device="DefaultColorPhone" wait="true"/>

    </target>

</project>