如何在构建BlackBerry WebWorks或PhoneGap应用程序时缩短开发周期?

时间:2012-11-01 16:31:17

标签: html5 cordova blackberry-webworks blackberry-10

我很想听听WebWorks开发人员如何通过使用任何聪明的构建过程/测试技术在开发周期中节省时间。

有什么提示&你会建议使用什么技巧来减少构建和制作所需的时间。测试WebWorks(或PhoneGap)应用程序?

例如,这是Demian Borba的一个很好的建议(http://dborba.com/?p=274):

  1. 构建您的应用一次,但将其配置为从您的开发网络服务器加载其起始页
  2. 对该内容进行更改,并在重新启动应用时反映出来(无需重新编译/重新部署应用)
  3. 甚至可以使用Livereloader使其更快

2 个答案:

答案 0 :(得分:1)

如果你使用蚂蚁,这里有一些有用的目标:

<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>

这是windows环境变量的例子:

<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" />

答案 1 :(得分:1)

Blackberry刚刚发布了官方Ant build script