Adam Stanley
Adam Stanley

Reputation: 1885

How to reduce development cycles when building BlackBerry WebWorks or PhoneGap applications?

I'm interested in hearing how WebWorks developers are saving time during their development cycles by using any clever build processes / testing techniques.

What tips & tricks would you recommend to help reduce the amount of time it takes to build & test a WebWorks (or PhoneGap) application?

For example, here's a great suggestion (http://dborba.com/?p=274) from Demian Borba:

  1. Build your app once, but configure it to load its start page from your dev web server
  2. Make changes in that content, and they will be reflected when you re-launch your app (no need to recompile / redeploy the app)
  3. Can even use Livereloader to make it even faster

Upvotes: 1

Views: 222

Answers (2)

Benoit
Benoit

Reputation: 1921

Blackberry has just released the official Ant build script

Upvotes: 1

Benoit
Benoit

Reputation: 1921

If you use ant, here some target you will find useful:

<target name="zip" depends="init" description="Archive your files before building the bar" >
    <zip
        destfile="${build.dir}/${type.name}.zip"
        basedir="${basedir}"
        excludes="*.project,*.settings/,.*properties,*.svn,*.svn/*, builder/, .gitignore, .git/*"
        includes="*,WebContent/"
    />
</target>

<target name="bar" depends="zip" description="create the bar file" >
    <exec executable="${bbwp}">
        <env key="JAVA_HOME" path="${sdk.JAVA_HOME}" />
        <arg value="${build.dir}/${type.name}.zip"/>
        <arg line="-o '${build.dir}'" />
        <arg line="-v" />

        <!-- Allows debugging on port 1337 -->
        <arg line="-d" />
        <!-- Sign to Appworld -->
        <!-- <arg line="-g ${keyPass} - -buildId 10" />  -->
    </exec>
</target>

<target name="install" depends="bar"  description="Deploy the the .bar file to your simulator. The old application is automatically uninstalled." >
    <java jar="${BarDeploy.dir}/BarDeploy.jar"
    fork="true"
    maxmemory="512M"
    >
        <env key="JAVA_HOME" path="${sdk.JAVA_HOME}" />
        <arg value="-installApp" />
        <arg value="-launchApp" />
        <arg value="-password" />
        <arg value="${password}" />
        <arg value="-device" />
        <arg value="${simIP}" />
        <arg value="-package" />
        <arg value="${bar.file}" />
    </java>
</target>

<target name="uninstall" description="Uninstall an application from the Simulator. " >
    <java jar="${BarDeploy.dir}/BarDeploy.jar"
    fork="true"
    maxmemory="512M"
    >
        <env key="JAVA_HOME" path="${sdk.JAVA_HOME}" />
        <arg value="-uninstallApp" />
        <arg value="-password" />
        <arg value="${password}" />
        <arg value="-device" />
        <arg value="${simIP}" />
        <arg value="-package" />
        <arg value="${bar.file}" />
    </java>
</target>

Here an exemple of the variable for a windows environment:

<property name="password" value=""/>
<property name="simIP" value="169.254.0.1" />
<property name="keyPass" value="" />

<property name="sdk.HOME" location="C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.1.8" />
<property name="build.dir" location="${basedir}\build" />
<property name="bar.file" location="${build.dir}\device\${type.name}.bar" />
<property name="sdk.JAVA_HOME" location="C:\Program Files\Java\jre6" />
<property name="bbwp" location="${sdk.HOME}\bbwp.bat" />
<property name="BarDeploy.dir" location="${sdk.HOME}\dependencies\tools\lib" />

Upvotes: 1

Related Questions