BlackBerry JDE projects Build & Signing automation

Most projects sooner or later require build process automation. And blackberry JDE projects are not exception. But in case of JDE projects we need two things to automate: build and sign.

Build can be automated in many ways but the basis is to use “rapc.exe” command line tool which comes with JDE and can be located in bin folder. But this tool requires to specify full list of files needed to compile the project and it’s not very handy because somehow we need to get this list from *.jdp file.

Eventually there is a tool that already hadle this: RAPC ant task. You can use it as Ant task in your build automation script but also as a standalone commmand line tool.

I use it in standalone mode because automate builds under TFS using MSBuild. Sample:

Run the following command in the directory where HelloWorld.jdw exists:

java -jar anttask-rapc-1.8.jar -javahome="C:/jdk1.4.0"

-jdehome="C:/Program Files/Research In Motion/BlackBerry JDE 4.3.0" "HelloWorld.jdw"

As you can see this tool does all the dirty job by parsing *.jdw and *.jdp files and successfully compiles *.cod for us.

 

The next step is signing compiled *.cod files.

For a long time this was very difficult to automate becasue SignatureTool.jar tool required to enter validation password manually. One could automate it by automatic UI interaction but that was very unstable.

Using JDE 4.3.0 SignatureTool.jar it is now possible to specify password as a parameter (-p PASSWORD) as well as other parameters to do signing in quiet mode.

You can see Appendix A: Command line code signature requests of BlackBerry Signature Tool Developer Guide (Version 4.3.0)  for the full list of SignatureTool.jar comand line parameters but here’s the syntax to automate signing process:

java -jar "C:/Program Files/Research In Motion/BlackBerry JDE 4.3.0/SignatureTool.jar"

-javahome="C:/jdk1.4.0" -a -c "HelloWorld.cod" -p PASSWORD

Here’s my complete MSBuild project for this automation:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <JavaDir>"C:\Program Files\Java\jdk1.6.0"</JavaDir>
        <JDEDir>C:\Program Files\Research In Motion</JDEDir>
        <ProjectDir>.HelloWorld.jdw</ProjectDir>
        <SigningPassword>SecretWord</SigningPassword>
        <SourceDir>HelloWorld</SourceDir>
    </PropertyGroup>
    <Target Name="Building">
        <Delete Files="$(ProjectDir)/HelloWorld.cod;$(ProjectDir)/HelloWorld.cso" />
        <Exec Command="java -jar lib/anttask-rapc-1.8.jar -alx -javahome=$(JavaDir) -jdehome=&quot;$(JDEDir)\BlackBerry JDE $(Version)&quot; &quot;$(ProjectDir)\HelloWorld.jdw&quot;" />
        <Copy SourceFiles="$(SourceDir)/HelloWorld.cod;$(SourceDir)/HelloWorld.cso" DestinationFiles="..\build\$(Version)\HelloWorld.cod;..\build\$(Version)\HelloWorld.cso" />
        <Exec Command="java -jar &quot;$(JDEDir)\BlackBerry JDE 4.3.0\bin\SignatureTool.jar&quot; -a -c ..\build\$(Version)\HelloWorld.cod -p $(SigningPassword)" />
    </Target>
</Project>
Advertisements

0 Responses to “BlackBerry JDE projects Build & Signing automation”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: