如何使用原生BB jar为我的BBM应用程序构建Ant

时间:2011-08-22 08:04:35

标签: blackberry ant blackberry-eclipse-plugin

我正在尝试在我的应用程序中使用BBM,我想为它构建ant构建

基本上有一个implementationBBM是一个库项目,我在其中添加了JAR文件,我想从我的主CLDC应用程序ant构建文件中为这个库应用程序构建ant构建,

<?xml version="1.0" encoding="UTF-8"?>



<project name="Building project" default="build" basedir=".">
<property name="jde.home" value="D:\Eclipse3.6\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components" />
<property name="sigtool.jde" value="D:\Eclipse3.6\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components" />
<taskdef resource="bb-ant-defs.xml" classpath="lib/bb-ant-tools.jar" />
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="signingpassword" value="Test123#"/>
<target name="clean">
    <delete>
        <fileset dir="release\5.0" />
    </delete>
</target>

<target name = "build-Interface" depends="clean" >
        <rapc destdir="release\5.0" output="BBMInterface" >
            <jdp  title="BBM Implementation" 
                vendor="MySample App" 
                version="1.0" 
                type="library" 
                systemmodule = "true"
                description="BBMImpl" runonstartup="true" startuptier="6"
            />
            <src>
                <fileset dir="../BBMInterface/src">
                    <include name="**/*.java" />
                </fileset>
            </src>
    </rapc>
</target>




<target name = "build-Impl" depends="build-Interface" >
    <rapc destdir="release\5.0" output="BBMImpl" >
        <jdp  title="BBM Implementation" 
            vendor="MainBBMApp" 
            version="1.0" 
            type="library" 
            systemmodule = "true"
            description="BBMImpl" runonstartup="true" startuptier="6"
        />
        <src>
            <fileset dir=".">
                <include name="lib/net_rim_bb_qm_platform.jar" />

            </fileset>
            <fileset dir="../BBMImpl/src">
                <include name="**/*.java" />
            </fileset>

        </src>

    </rapc>
</target>



<target name = "build" depends="build-Impl">
    <rapc destdir="release\5.0" output="MainBBMApp">
        <jdp  title="MainBBMApp" 
            type="cldc"
            description="MainBBMApp"
            runonstartup="true"
            systemmodule="true"
            StartupTier="7"
            vendor="MainBBMApp"
            version="1.0">
            <entry title="MainBBMApp"
                description="MainBBMApp"
                icon="../../res/images/icon.png"

                />
        </jdp>
        <src>

            <fileset dir="${src.dir}">
                <include name="**/*.java" />
                <include name="**/*.png" />
                <include name="**/*.gif" />
                <include name="**/*.bin" />
            </fileset>
            <fileset dir="res\images">
                <include name="**/*.java" />
                <include name="**/*.png" />
                <include name="**/*.gif" />
                <include name="**/*.bin" />
            </fileset>
        </src>

    </rapc>
</target>

<target name="sign" depends="build">
        <java jar="${sigtool.jde}\bin\SignatureTool.jar" fork="true" dir="release\5.0" failonerror="true">
            <arg line=" -a -c -C  *.cod -p ${signingpassword}" />
        </java>
    </target>

    <target name="ota" depends="sign">
        <jadtool input="release\5.0\MainBBMApp.jad" destdir="release\5.0\ota">
            <fileset dir="release\5.0" includes="*.cod" />
        </jadtool>
    </target>
</project>      

并且在运行ant build时遇到错误

 [rapc] Error!: Error: java compiler failed: javac -source 1.3 -target 1.3 -g -O -d C:\DOCUME~1\rakesh\LOCALS~1\Temp\rapc_4064de32.dir -bootclas ...

以及此处输入链接描述的详细问题

我认为它没有使用或检测到net_rim_bb_qm_platform.jar文件。任何人都可以帮我这个

Buildfile: D:\RakeshBBWorkspace\testmessenger\MainBBMApp\buildtest.xml

清洁:

积接口:

 [rapc] Compiling 1 source files to BBMInterface.cod
 [rapc] Warning!: No definition found for exported static item: .libMain(String[])

积默认地将Impl:

 [rapc] Compiling 1 source files to BBMImpl.cod
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:3: package net.rim.blackberry.api.bbm.platform does not exist
 [rapc] import net.rim.blackberry.api.bbm.platform.BBMPlatformApplication;
 [rapc]                                           ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:4: package net.rim.blackberry.api.bbm.platform does not exist
 [rapc] import net.rim.blackberry.api.bbm.platform.BBMPlatformContext;
 [rapc]                                           ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:5: package net.rim.blackberry.api.bbm.platform does not exist
 [rapc] import net.rim.blackberry.api.bbm.platform.BBMPlatformManager;
 [rapc]                                           ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:7: cannot find symbol
 [rapc] symbol: class BBMBridge
 [rapc] public final class BBMBridgeImpl extends BBMBridge {
 [rapc]                                          ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:18: cannot find symbol
 [rapc] symbol  : class BBMPlatformContext
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]     BBMPlatformContext _context;
 [rapc]     ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:20: cannot find symbol
 [rapc] symbol  : class BBMPlatformApplication
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]     private final BBMPlatformApplication _bbmApp = new BBMPlatformApplication(UUID);
 [rapc]                   ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:11: cannot find symbol
 [rapc] symbol  : variable BBMBridge
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]         if (BBMBridge.getInstance() == null) {
 [rapc]             ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:12: cannot find symbol
 [rapc] symbol  : class BBMBridge
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]             BBMBridge instance = new BBMBridgeImpl();
 [rapc]             ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:13: cannot find symbol
 [rapc] symbol  : variable BBMBridge
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]             BBMBridge.setInstance(instance);
 [rapc]             ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:20: cannot find symbol
 [rapc] symbol  : class BBMPlatformApplication
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]     private final BBMPlatformApplication _bbmApp = new BBMPlatformApplication(UUID);
 [rapc]                                                        ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:24: cannot find symbol
 [rapc] symbol  : variable BBMPlatformManager
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]         _context = BBMPlatformManager.register(_bbmApp);
 [rapc]                    ^
 [rapc] D:\RakeshBBWorkspace\testmessenger\BBMImpl\src\mypackage\BBMBridgeImpl.java:29: cannot find symbol
 [rapc] symbol  : variable BBMPlatformContext
 [rapc] location: class mypackage.BBMBridgeImpl
 [rapc]              if (error == BBMPlatformContext.ACCESS_BLOCKED_BY_USER) {
 [rapc]                           ^
 [rapc] 12 errors
 [rapc] Error!: Error: java compiler failed: javac -source 1.3 -target 1.3 -g -O -d C:\DOCUME~1\rakesh\LOCALS~1\Temp\rapc_4064de32.dir -bootclas ...

此外我尝试像这样添加

<target name = "build-Impl" depends="build-Interface" >
    <rapc destdir="release\5.0" output="BBMImpl" >
        <jdp  title="BBM Implementation" 
            vendor="My Systems" 
            version="1.0" 
            type="library" 
            systemmodule = "true"
            description="BBMImpl" runonstartup="true" startuptier="6"
        />
        <src>

            <fileset dir="../BBMImpl/src">
                <include name="**/*.java" />
            </fileset>

        </src>
         <import location="lib/net_rim_bb_qm_platform.jar" />
    </rapc>
</target>

所以它在MainBBMApp中搜索lib,那么我怎样才能在BBMImpl库项目中进行搜索,

或者我应该为这个创建jar文件的partalone单独创建ant构建,然后我可以在app的主构建文件中使用这个jar文件。

0 个答案:

没有答案