incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [20/28] git commit: Merge remote branch 'jeffheifetz/playbookSupport' into master
Date Tue, 03 Jan 2012 20:22:59 GMT
Merge remote branch 'jeffheifetz/playbookSupport' into master

Conflicts:
	build.xml
	framework/ext/src/com/phonegap/device/Device.java
	javascript/_phonegap.js
	template/project/www/config.xml
	template/project/www/plugins.xml


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/19c0e686
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/19c0e686
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/19c0e686

Branch: refs/heads/master
Commit: 19c0e686067e36a563815435f6ed69ee562dbf9d
Parents: 13293d7 ef539d3
Author: Michael Brooks <michael@michaelbrooks.ca>
Authored: Fri Nov 25 12:26:19 2011 -0800
Committer: Michael Brooks <michael@michaelbrooks.ca>
Committed: Fri Nov 25 12:28:54 2011 -0800

----------------------------------------------------------------------
 .gitignore                                         |    3 +
 README.md                                          |    6 +-
 build.xml                                          |   45 ++-
 framework/ext-air/PhoneGap_Network/library.xml     |   22 +
 .../src/com/phonegap/network/Network.as            |   67 +++
 .../ext/src/com/phonegap/PhoneGapExtension.java    |   16 +-
 framework/ext/src/com/phonegap/device/Device.java  |   53 ++-
 framework/ext/src/library.xml                      |    4 +-
 javascript/_phonegap.js                            |   40 +--
 javascript/blackberry/blackberryPluginManager.js   |  112 +++++
 javascript/capture.js                              |  380 +++++++++++++++
 javascript/console.js                              |   47 ++-
 javascript/device.js                               |   37 +-
 javascript/playbook/playBookPluginManager.js       |  239 +++++++++
 javascript/webWorksPluginManager.js                |   91 ++++
 template/project/blackberry.xml                    |  301 ++++++++++++
 template/project/build.xml                         |  243 ++--------
 template/project/playbook.xml                      |  238 +++++++++
 template/project/project.properties                |   57 ++-
 template/project/www/config.xml                    |   13 +-
 template/project/www/plugins.xml                   |    1 +
 21 files changed, 1708 insertions(+), 307 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/build.xml
----------------------------------------------------------------------
diff --cc build.xml
index 6a5cd6d,00a460c..b94274d
--- a/build.xml
+++ b/build.xml
@@@ -1,322 -1,357 +1,357 @@@
 -<project name="Create &amp; Update a PhoneGap BlackBerry WebWorks Project or Plugin" default="help">
 -    
 -    <!-- LOAD VERSION -->
 -    
 -    <loadfile property="version" srcFile="VERSION">
 -        <filterchain>
 -            <striplinebreaks/>
 -        </filterchain>
 -    </loadfile>
 -    
 -    <!-- LOAD PROPERTIES -->
 -    
 -    <property name="template.project.dir" location="template/project" />
 -    <property name="template.plugin.dir"  location="template/plugin" />
 -    <property name="template.dist.dir"    location="template/dist" />
 -    
 -    <property name="build.dir"            location="build" />
 -    <property name="update.dir"           value="lib/phonegap.${version}" />
 -    
 -    <property name="dist.path"         location="dist" />
 -    <property name="dist.www.path"     location="${dist.path}/www" />
 -    <property name="dist.project.path" location="${dist.path}/sample" />
 -    
 -    <property name="jar.src"      location="framework/ext/src" />
 -    <property name="jar.path"     value="ext" />
 -    <property name="jar.basename" value="phonegap.${version}.jar" />
 -    <property name="jar.file"     value="${jar.path}/${jar.basename}" />
 -    
 -    <property name="playbook.js.src"    location="javascript/playbook" />
 -    <property name="playbook.js.path"   value="javascript/playbook" />
 -    <property name="playbook.js.file"   value="${playbook.js.path}/playbook.js" />
 -    <property name="playbook.ext.src"   location="framework/ext-air" />
 -    <property name="playbook.ext.path"  value="ext-air" />
 -    
 -    <property name="js.src"          location="javascript" />
 -    <property name="js.path"         value="javascript" />
 -    <property name="js.basename"     value="phonegap.${version}.js" />
 -    <property name="js.file"         value="${js.path}/${js.basename}" />
 -    
 -    <!-- BUILD JAVASCRIPT -->
 -    
 -    <target name="build-javascript">
 -        <mkdir dir="${build.dir}/${js.path}" />
 -        
 -        <!-- BB Javascript -->
 -        <concat destfile="${build.dir}/${js.file}" append="false">
 -            <fileset dir="${js.src}">
 -                <include name="*.js" />
 -            </fileset>
 -        </concat>
 -		<concat destfile="${build.dir}/${js.file}" append="true">
 -            <fileset dir="${js.src}/blackberry" includes="*.js"/>
 -        </concat>					 
 -					 
 -		<!-- PB Javascript -->
 -        <mkdir dir="${build.dir}/${playbook.js.path}" />
 -        <concat destfile="${build.dir}/${playbook.js.path}/${js.basename}" append="false">
 -            <fileset dir="${js.src}" includes="*.js" />
 -        </concat>
 -        <concat destfile="${build.dir}/${playbook.js.path}/${js.basename}" append="true">
 -            <fileset dir="${js.src}/playbook" includes="*.js"/>
 -        </concat>
 -    </target>
 -    
 -    <!-- BUILD BLACKBERRY EXTENSION -->
 -    
 -    <target name="build-bb-extension">
 -        <mkdir dir="${build.dir}/${jar.path}" />
 -        
 -        <zip destfile="${build.dir}/${jar.file}">
 -            <fileset dir="${jar.src}" includes="library.xml" />
 -            <fileset dir="${jar.src}" includes="**/*.java" />
 -        </zip>
 -    </target>
 -    
 -    <!-- BUILD PLAYBOOK EXTENSION -->
 -    
 -    <target name="build-pb-extension">               
 -
 -        <!-- Copy Ext -->
 -        <mkdir dir="${build.dir}/${playbook.ext.path}" />
 -        <copy todir="${build.dir}/${playbook.ext.path}">
 -            <fileset dir="${playbook.ext.src}" />
 -        </copy>
 -    </target>
 -    
 -    <!-- CREATE A PROJECT -->
 -    <target name="create" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
 -        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
 -        
 -        <available file="${project.path}" property="project.exists" />
 -        <fail if="project.exists" message="The project path must be an empty directory." />
 -        
 -        <!-- create project using template directory -->
 -        <mkdir dir="${project.path}" />
 -        <copy todir="${project.path}">
 -            <fileset dir="${template.project.dir}" />
 -        </copy>
 -        
 -        <!-- update project files to reference phonegap.x.x.x.js -->
 -        <replaceregexp match="phonegap\.js" replace="${js.basename}" byline="true">
 -            <fileset file="${project.path}/www/index.html" />
 -            <fileset file="${project.path}/build.xml" />
 -        </replaceregexp>
 -        
 -        <!-- copy phonegap.js -->
 -        <copy todir="${project.path}/www">
 -            <fileset dir="${build.dir}/${js.path}" />
 -        </copy>
 -        
 -        <!-- copy ext/ -->
 -        <copy todir="${project.path}/www/ext">
 -            <fileset dir="${build.dir}/${jar.path}" />
 -        </copy>
 -        
 -        <!-- copy ext-air/ -->
 -        <copy todir="${project.path}/www/ext-air">
 -            <fileset dir="${build.dir}/${playbook.ext.path}" />
 -        </copy>
 -        
 -        <!-- save release -->
 -        <mkdir dir="${project.path}/${update.dir}" />
 -        <copy todir="${project.path}/${update.dir}">
 -            <fileset dir="${build.dir}" />
 -        </copy>
 -        
 -        <echo>
 -Project Creation Complete!
 -==========================
 -
 -Getting Started:
 -----------------
 -
 -  cd ${project.path}
 -
 -  ant help
 -        </echo>
 -    </target>
 -    
 -    <!-- DISTRIBUTION -->
 -    <target name="dist" depends="">
 -        <!-- create a sample project -->
 -        <antcall target="create">
 -            <param name="project.path" value="${dist.project.path}" />
 -        </antcall>
 -        
 -        <!-- copy dist template (README.md) -->
 -        <copy todir="${dist.path}">
 -            <fileset dir="${template.dist.dir}" />
 -        </copy>
 -        
 -        <!-- copy phonegap.jar -->
 -        <copy todir="${dist.www.path}/ext">
 -            <fileset dir="${build.dir}/${jar.path}" />
 -        </copy>
 -        
 -        <!-- copy phonegap.js -->
 -        <copy todir="${dist.www.path}">
 -            <fileset dir="${build.dir}/${js.path}" />
 -        </copy>
 -        
 -        <!-- copy config.xml -->
 -        <copy todir="${dist.www.path}">
 -            <fileset file="${template.project.dir}/www/config.xml" />
 -        </copy>
 -        
 -        <!-- copy plugins.xml -->
 -        <copy todir="${dist.www.path}">
 -            <fileset file="${template.project.dir}/www/plugins.xml" />
 -        </copy>
 -        
 -        <echo>
 -Distribution Complete!
 -======================
 -
 -Version:
 ---------
 -
 -  ${version}
 -
 -Path:
 ------
 -
 -  ${dist.path}
 -        </echo>
 -    </target>
 -    
 -    <target name="version">
 -        <replace dir="." token="${version}" value="${value}" />
 -        
 -        <echo>
 -Version Update Complete!
 -========================
 -
 -Version:
 ---------
 -
 -  Previous: ${version}
 -  Current:  ${value}
 -
 -Remember to:
 -------------
 -
 -  Review and commit the version update.
 -  
 -  $ git diff
 -  $ git commit -am "Update to version ${value}"
 -  $ git tag ${value}
 -        </echo>
 -    </target>
 -    
 -    <!-- UPDATE A PROJECT -->
 -    
 -    <target name="update" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
 -        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
 -        
 -        <available file="${project.path}" property="project.exists" />
 -        <fail unless="project.exists" message="The project path cannot be empty." />
 -        
 -        <!-- save release -->
 -        <mkdir dir="${project.path}/${update.dir}" />
 -        <copy todir="${project.path}/${update.dir}">
 -            <fileset dir="${build.dir}" />
 -        </copy>
 -        
 -        <echo>
 -Update complete!
 -================
 -
 -  PhoneGap ${version} has been created.
 -  
 -  Update does not alter your project files.
 -  
 -  See below for instructions to install PhoneGap ${version}.
 -
 -Where:
 -------
 -
 -  ${project.path}/${update.dir}
 -
 -Install:
 ---------
 -
 -  1. Install the Java Extension:
 -
 -    - delete /www/${jar.path}/phonegap.jar
 -    
 -    - copy /${update.dir}/${jar.file}
 -        to /www/${jar.file}
 -
 -  2. Install the JavaScript library:
 -
 -    - delete /www/phonegap.js
 -    
 -    - copy /${update.dir}/${js.file}
 -        to /www/${js.basename}
 -
 -  3. Update JavaScript references:
 -
 -    - &#60;script type=&#34;text/javascript&#34; src=&#34;${js.basename}&#34;&#62;&#60;/script&#62;
 -        </echo>
 -    </target>
 -    
 -    <!-- CREATE A PLUGIN -->
 -
 -    <target name="create-plugin" depends="">
 -        <!-- validate arguments -->
 -        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
 -
 -        <!-- destination must be empty -->
 -        <available file="${plugin.path}" property="plugin.exists" />
 -        <fail if="plugin.exists" message="The plugin path must be an empty directory." />
 -
 -        <!-- copy plugin directory -->
 -        <mkdir dir="${plugin.path}" />
 -        <copy todir="${plugin.path}">
 -            <fileset dir="${template.plugin.dir}" />
 -        </copy>
 -
 -        <echo>
 -Plugin Creation Complete!
 -=========================
 -
 -Getting Started:
 -----------------
 -
 -  cd ${plugin.path}
 -
 -  ant help
 -        </echo>
 -    </target>
 -
 -    <!-- UPDATE A PLUGIN -->
 -
 -    <target name="update-plugin" depends="">
 -        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
 -
 -        <available file="${plugin.path}" property="plugin.exists" />
 -        <fail unless="plugin.exists" message="The plugin path cannot be empty." />
 -
 -        <!-- build.xml -->
 -        <copy todir="${plugin.path}" file="${template.plugin.dir}/build.xml" />
 -        <echo message="Updated build.xml" />
 -    </target>
 -
 -    <!-- CLEAN -->
 -    
 -    <target name="clean">
 -        <delete dir="${build.dir}" />
 -        <delete dir="${dist.path}" />
 -    </target>
 -    
 -    <!-- HELP -->
 -    
 -    <target name="help">
 -        <echo>
 -NAME
 -  ${ant.project.name}
 -
 -SYNOPSIS
 -  ant COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
 -
 -DESCRIPTION
 -  This tool allows you to create and update PhoneGap-BlackBerry-WebWorks projects.
 -  You will want to run update after you have updated the framework source.
 -  In other words, when you &lt;git pull origin master&gt;.
 -
 -COMMANDS
 -  help ............ Show this help menu.
 -                      ant, ant help
 -
 -  create .......... Create a new project
 -                      ant create PATH
 -                      ant create -Dproject.path="C:\dev\my_project"
 -
 -  update .......... Update an existing project
 -                      ant update PATH
 -                      ant update -Dproject.path="C:\dev\my_project"
 -
 -  dist ............ Create a PhoneGap distribution build
 -                      ant dist
 -
 -  version ......... Update PhoneGap version
 -                      ant version VERSION
 -                      ant version -Dvalue="1.0.0"
 -
 -  create-plugin ... Create a new plugin
 -                      ant create-plugin PATH
 -                      ant create-plugin -Dplugin.path="C:\dev\my_plugin"
 -
 -  update-plugin ... Update a plugin's ANT script
 -                      ant update-plugin PATH
 -                      ant update-plugin -Dplugin.path="C:\dev\my_plugin"
 -        </echo>
 -    </target>
 -
 -</project>
 +<project name="Create &amp; Update a PhoneGap BlackBerry WebWorks Project or Plugin" default="help">
 +    
 +    <!-- LOAD VERSION -->
 +    
 +    <loadfile property="version" srcFile="VERSION">
 +        <filterchain>
 +            <striplinebreaks/>
 +        </filterchain>
 +    </loadfile>
 +    
 +    <!-- LOAD PROPERTIES -->
 +    
 +    <property name="template.project.dir" location="template/project" />
 +    <property name="template.plugin.dir"  location="template/plugin" />
 +    <property name="template.dist.dir"    location="template/dist" />
 +    
 +    <property name="build.dir"            location="build" />
 +    <property name="update.dir"           value="lib/phonegap.${version}" />
 +    
 +    <property name="dist.path"         location="dist" />
 +    <property name="dist.www.path"     location="${dist.path}/www" />
 +    <property name="dist.project.path" location="${dist.path}/sample" />
 +    
 +    <property name="jar.src"      location="framework/ext/src" />
 +    <property name="jar.path"     value="ext" />
 +    <property name="jar.basename" value="phonegap.${version}.jar" />
 +    <property name="jar.file"     value="${jar.path}/${jar.basename}" />
 +    
++    <property name="playbook.js.src"    location="javascript/playbook" />
++    <property name="playbook.js.path"   value="javascript/playbook" />
++    <property name="playbook.js.file"   value="${playbook.js.path}/playbook.js" />
++    <property name="playbook.ext.src"   location="framework/ext-air" />
++    <property name="playbook.ext.path"  value="ext-air" />
++    
 +    <property name="js.src"          location="javascript" />
 +    <property name="js.path"         value="javascript" />
 +    <property name="js.basename"     value="phonegap-${version}.js" />
 +    <property name="js.file"         value="${js.path}/${js.basename}" />
 +    
 +    <!-- BUILD JAVASCRIPT -->
 +    
 +    <target name="build-javascript">
 +        <mkdir dir="${build.dir}/${js.path}" />
 +        
++        <!-- BB Javascript -->
 +        <concat destfile="${build.dir}/${js.file}" append="false">
 +            <fileset dir="${js.src}">
 +                <include name="*.js" />
 +            </fileset>
 +        </concat>
++		<concat destfile="${build.dir}/${js.file}" append="true">
++            <fileset dir="${js.src}/blackberry" includes="*.js"/>
++        </concat>					 
++					 
++		<!-- PB Javascript -->
++        <mkdir dir="${build.dir}/${playbook.js.path}" />
++        <concat destfile="${build.dir}/${playbook.js.path}/${js.basename}" append="false">
++            <fileset dir="${js.src}" includes="*.js" />
++        </concat>
++        <concat destfile="${build.dir}/${playbook.js.path}/${js.basename}" append="true">
++            <fileset dir="${js.src}/playbook" includes="*.js"/>
++        </concat>
 +    </target>
 +    
-     <!-- BUILD WIDGET EXTENSION -->
++    <!-- BUILD BLACKBERRY EXTENSION -->
 +    
-     <target name="build-extension">
++    <target name="build-bb-extension">
 +        <mkdir dir="${build.dir}/${jar.path}" />
 +        
 +        <zip destfile="${build.dir}/${jar.file}">
 +            <fileset dir="${jar.src}" includes="library.xml" />
 +            <fileset dir="${jar.src}" includes="**/*.java" />
 +        </zip>
 +    </target>
 +    
++    <!-- BUILD PLAYBOOK EXTENSION -->
++    
++    <target name="build-pb-extension">               
++
++        <!-- Copy Ext -->
++        <mkdir dir="${build.dir}/${playbook.ext.path}" />
++        <copy todir="${build.dir}/${playbook.ext.path}">
++            <fileset dir="${playbook.ext.src}" />
++        </copy>
++    </target>
++    
 +    <!-- CREATE A PROJECT -->
-     <target name="create" depends="clean, build-javascript, build-extension">
++    <target name="create" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
 +        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
 +        
 +        <available file="${project.path}" property="project.exists" />
 +        <fail if="project.exists" message="The project path must be an empty directory." />
 +        
 +        <!-- create project using template directory -->
 +        <mkdir dir="${project.path}" />
 +        <copy todir="${project.path}">
 +            <fileset dir="${template.project.dir}" />
 +        </copy>
 +        
 +        <!-- update project files to reference phonegap.x.x.x.js -->
 +        <replaceregexp match="phonegap\.js" replace="${js.basename}" byline="true">
 +            <fileset file="${project.path}/www/index.html" />
 +            <fileset file="${project.path}/build.xml" />
 +        </replaceregexp>
 +        
 +        <!-- copy phonegap.js -->
 +        <copy todir="${project.path}/www">
 +            <fileset dir="${build.dir}/${js.path}" />
 +        </copy>
 +        
 +        <!-- copy ext/ -->
 +        <copy todir="${project.path}/www/ext">
 +            <fileset dir="${build.dir}/${jar.path}" />
 +        </copy>
 +        
++        <!-- copy ext-air/ -->
++        <copy todir="${project.path}/www/ext-air">
++            <fileset dir="${build.dir}/${playbook.ext.path}" />
++        </copy>
++        
 +        <!-- save release -->
 +        <mkdir dir="${project.path}/${update.dir}" />
 +        <copy todir="${project.path}/${update.dir}">
 +            <fileset dir="${build.dir}" />
 +        </copy>
 +        
 +        <echo>
 +Project Creation Complete!
 +==========================
 +
 +Getting Started:
 +----------------
 +
 +  cd ${project.path}
 +
 +  ant help
 +        </echo>
 +    </target>
 +    
 +    <!-- DISTRIBUTION -->
 +    <target name="dist" depends="">
 +        <!-- create a sample project -->
 +        <antcall target="create">
 +            <param name="project.path" value="${dist.project.path}" />
 +        </antcall>
 +        
 +        <!-- copy dist template (README.md) -->
 +        <copy todir="${dist.path}">
 +            <fileset dir="${template.dist.dir}" />
 +        </copy>
 +        
 +        <!-- copy phonegap.jar -->
 +        <copy todir="${dist.www.path}/ext">
 +            <fileset dir="${build.dir}/${jar.path}" />
 +        </copy>
 +        
 +        <!-- copy phonegap.js -->
 +        <copy todir="${dist.www.path}">
 +            <fileset dir="${build.dir}/${js.path}" />
 +        </copy>
 +        
 +        <!-- copy config.xml -->
 +        <copy todir="${dist.www.path}">
 +            <fileset file="${template.project.dir}/www/config.xml" />
 +        </copy>
 +        
 +        <!-- copy plugins.xml -->
 +        <copy todir="${dist.www.path}">
 +            <fileset file="${template.project.dir}/www/plugins.xml" />
 +        </copy>
 +        
 +        <echo>
 +Distribution Complete!
 +======================
 +
 +Version:
 +--------
 +
 +  ${version}
 +
 +Path:
 +-----
 +
 +  ${dist.path}
 +        </echo>
 +    </target>
 +    
 +    <target name="version">
 +        <replace dir="." token="${version}" value="${value}" />
 +        
 +        <echo>
 +Version Update Complete!
 +========================
 +
 +Version:
 +--------
 +
 +  Previous: ${version}
 +  Current:  ${value}
 +
 +Remember to:
 +------------
 +
 +  Review and commit the version update.
 +  
 +  $ git diff
 +  $ git commit -am "Update to version ${value}"
 +  $ git tag ${value}
 +        </echo>
 +    </target>
 +    
 +    <!-- UPDATE A PROJECT -->
 +    
-     <target name="update" depends="clean, build-javascript, build-extension">
++    <target name="update" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
 +        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
 +        
 +        <available file="${project.path}" property="project.exists" />
 +        <fail unless="project.exists" message="The project path cannot be empty." />
 +        
 +        <!-- save release -->
 +        <mkdir dir="${project.path}/${update.dir}" />
 +        <copy todir="${project.path}/${update.dir}">
 +            <fileset dir="${build.dir}" />
 +        </copy>
 +        
 +        <echo>
 +Update complete!
 +================
 +
 +  PhoneGap ${version} has been created.
 +  
 +  Update does not alter your project files.
 +  
 +  See below for instructions to install PhoneGap ${version}.
 +
 +Where:
 +------
 +
 +  ${project.path}/${update.dir}
 +
 +Install:
 +--------
 +
 +  1. Install the Java Extension:
 +
 +    - delete /www/${jar.path}/phonegap.jar
 +    
 +    - copy /${update.dir}/${jar.file}
 +        to /www/${jar.file}
 +
 +  2. Install the JavaScript library:
 +
 +    - delete /www/phonegap.js
 +    
 +    - copy /${update.dir}/${js.file}
 +        to /www/${js.basename}
 +
 +  3. Update JavaScript references:
 +
 +    - &#60;script type=&#34;text/javascript&#34; src=&#34;${js.basename}&#34;&#62;&#60;/script&#62;
 +        </echo>
 +    </target>
 +    
 +    <!-- CREATE A PLUGIN -->
 +
 +    <target name="create-plugin" depends="">
 +        <!-- validate arguments -->
 +        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
 +
 +        <!-- destination must be empty -->
 +        <available file="${plugin.path}" property="plugin.exists" />
 +        <fail if="plugin.exists" message="The plugin path must be an empty directory." />
 +
 +        <!-- copy plugin directory -->
 +        <mkdir dir="${plugin.path}" />
 +        <copy todir="${plugin.path}">
 +            <fileset dir="${template.plugin.dir}" />
 +        </copy>
 +
 +        <echo>
 +Plugin Creation Complete!
 +=========================
 +
 +Getting Started:
 +----------------
 +
 +  cd ${plugin.path}
 +
 +  ant help
 +        </echo>
 +    </target>
 +
 +    <!-- UPDATE A PLUGIN -->
 +
 +    <target name="update-plugin" depends="">
 +        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
 +
 +        <available file="${plugin.path}" property="plugin.exists" />
 +        <fail unless="plugin.exists" message="The plugin path cannot be empty." />
 +
 +        <!-- build.xml -->
 +        <copy todir="${plugin.path}" file="${template.plugin.dir}/build.xml" />
 +        <echo message="Updated build.xml" />
 +    </target>
 +
 +    <!-- CLEAN -->
 +    
 +    <target name="clean">
 +        <delete dir="${build.dir}" />
 +        <delete dir="${dist.path}" />
 +    </target>
 +    
 +    <!-- HELP -->
 +    
 +    <target name="help">
 +        <echo>
 +NAME
 +  ${ant.project.name}
 +
 +SYNOPSIS
 +  ant COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
 +
 +DESCRIPTION
 +  This tool allows you to create and update PhoneGap-BlackBerry-WebWorks projects.
 +  You will want to run update after you have updated the framework source.
 +  In other words, when you &lt;git pull origin master&gt;.
 +
 +COMMANDS
 +  help ............ Show this help menu.
 +                      ant, ant help
 +
 +  create .......... Create a new project
 +                      ant create PATH
 +                      ant create -Dproject.path="C:\dev\my_project"
 +
 +  update .......... Update an existing project
 +                      ant update PATH
 +                      ant update -Dproject.path="C:\dev\my_project"
 +
 +  dist ............ Create a PhoneGap distribution build
 +                      ant dist
 +
 +  version ......... Update PhoneGap version
 +                      ant version VERSION
 +                      ant version -Dvalue="1.0.0"
 +
 +  create-plugin ... Create a new plugin
 +                      ant create-plugin PATH
 +                      ant create-plugin -Dplugin.path="C:\dev\my_plugin"
 +
 +  update-plugin ... Update a plugin's ANT script
 +                      ant update-plugin PATH
 +                      ant update-plugin -Dplugin.path="C:\dev\my_plugin"
 +        </echo>
 +    </target>
 +
- </project>
++</project>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/framework/ext/src/com/phonegap/PhoneGapExtension.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/framework/ext/src/com/phonegap/device/Device.java
----------------------------------------------------------------------
diff --cc framework/ext/src/com/phonegap/device/Device.java
index 20eaa33,63820b4..42363e1
--- a/framework/ext/src/com/phonegap/device/Device.java
+++ b/framework/ext/src/com/phonegap/device/Device.java
@@@ -1,39 -1,56 +1,56 @@@
 -/*
 - * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 - * 
 - * Copyright (c) 2005-2010, Nitobi Software Inc.
 - * Copyright (c) 2010, IBM Corporation
 - * Copyright (c) 2011, Research In Motion Limited.
 - */
 -package com.phonegap.device;
 -
 -import net.rim.device.api.system.DeviceInfo;
 -
 -import com.phonegap.api.Plugin;
 -import com.phonegap.api.PluginResult;
 -import com.phonegap.json4j.JSONArray;
 -import com.phonegap.json4j.JSONException;
 -import com.phonegap.json4j.JSONObject;
 -
 -/**
 - * Provides device information, including:
 - * 
 - * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.
 - * - Unique device identifier (UUID).
 - * - PhoneGap software version.
 - */
 -public final class Device extends Plugin {
 -
 -	public static final String FIELD_PLATFORM 	= "platform";
 -	public static final String FIELD_UUID     	= "uuid";
 -	public static final String FIELD_PHONEGAP 	= "phonegap";
 -	public static final String FIELD_NAME 		= "name";
 -	public static final String FIELD_VERSION 	= "version";	
 -	
 -	public static final String ACTION_GET_DEVICE_INFO = "getDeviceInfo";
 -		
 -	public PluginResult execute(String action, JSONArray args, String callbackId) {
 -		PluginResult result = new PluginResult(PluginResult.Status.INVALIDACTION, "Device: Invalid action:" + action);
 -		
 -		if(action.equals(ACTION_GET_DEVICE_INFO)){
 -			try {
 -				JSONObject device = new JSONObject();
 -				device.put( FIELD_PLATFORM, new String(DeviceInfo.getPlatformVersion() ) );
 -				device.put( FIELD_UUID, new Integer( DeviceInfo.getDeviceId()) );
 -				device.put( FIELD_PHONEGAP, "1.0.0" );
 -				device.put( FIELD_NAME, new String(DeviceInfo.getDeviceName()) );
 -				device.put( FIELD_VERSION, new String(DeviceInfo.getSoftwareVersion()) );
 -				result = new PluginResult(PluginResult.Status.OK, device);
 -			} catch (JSONException e) {
 -				result = new PluginResult(PluginResult.Status.JSONEXCEPTION, e.getMessage());
 -			}					
 -		}
 -		
 -		return result;
 -	}
 -
 -}
 +/*
 + * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 + * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 + * 
-  * Copyright (c) 2005-2010, Nitobi Software Inc.
-  * Copyright (c) 2010, IBM Corporation
++ * Copyright (c) 2005-2011, Nitobi Software Inc.
++ * Copyright (c) 2010-2011, IBM Corporation
++ * Copyright (c) 2011, Research In Motion Limited.
 + */
 +package com.phonegap.device;
 +
- import net.rim.device.api.script.Scriptable;
 +import net.rim.device.api.system.DeviceInfo;
 +
++import com.phonegap.api.Plugin;
++import com.phonegap.api.PluginResult;
++import com.phonegap.json4j.JSONArray;
++import com.phonegap.json4j.JSONException;
++import com.phonegap.json4j.JSONObject;
++
 +/**
 + * Provides device information, including:
 + * 
 + * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.
 + * - Unique device identifier (UUID).
 + * - PhoneGap software version.
 + */
- public final class Device extends Scriptable {
- 	public static final String FIELD_PLATFORM = "platform";
- 	public static final String FIELD_UUID     = "uuid";
- 	public static final String FIELD_PHONEGAP = "phonegap";
++public final class Device extends Plugin {
++
++	public static final String FIELD_PLATFORM 	= "platform";
++	public static final String FIELD_UUID     	= "uuid";
++	public static final String FIELD_PHONEGAP 	= "phonegap";
++	public static final String FIELD_NAME 		= "name";
++	public static final String FIELD_VERSION 	= "version";	
 +	
- 	public Object getField(String name) throws Exception {
++	public static final String ACTION_GET_DEVICE_INFO = "getDeviceInfo";
 +		
- 		if (name.equals(FIELD_PLATFORM)) {
- 			return new String(DeviceInfo.getPlatformVersion());
- 		}
- 		else if (name.equals(FIELD_UUID)) {
- 			return new Integer(DeviceInfo.getDeviceId());
- 		}
- 		else if (name.equals(FIELD_PHONEGAP)) {
- 			return "1.2.0";
++	public PluginResult execute(String action, JSONArray args, String callbackId) {
++		PluginResult result = new PluginResult(PluginResult.Status.INVALIDACTION, "Device: Invalid action:" + action);
++		
++		if(action.equals(ACTION_GET_DEVICE_INFO)){
++			try {
++				JSONObject device = new JSONObject();
++				device.put( FIELD_PLATFORM, new String(DeviceInfo.getPlatformVersion() ) );
++				device.put( FIELD_UUID, new Integer( DeviceInfo.getDeviceId()) );
++				device.put( FIELD_PHONEGAP, "1.2.0" );
++				device.put( FIELD_NAME, new String(DeviceInfo.getDeviceName()) );
++				device.put( FIELD_VERSION, new String(DeviceInfo.getSoftwareVersion()) );
++				result = new PluginResult(PluginResult.Status.OK, device);
++			} catch (JSONException e) {
++				result = new PluginResult(PluginResult.Status.JSONEXCEPTION, e.getMessage());
++			}					
 +		}
 +		
- 		return super.getField(name);
++		return result;
 +	}
- }
++
++}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/framework/ext/src/library.xml
----------------------------------------------------------------------
diff --cc framework/ext/src/library.xml
index 97fee84,244a5dc..d578795
--- a/framework/ext/src/library.xml
+++ b/framework/ext/src/library.xml
@@@ -1,9 -1,9 +1,9 @@@
- <?xml version="1.0" encoding="UTF-8"?>
 -<?xml version="1.0" encoding="UTF-8"?>
 -<library>
 -	<extension>
 -		<entryClass>com.phonegap.PhoneGapExtension</entryClass>
 -	</extension>
 -	<features>
 -		<feature id="com.phonegap" version="1.0.0">PhoneGap JavaScript Extension</feature>
 -	</features>
 -</library>
++<?xml version="1.0" encoding="UTF-8"?>
 +<library>
 +	<extension>
 +		<entryClass>com.phonegap.PhoneGapExtension</entryClass>
 +	</extension>
 +	<features>
- 		<feature id="phonegap" version="1.0.0">PhoneGap JavaScript Extension</feature>
++		<feature id="com.phonegap" version="1.0.0">PhoneGap JavaScript Extension</feature>
 +	</features>
 +</library>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/javascript/_phonegap.js
----------------------------------------------------------------------
diff --cc javascript/_phonegap.js
index c148a2d,85b42dd..673aea7
--- a/javascript/_phonegap.js
+++ b/javascript/_phonegap.js
@@@ -3,8 -3,9 +3,9 @@@
   * PhoneGap is available under *either* the terms of the modified BSD license *or* the
   * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
   * 
-- * Copyright (c) 2005-2010, Nitobi Software Inc.
++ * Copyright (c) 2005-2011, Nitobi Software Inc.
   * Copyright (c) 2010-2011, IBM Corporation
 - * Copyright (c) 2011, Research In Motion Limited.
++ * Copyright (c) 2011, Research In Motion Limited.
   */
  
  /**
@@@ -416,7 -354,7 +417,7 @@@ var PhoneGap = PhoneGap || (function() 
              try {
                  func();
              } catch(e) {
-                 if (typeof(debug['log']) == 'function') {
 -                if (typeof(debug) != 'undefined' && typeof(debug['log']) == 'function') {
++                if (typeof(debug) != 'undefined' && typeof(debug['log']) == 'function') {
                      debug.log("Failed to run constructor: " + debug.processMessage(e));
                  } else {
                      alert("Failed to run constructor: " + e.message);
@@@ -534,17 -472,7 +535,7 @@@
       */
      PhoneGap.exec = function(success, fail, service, action, args) {
          try {
-             var callbackId = service + PhoneGap.callbackId++;
-             if (success || fail) {
-                 PhoneGap.callbacks[callbackId] = {success:success, fail:fail};
-             }
-             
-             // Note: Device returns string, but for some reason emulator returns object - so convert to string.
-             var r = ""+phonegap.PluginManager.exec(service, action, callbackId, JSON.stringify(args), true);
-             
-             // If a result was returned
-             if (r.length > 0) {
-                 eval("var v="+r+";");
 -            var v = phonegap.PluginManager.exec(success, fail, service, action, args);
++            var v = phonegap.PluginManager.exec(success, fail, service, action, args);
              
                  // If status is OK, then return value back to caller
                  if (v.status == PhoneGap.callbackStatus.OK) {
@@@ -558,24 -486,13 +549,13 @@@
                              console.log("Error in success callback: "+callbackId+" = "+e);
                          }
  
-                         // Clear callback if not expecting any more results
-                         if (!v.keepCallback) {
-                             delete PhoneGap.callbacks[callbackId];
                          }
-                     }
                      return v.message;
-                 }
-                 // If no result
-                 else if (v.status == PhoneGap.callbackStatus.NO_RESULT) {
 -            }else if (v.status == PhoneGap.callbackStatus.NO_RESULT){
++            }else if (v.status == PhoneGap.callbackStatus.NO_RESULT){
                          
-                     // Clear callback if not expecting any more results
-                     if (!v.keepCallback) {
-                         delete PhoneGap.callbacks[callbackId];
-                     }
-                 }
 -            }else {
++            }else {
                  // If error, then display error
-                 else {
-                     console.log("Error: Status="+r.status+" Message="+v.message);
 -                console.log("Error: Status="+v.status+" Message="+v.message);
++                console.log("Error: Status="+v.status+" Message="+v.message);
  
                      // If there is a fail callback, then call it now with returned value
                      if (fail) {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/javascript/blackberry/blackberryPluginManager.js
----------------------------------------------------------------------
diff --cc javascript/blackberry/blackberryPluginManager.js
index 0000000,66ef215..561c645
mode 000000,100644..100644
--- a/javascript/blackberry/blackberryPluginManager.js
+++ b/javascript/blackberry/blackberryPluginManager.js
@@@ -1,0 -1,112 +1,112 @@@
 -
 -/*
 - * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 - *
 - * Copyright (c) 2011, Research In Motion Limited.
 - */
 -
 -window.phonegap.PluginManager = (function (webworksPluginManager) {
 -    "use strict";
 -
 -    var retInvalidAction = { "status" : PhoneGap.callbackStatus.INVALID_ACTION, "message" : "Action not found" },
 -
 -        loggerAPI = {
 -            execute: function (webWorksResult, action, args, win, fail) {
 -                switch (action) {
 -                case 'log':
 -                    com.phonegap.Logger.log(args);
 -                    return {"status" : PhoneGap.callbackStatus.OK,
 -                            "message" : 'Message logged to console: ' + args};
 -                }
 -                return retInvalidAction;
 -            }
 -        },
 -        plugins = {'Logger': loggerAPI};
 -
 -    phonegap.BlackBerryPluginManager = function () {
 -    };
 -
 -    phonegap.BlackBerryPluginManager.prototype.exec = function (win, fail, clazz, action, args) {
 -        var result = webworksPluginManager.exec(win, fail, clazz, action, args);
 -
 -        //We got a sync result or a not found from WW that we can pass on to get a native mixin
 -        //For async calls there's nothing to do
 -        if (result.status === PhoneGap.callbackStatus.CLASS_NOT_FOUND_EXCEPTION  ||
 -                result.status === PhoneGap.callbackStatus.INVALID_ACTION ||
 -                result.status === PhoneGap.callbackStatus.OK) {
 -            if (plugins[clazz]) {
 -                return plugins[clazz].execute(result.message, action, args, win, fail);
 -            } else {
 -                result = this.subExec(win, fail, clazz, action, args);
 -            }
 -        }
 -
 -        return result;
 -    };
 -
 -    phonegap.BlackBerryPluginManager.prototype.subExec = function (win, fail, clazz, action, args) {
 -        var callbackId = clazz + PhoneGap.callbackId++,
 -            origResult,
 -            evalResult,
 -            execResult;
 -
 -        try {
 -
 -            if (win || fail) {
 -                PhoneGap.callbacks[callbackId] = {success: win, fail: fail};
 -            }
 -
 -            // Note: Device returns string, but for some reason emulator returns object - so convert to string.
 -            origResult = "" + com.phonegap.JavaPluginManager.exec(clazz, action, callbackId, JSON.stringify(args), true);
 -
 -            // If a result was returned
 -            if (origResult.length > 0) {
 -                eval("evalResult = " + origResult + ";");
 -
 -                // If status is OK, then return evalResultalue back to caller
 -                if (evalResult.status === PhoneGap.callbackStatus.OK) {
 -
 -                    // If there is a success callback, then call it now with returned evalResultalue
 -                    if (win) {
 -                        // Clear callback if not expecting any more results
 -                        if (!evalResult.keepCallback) {
 -                            delete PhoneGap.callbacks[callbackId];
 -                        }
 -                    }
 -                } else if (evalResult.status === PhoneGap.callbackStatus.NO_RESULT) {
 -
 -                    // Clear callback if not expecting any more results
 -                    if (!evalResult.keepCallback) {
 -                        delete PhoneGap.callbacks[callbackId];
 -                    }
 -                } else {
 -                    console.log("Error: Status=" + evalResult.status + " Message=" + evalResult.message);
 -
 -                    // If there is a fail callback, then call it now with returned evalResultalue
 -                    if (fail) {
 -
 -                        // Clear callback if not expecting any more results
 -                        if (!evalResult.keepCallback) {
 -                            delete PhoneGap.callbacks[callbackId];
 -                        }
 -                    }
 -                }
 -                execResult = evalResult;
 -            }
 -        } catch (e) {
 -            console.log("BlackBerryPluginManager Error: " + e);
 -            execResult = {"status" : PhoneGap.callbackStatus.ERROR,
 -                          "message" : e.message};
 -        }
 -
 -        return execResult;
 -    };
 -
 -    phonegap.BlackBerryPluginManager.prototype.resume = com.phonegap.JavaPluginManager.resume;
 -    phonegap.BlackBerryPluginManager.prototype.pause = com.phonegap.JavaPluginManager.pause;
 -    phonegap.BlackBerryPluginManager.prototype.destroy = com.phonegap.JavaPluginManager.destroy;
 -
 -    //Instantiate it
 -    return new phonegap.BlackBerryPluginManager();
++
++/*
++ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
++ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
++ *
++ * Copyright (c) 2011, Research In Motion Limited.
++ */
++
++window.phonegap.PluginManager = (function (webworksPluginManager) {
++    "use strict";
++
++    var retInvalidAction = { "status" : PhoneGap.callbackStatus.INVALID_ACTION, "message" : "Action not found" },
++
++        loggerAPI = {
++            execute: function (webWorksResult, action, args, win, fail) {
++                switch (action) {
++                case 'log':
++                    com.phonegap.Logger.log(args);
++                    return {"status" : PhoneGap.callbackStatus.OK,
++                            "message" : 'Message logged to console: ' + args};
++                }
++                return retInvalidAction;
++            }
++        },
++        plugins = {'Logger': loggerAPI};
++
++    phonegap.BlackBerryPluginManager = function () {
++    };
++
++    phonegap.BlackBerryPluginManager.prototype.exec = function (win, fail, clazz, action, args) {
++        var result = webworksPluginManager.exec(win, fail, clazz, action, args);
++
++        //We got a sync result or a not found from WW that we can pass on to get a native mixin
++        //For async calls there's nothing to do
++        if (result.status === PhoneGap.callbackStatus.CLASS_NOT_FOUND_EXCEPTION  ||
++                result.status === PhoneGap.callbackStatus.INVALID_ACTION ||
++                result.status === PhoneGap.callbackStatus.OK) {
++            if (plugins[clazz]) {
++                return plugins[clazz].execute(result.message, action, args, win, fail);
++            } else {
++                result = this.subExec(win, fail, clazz, action, args);
++            }
++        }
++
++        return result;
++    };
++
++    phonegap.BlackBerryPluginManager.prototype.subExec = function (win, fail, clazz, action, args) {
++        var callbackId = clazz + PhoneGap.callbackId++,
++            origResult,
++            evalResult,
++            execResult;
++
++        try {
++
++            if (win || fail) {
++                PhoneGap.callbacks[callbackId] = {success: win, fail: fail};
++            }
++
++            // Note: Device returns string, but for some reason emulator returns object - so convert to string.
++            origResult = "" + com.phonegap.JavaPluginManager.exec(clazz, action, callbackId, JSON.stringify(args), true);
++
++            // If a result was returned
++            if (origResult.length > 0) {
++                eval("evalResult = " + origResult + ";");
++
++                // If status is OK, then return evalResultalue back to caller
++                if (evalResult.status === PhoneGap.callbackStatus.OK) {
++
++                    // If there is a success callback, then call it now with returned evalResultalue
++                    if (win) {
++                        // Clear callback if not expecting any more results
++                        if (!evalResult.keepCallback) {
++                            delete PhoneGap.callbacks[callbackId];
++                        }
++                    }
++                } else if (evalResult.status === PhoneGap.callbackStatus.NO_RESULT) {
++
++                    // Clear callback if not expecting any more results
++                    if (!evalResult.keepCallback) {
++                        delete PhoneGap.callbacks[callbackId];
++                    }
++                } else {
++                    console.log("Error: Status=" + evalResult.status + " Message=" + evalResult.message);
++
++                    // If there is a fail callback, then call it now with returned evalResultalue
++                    if (fail) {
++
++                        // Clear callback if not expecting any more results
++                        if (!evalResult.keepCallback) {
++                            delete PhoneGap.callbacks[callbackId];
++                        }
++                    }
++                }
++                execResult = evalResult;
++            }
++        } catch (e) {
++            console.log("BlackBerryPluginManager Error: " + e);
++            execResult = {"status" : PhoneGap.callbackStatus.ERROR,
++                          "message" : e.message};
++        }
++
++        return execResult;
++    };
++
++    phonegap.BlackBerryPluginManager.prototype.resume = com.phonegap.JavaPluginManager.resume;
++    phonegap.BlackBerryPluginManager.prototype.pause = com.phonegap.JavaPluginManager.pause;
++    phonegap.BlackBerryPluginManager.prototype.destroy = com.phonegap.JavaPluginManager.destroy;
++
++    //Instantiate it
++    return new phonegap.BlackBerryPluginManager();
+ }(new phonegap.WebWorksPluginManager()));

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/template/project/blackberry.xml
----------------------------------------------------------------------
diff --cc template/project/blackberry.xml
index 0000000,a1e67ba..0947085
mode 000000,100644..100644
--- a/template/project/blackberry.xml
+++ b/template/project/blackberry.xml
@@@ -1,0 -1,301 +1,301 @@@
 -<project default="help">
 -    
 -        <!-- LOAD PROPERTIES -->
 -    
 -    <property prefix="properties" file="project.properties" />
 -    <property name="build.dir"    location="build" />
 -    <property name="widget.dir"   location="${build.dir}/widget" />
 -    <property name="code.sign"    value="false" />
 -    <property name="generate.ext"   value="cod" />
 -    
 -    
 -    <!-- BlackBerry WebWorks Packager directory is required. -->
 -    <fail unless="properties.blackberry.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'bbwp.dir' in your 'project.properties' file." />
 -
 -    <!-- LOAD DEVICE -->
 -    
 -    <target name="load-device" depends="package-app">
 -        <bbwp code-sign="true" />
 -        <exec executable="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe" dir="." failonerror="true">
 -            <arg value="-u" />
 -			<arg value="-w${properties.blackberry.sim.password}" />
 -            <arg value="load" />			
 -            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />			
 -        </exec>
 -    </target>
 -    
 -    <!-- LOAD SIMULATOR -->
 -    
 -    <target name="load-simulator" depends="build">
 -    
 -        <!-- Find the simulator directory -->
 -        <set-simulator-dir />
 -
 -        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
 -        <path id="bbwp.sim.path">
 -            <first>
 -                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
 -                    <include name="**/handhelds.manifest.txt" />
 -                </fileset>
 -            </first>
 -        </path>
 -        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
 -
 -        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
 -             Otherwise, use bbwp simulator directory. -->
 -        <condition 
 -            property="simulator.dir" 
 -            value="${properties.blackberry.sim.dir}" 
 -            else="${bbwp.sim.dir}">
 -                <available file="${properties.blackberry.sim.dir}" type="dir" />
 -        </condition>
 -        <echo message="Simulator directory=${simulator.dir}" />
 -
 -        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
 -             or try setting to 'defaultSimulator.bat' in simulator directory. -->
 -        <condition 
 -            property="sim.bin" 
 -            value="${properties.blackberry.sim.bin}" 
 -            else="defaultSimulator.bat">
 -                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
 -        </condition>
 -
 -        <!-- If simulator executable does not exist, use the first device listed 
 -             in the 'handhelds.manifest.txt' file in the simulator directory. -->
 -        <loadfile 
 -            property="device.list"
 -            srcFile="${simulator.dir}/handhelds.manifest.txt">
 -            <filterchain>
 -                <tokenFilter>
 -                    <stringtokenizer/>
 -                </tokenFilter>
 -            </filterchain>
 -        </loadfile>
 -
 -        <propertyregex property="device"
 -            input="${device.list}"
 -            regexp="^\d{4}"
 -            select="\0"
 -            override="true" />
 -        <property name="device.bin" value="${device}.bat" />
 -
 -        <condition
 -            property="simulator.bin" 
 -            value="${sim.bin}"
 -            else="${device.bin}">
 -                <available file="${simulator.dir}/${sim.bin}" />
 -        </condition>
 -        
 -        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
 -
 -        <!-- Close running simulators -->
 -        <echo message="Closing all running simulators..." />
 -        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
 -            <arg value="/execute=kill" />
 -        </exec>
 -
 -        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
 -             Otherwise, use bbwp MDS directory. -->
 -        <condition 
 -            property="mds.dir" 
 -            value="${properties.blackberry.mds.dir}" 
 -            else="${properties.blackberry.bbwp.dir}/mds">
 -                <available file="${properties.blackberry.mds.dir}" type="dir" />
 -        </condition>
 -        <echo message="MDS directory=${mds.dir}" />
 -        
 -        <copy todir="${simulator.dir}">
 -            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
 -        </copy>
 -        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
 -        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
 -
 -        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
 -             WebWorks SDK do not include it. -->
 -        <if>
 -            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
 -            <then>
 -                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
 -            </then>
 -        </if>
 -    </target>
 -    
 -    <!-- PACKAGE-APP -->
 -    
 -    <target name="package-app" depends="generate-cod-name, clean">
 -        <!-- Copy the WebWorks application -->
 -        <mkdir dir="${widget.dir}" />
 -        <copy todir="${widget.dir}" overwrite="true">
 -            <fileset dir="www" excludes="ext-air/**,playbook/**"/>
 -        </copy>
 -        
 -        <!-- Package the WebWorks app by zipping the widget dir. -->
 -        <mkdir dir="${build.dir}" />
 -        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
 -    </target>
 -    
 -    <!-- BUILD -->
 -
 -    <target name="build" depends="package-app">
 -        <bbwp code-sign="${code.sign}" />
 -    </target>
 -
 -    <!-- BBWP MACRO -->
 -
 -    <macrodef name="bbwp">
 -        <attribute name="code-sign" default="false" />
 -        <sequential>
 -
 -            <!-- Ensure bbwp executable exists. -->
 -            <property name="properties.blackberry.bbwp.bin" location="${properties.blackberry.bbwp.dir}/bbwp.exe" />
 -            <available file="${properties.blackberry.bbwp.bin}" property="properties.blackberry.bbwp.exists" />
 -            <fail unless="properties.blackberry.bbwp.exists" message="Cannot find ${properties.blackberry.bbwp.bin}. Please edit 'bbwp.dir' in your 'project.properties' file." />
 -
 -            <if>
 -                <equals arg1="@{code-sign}" arg2="true" />
 -                <then>
 -                    <exec executable="${properties.blackberry.bbwp.bin}">
 -                        <arg file="${build.dir}/${cod.name}.zip" />
 -                        <arg value="/g" />
 -                        <arg value="${properties.blackberry.sigtool.password}" />
 -                        <arg value="/o" />
 -                        <arg file="${build.dir}" />
 -                    </exec>
 -                </then>
 -                <else>
 -                    <exec executable="${properties.blackberry.bbwp.bin}">
 -                        <arg file="${build.dir}/${cod.name}.zip" />
 -                        <arg value="/o" />
 -                        <arg file="${build.dir}" />
 -                    </exec>
 -                </else>
 -            </if>
 -        </sequential>
 -    </macrodef>
 -
 -    <!-- CLEAN -->
 -    
 -    <target name="clean">
 -        <delete dir="${build.dir}" />
 -        <delete dir="${widget.dir}" />
 -    </target>
 -    
 -    <!-- CLEAN DEVICE -->
 -    
 -    <target name="clean-device" depends="generate-cod-name">
 -        <exec executable="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe">
 -            <arg value="-usb" />
 -            <arg value="erase" />
 -            <arg value="-f" />
 -            <arg value="${cod.name}.cod" />
 -        </exec>
 -    </target>
 -    
 -    <!-- CLEAN SIMULATOR -->
 -    
 -    <target name="clean-simulator">
 -        <!-- Find the simulator directory -->
 -        <set-simulator-dir />
 -        
 -        <exec executable="${simulator.dir}/clean.bat" dir="${simulator.dir}" />
 -        
 -        <delete>
 -            <fileset dir="${simulator.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar" />
 -        </delete>
 -    </target>
 -    
 -        <!-- HELPER TASKS -->
 -    
 -    <target name="generate-cod-name">
 -        <xmlproperty file="www/config.xml" prefix="config.xml" />
 -        <propertyregex property="cod.name"
 -                       input="${config.xml.widget.name}"
 -                       regexp="(\W+)"
 -                       replace=""
 -                       casesensitive="false"
 -                       global="true"
 -                       defaultValue="${config.xml.widget.name}" />        
 -        <echo message="Generated name: ${cod.name}.cod" />
 -    </target>
 -    
 -        <!-- MACRO: SET SIMULATOR DIRECTORY -->
 -    
 -    <macrodef name="set-simulator-dir">
 -        <sequential>
 -            <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
 -            <path id="bbwp.sim.path">
 -                <first>
 -                    <fileset dir="${properties.bbwp.dir}/simpack">
 -                        <include name="**/handhelds.manifest.txt" />
 -                    </fileset>
 -                </first>
 -            </path>
 -            <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
 -
 -            <!-- Simulator directory: Use sim.dir property if set in project.properties file.
 -                 Otherwise, use bbwp simulator directory. -->
 -            <condition
 -                property="simulator.dir"
 -                value="${properties.sim.dir}"
 -                else="${bbwp.sim.dir}">
 -                    <available file="${properties.sim.dir}" type="dir" />
 -            </condition>
 -            <echo message="Simulator directory=${simulator.dir}" />
 -        </sequential>
 -    </macrodef>
 -	
 -	    <!-- HELP -->
 -    
 -    <target name="help">
 -        <echo>
 -NAME
 -  ${ant.project.name}
 -
 -SYNOPSIS
 -  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
 -
 -DESCRIPTION
 -  You can build and deploy your project to a device or simulator.
 -  
 -TARGETS
 -  blackberry ........ Builds a cod file and deploys to a device or simulator
 - 
 -  playbook .......... Builds a bar file and deploys to a device or simulator
 -
 -COMMANDS
 -  help .............. Show this help menu.
 -                        ant, ant help
 -
 -  load-device ....... Builds and deploys project to a connected USB device.
 -                        ant load-device
 -
 -  load-simulator .... Builds and deploys project to default simulator.
 -                        ant load-simulator
 -
 -  build ............. Compiles and packages the project for deployment.
 -                        ant build
 -                                              
 -  clean ............. Remove all files from the build/ directory.
 -                        ant clean
 -
 -  clean-device ...... Remove this project from the connected USB device.
 -                        ant clean-device
 -
 -  clean-simulator ... Remove this project from the simulator (takes a while).
 -                        ant clean-simulator
 -
 -GETTING STARTED
 -  1. Edit project.properties
 -
 -  2. &lt;ant load-simulator&gt; to run the project on the simulator
 -
 -  3. Customize your project by editing www/config.xml
 -
 -  4. To run the project on a BlackBerry device, you will need to obtain
 -     code signing keys from RIM. Once you have the key, a project is
 -     installed by connecting a BlackBerry via USB and running
 -     &lt;ant load-device&gt;.
 -        </echo>
 -    </target>
 -    
++<project default="help">
++    
++        <!-- LOAD PROPERTIES -->
++    
++    <property prefix="properties" file="project.properties" />
++    <property name="build.dir"    location="build" />
++    <property name="widget.dir"   location="${build.dir}/widget" />
++    <property name="code.sign"    value="false" />
++    <property name="generate.ext"   value="cod" />
++    
++    
++    <!-- BlackBerry WebWorks Packager directory is required. -->
++    <fail unless="properties.blackberry.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'bbwp.dir' in your 'project.properties' file." />
++
++    <!-- LOAD DEVICE -->
++    
++    <target name="load-device" depends="package-app">
++        <bbwp code-sign="true" />
++        <exec executable="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe" dir="." failonerror="true">
++            <arg value="-u" />
++			<arg value="-w${properties.blackberry.sim.password}" />
++            <arg value="load" />			
++            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />			
++        </exec>
++    </target>
++    
++    <!-- LOAD SIMULATOR -->
++    
++    <target name="load-simulator" depends="build">
++    
++        <!-- Find the simulator directory -->
++        <set-simulator-dir />
++
++        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
++        <path id="bbwp.sim.path">
++            <first>
++                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
++                    <include name="**/handhelds.manifest.txt" />
++                </fileset>
++            </first>
++        </path>
++        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
++
++        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
++             Otherwise, use bbwp simulator directory. -->
++        <condition 
++            property="simulator.dir" 
++            value="${properties.blackberry.sim.dir}" 
++            else="${bbwp.sim.dir}">
++                <available file="${properties.blackberry.sim.dir}" type="dir" />
++        </condition>
++        <echo message="Simulator directory=${simulator.dir}" />
++
++        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
++             or try setting to 'defaultSimulator.bat' in simulator directory. -->
++        <condition 
++            property="sim.bin" 
++            value="${properties.blackberry.sim.bin}" 
++            else="defaultSimulator.bat">
++                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
++        </condition>
++
++        <!-- If simulator executable does not exist, use the first device listed 
++             in the 'handhelds.manifest.txt' file in the simulator directory. -->
++        <loadfile 
++            property="device.list"
++            srcFile="${simulator.dir}/handhelds.manifest.txt">
++            <filterchain>
++                <tokenFilter>
++                    <stringtokenizer/>
++                </tokenFilter>
++            </filterchain>
++        </loadfile>
++
++        <propertyregex property="device"
++            input="${device.list}"
++            regexp="^\d{4}"
++            select="\0"
++            override="true" />
++        <property name="device.bin" value="${device}.bat" />
++
++        <condition
++            property="simulator.bin" 
++            value="${sim.bin}"
++            else="${device.bin}">
++                <available file="${simulator.dir}/${sim.bin}" />
++        </condition>
++        
++        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
++
++        <!-- Close running simulators -->
++        <echo message="Closing all running simulators..." />
++        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
++            <arg value="/execute=kill" />
++        </exec>
++
++        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
++             Otherwise, use bbwp MDS directory. -->
++        <condition 
++            property="mds.dir" 
++            value="${properties.blackberry.mds.dir}" 
++            else="${properties.blackberry.bbwp.dir}/mds">
++                <available file="${properties.blackberry.mds.dir}" type="dir" />
++        </condition>
++        <echo message="MDS directory=${mds.dir}" />
++        
++        <copy todir="${simulator.dir}">
++            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
++        </copy>
++        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
++        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
++
++        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
++             WebWorks SDK do not include it. -->
++        <if>
++            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
++            <then>
++                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
++            </then>
++        </if>
++    </target>
++    
++    <!-- PACKAGE-APP -->
++    
++    <target name="package-app" depends="generate-cod-name, clean">
++        <!-- Copy the WebWorks application -->
++        <mkdir dir="${widget.dir}" />
++        <copy todir="${widget.dir}" overwrite="true">
++            <fileset dir="www" excludes="ext-air/**,playbook/**"/>
++        </copy>
++        
++        <!-- Package the WebWorks app by zipping the widget dir. -->
++        <mkdir dir="${build.dir}" />
++        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
++    </target>
++    
++    <!-- BUILD -->
++
++    <target name="build" depends="package-app">
++        <bbwp code-sign="${code.sign}" />
++    </target>
++
++    <!-- BBWP MACRO -->
++
++    <macrodef name="bbwp">
++        <attribute name="code-sign" default="false" />
++        <sequential>
++
++            <!-- Ensure bbwp executable exists. -->
++            <property name="properties.blackberry.bbwp.bin" location="${properties.blackberry.bbwp.dir}/bbwp.exe" />
++            <available file="${properties.blackberry.bbwp.bin}" property="properties.blackberry.bbwp.exists" />
++            <fail unless="properties.blackberry.bbwp.exists" message="Cannot find ${properties.blackberry.bbwp.bin}. Please edit 'bbwp.dir' in your 'project.properties' file." />
++
++            <if>
++                <equals arg1="@{code-sign}" arg2="true" />
++                <then>
++                    <exec executable="${properties.blackberry.bbwp.bin}">
++                        <arg file="${build.dir}/${cod.name}.zip" />
++                        <arg value="/g" />
++                        <arg value="${properties.blackberry.sigtool.password}" />
++                        <arg value="/o" />
++                        <arg file="${build.dir}" />
++                    </exec>
++                </then>
++                <else>
++                    <exec executable="${properties.blackberry.bbwp.bin}">
++                        <arg file="${build.dir}/${cod.name}.zip" />
++                        <arg value="/o" />
++                        <arg file="${build.dir}" />
++                    </exec>
++                </else>
++            </if>
++        </sequential>
++    </macrodef>
++
++    <!-- CLEAN -->
++    
++    <target name="clean">
++        <delete dir="${build.dir}" />
++        <delete dir="${widget.dir}" />
++    </target>
++    
++    <!-- CLEAN DEVICE -->
++    
++    <target name="clean-device" depends="generate-cod-name">
++        <exec executable="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe">
++            <arg value="-usb" />
++            <arg value="erase" />
++            <arg value="-f" />
++            <arg value="${cod.name}.cod" />
++        </exec>
++    </target>
++    
++    <!-- CLEAN SIMULATOR -->
++    
++    <target name="clean-simulator">
++        <!-- Find the simulator directory -->
++        <set-simulator-dir />
++        
++        <exec executable="${simulator.dir}/clean.bat" dir="${simulator.dir}" />
++        
++        <delete>
++            <fileset dir="${simulator.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar" />
++        </delete>
++    </target>
++    
++        <!-- HELPER TASKS -->
++    
++    <target name="generate-cod-name">
++        <xmlproperty file="www/config.xml" prefix="config.xml" />
++        <propertyregex property="cod.name"
++                       input="${config.xml.widget.name}"
++                       regexp="(\W+)"
++                       replace=""
++                       casesensitive="false"
++                       global="true"
++                       defaultValue="${config.xml.widget.name}" />        
++        <echo message="Generated name: ${cod.name}.cod" />
++    </target>
++    
++        <!-- MACRO: SET SIMULATOR DIRECTORY -->
++    
++    <macrodef name="set-simulator-dir">
++        <sequential>
++            <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
++            <path id="bbwp.sim.path">
++                <first>
++                    <fileset dir="${properties.bbwp.dir}/simpack">
++                        <include name="**/handhelds.manifest.txt" />
++                    </fileset>
++                </first>
++            </path>
++            <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
++
++            <!-- Simulator directory: Use sim.dir property if set in project.properties file.
++                 Otherwise, use bbwp simulator directory. -->
++            <condition
++                property="simulator.dir"
++                value="${properties.sim.dir}"
++                else="${bbwp.sim.dir}">
++                    <available file="${properties.sim.dir}" type="dir" />
++            </condition>
++            <echo message="Simulator directory=${simulator.dir}" />
++        </sequential>
++    </macrodef>
++	
++	    <!-- HELP -->
++    
++    <target name="help">
++        <echo>
++NAME
++  ${ant.project.name}
++
++SYNOPSIS
++  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
++
++DESCRIPTION
++  You can build and deploy your project to a device or simulator.
++  
++TARGETS
++  blackberry ........ Builds a cod file and deploys to a device or simulator
++ 
++  playbook .......... Builds a bar file and deploys to a device or simulator
++
++COMMANDS
++  help .............. Show this help menu.
++                        ant, ant help
++
++  load-device ....... Builds and deploys project to a connected USB device.
++                        ant load-device
++
++  load-simulator .... Builds and deploys project to default simulator.
++                        ant load-simulator
++
++  build ............. Compiles and packages the project for deployment.
++                        ant build
++                                              
++  clean ............. Remove all files from the build/ directory.
++                        ant clean
++
++  clean-device ...... Remove this project from the connected USB device.
++                        ant clean-device
++
++  clean-simulator ... Remove this project from the simulator (takes a while).
++                        ant clean-simulator
++
++GETTING STARTED
++  1. Edit project.properties
++
++  2. &lt;ant load-simulator&gt; to run the project on the simulator
++
++  3. Customize your project by editing www/config.xml
++
++  4. To run the project on a BlackBerry device, you will need to obtain
++     code signing keys from RIM. Once you have the key, a project is
++     installed by connecting a BlackBerry via USB and running
++     &lt;ant load-device&gt;.
++        </echo>
++    </target>
++    
+ </project>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/19c0e686/template/project/build.xml
----------------------------------------------------------------------
diff --cc template/project/build.xml
index 61bfe34,180a090..bfaab4d
--- a/template/project/build.xml
+++ b/template/project/build.xml
@@@ -1,290 -1,117 +1,117 @@@
- <project name="Build and Deploy a PhoneGap BlackBerry WebWorks Project" default="help">
 -<project name="Build and Deploy a PhoneGap BlackBerry WebWorks Project" default="help">
 -    
 -    <!-- LOAD ANT-CONTRIB LIBRARY -->
 -    
 -    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
 -      <classpath>
 -        <pathelement location="./lib/ant-contrib/ant-contrib-1.0b3.jar" />
 -      </classpath>
 -    </taskdef>
 -
 -    <!-- LOAD PROPERTIES -->
 -    
 -    <property prefix="properties" file="project.properties" />
 -    <property name="build.dir"    location="build" />
 -    <property name="widget.dir"   location="${build.dir}/widget" />
 -    <property name="code.sign"    value="false" />
 -        
 -    <target name="blackberry" >
 -        <property name="subant.file"  value="blackberry.xml" />
 -    </target>
 -    
 -    <target name="playbook" >
 -        <property name="subant.file"  value="playbook.xml" />
 -    </target>
 -    
 -    <target name="load-device">
 -        <subant target="load-device">
 -            <fileset dir="." includes="${subant.file}"/>
 -        </subant>
 -    </target>
 -    
 -    <target name="load-simulator">
 -        <subant target="load-simulator">
 -            <fileset dir="." includes="${subant.file}"/>
 -        </subant>
 -    </target>
 -    
 -    <target name="build">
 -        <subant target="build">
 -            <fileset dir="." includes="${subant.file}"/>
 -        </subant>
 -    </target>
 -
 -    <target name="clean">
 -        <subant target="clean">
 -            <fileset dir="." includes="${subant.file}"/>
 -        </subant>
 -    </target>
 -    
 -    <target name="clean-device">
 -        <subant target="clean-device">
 -            <fileset dir="." includes="${subant.file}"/>
 -        </subant>
 -    </target>
 -    
 -    <target name="clean-simulator">
 -        <subant target="clean-simulator">
 -            <fileset dir="." includes="${subant.file}"/>
 -        </subant>
 -    </target>
 -    
 -    <!-- HELP -->
 -    
 -    <target name="help">
 -        <echo>
 -NAME
 -  ${ant.project.name}
 -
 -SYNOPSIS
 -  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
 -
 -DESCRIPTION
 -  You can build and deploy your project to a device or simulator.
 -  
 -TARGETS
 -  blackberry ........ Builds a cod file and deploys to a device or simulator
 - 
 -  playbook .......... Builds a bar file and deploys to a device or simulator
 -
 -COMMANDS
 -  help .............. Show this help menu.
 -                        ant, ant help
 -
 -  load-device ....... Builds and deploys project to a connected USB device.
 -                        ant load-device
 -
 -  load-simulator .... Builds and deploys project to default simulator.
 -                        ant load-simulator
 -
 -  build ............. Compiles and packages the project for deployment.
 -                        ant build
 -                                              
 -  clean ............. Remove all files from the build/ directory.
 -                        ant clean
 -
 -  clean-device ...... Remove this project from the connected USB device.
 -                        ant clean-device
 -
 -  clean-simulator ... Remove this project from the simulator (takes a while).
 -                        ant clean-simulator
 -
 -GETTING STARTED
 -  1. Edit project.properties
 -
 -  2. &lt;ant load-simulator&gt; to run the project on the simulator
 -
 -  3. Customize your project by editing www/config.xml
 -
 -  4. To run the project on a BlackBerry device, you will need to obtain
 -     code signing keys from RIM. Once you have the key, a project is
 -     installed by connecting a BlackBerry via USB and running
 -     &lt;ant load-device&gt;.
 -        </echo>
 -    </target>
 -    
 -    
 -</project>
++<project name="Build and Deploy a PhoneGap BlackBerry WebWorks Project" default="help">
 +    
 +    <!-- LOAD ANT-CONTRIB LIBRARY -->
 +    
 +    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
 +      <classpath>
 +        <pathelement location="./lib/ant-contrib/ant-contrib-1.0b3.jar" />
 +      </classpath>
 +    </taskdef>
 +
 +    <!-- LOAD PROPERTIES -->
 +    
 +    <property prefix="properties" file="project.properties" />
 +    <property name="build.dir"    location="build" />
 +    <property name="widget.dir"   location="${build.dir}/widget" />
 +    <property name="code.sign"    value="false" />
- 
-     <!-- BlackBerry WebWorks Packager directory is required. -->
-     <fail unless="properties.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'bbwp.dir' in your 'project.properties' file." />
- 
-     <!-- LOAD DEVICE -->
-     
-     <target name="load-device" depends="package-app">
-         <bbwp code-sign="true" />
-         <exec executable="${properties.bbwp.dir}/bin/JavaLoader.exe" dir="." failonerror="true">
-             <arg value="-u" />
-             <arg value="load" />
-             <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
-         </exec>
++        
++    <target name="blackberry" >
++        <property name="subant.file"  value="blackberry.xml" />
 +    </target>
 +    
-     <!-- LOAD SIMULATOR -->
-     
-     <target name="load-simulator" depends="build">
-         <!-- Find the simulator directory -->
-         <set-simulator-dir />
- 
-         <!-- Simulator binary: Use sim.bin property if set in project.properties file  
-              or try setting to 'defaultSimulator.bat' in simulator directory. -->
-         <condition 
-             property="sim.bin" 
-             value="${properties.sim.bin}" 
-             else="defaultSimulator.bat">
-                 <available file="${simulator.dir}/${properties.sim.bin}"/>
-         </condition>
- 
-         <!-- If simulator executable does not exist, use the first device listed 
-              in the 'handhelds.manifest.txt' file in the simulator directory. -->
-         <loadfile 
-             property="device.list"
-             srcFile="${simulator.dir}/handhelds.manifest.txt">
-             <filterchain>
-                 <tokenFilter>
-                     <stringtokenizer/>
-                 </tokenFilter>
-             </filterchain>
-         </loadfile>
- 
-         <propertyregex property="device"
-             input="${device.list}"
-             regexp="^\d{4}"
-             select="\0"
-             override="true" />
-         <property name="device.bin" value="${device}.bat" />
- 
-         <condition
-             property="simulator.bin" 
-             value="${sim.bin}"
-             else="${device.bin}">
-                 <available file="${simulator.dir}/${sim.bin}" />
-         </condition>
-         
-         <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
- 
-         <!-- Close running simulators -->
-         <echo message="Closing all running simulators..." />
-         <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
-             <arg value="/execute=kill" />
-         </exec>
- 
-         <!-- MDS directory: Use mds.dir property if set in project.properties file. 
-              Otherwise, use bbwp MDS directory. -->
-         <condition 
-             property="mds.dir" 
-             value="${properties.mds.dir}" 
-             else="${properties.bbwp.dir}/mds">
-                 <available file="${properties.mds.dir}" type="dir" />
-         </condition>
-         <echo message="MDS directory=${mds.dir}" />
-         
-         <copy todir="${simulator.dir}">
-             <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
-         </copy>
-         <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
-         <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
- 
-         <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
-              WebWorks SDK do not include it. -->
-         <if>
-             <available file="${properties.bbwp.dir}/FledgeHook.exe" />
-             <then>
-                 <exec executable="${properties.bbwp.dir}/FledgeHook.exe" dir="${properties.bbwp.dir}" spawn="true" />
-             </then>
-         </if>
++    <target name="playbook" >
++        <property name="subant.file"  value="playbook.xml" />
 +    </target>
 +    
-     <!-- PACKAGE-APP -->
++    <target name="load-device">
++        <subant target="load-device">
++            <fileset dir="." includes="${subant.file}"/>
++        </subant>
++    </target>
 +    
-     <target name="package-app" depends="generate-cod-name, clean">
-         <!-- Copy the WebWorks application -->
-         <mkdir dir="${widget.dir}" />
-         <copy todir="${widget.dir}" overwrite="true">
-             <fileset dir="www" />
-         </copy>
-         
-         <!-- Package the WebWorks app by zipping the widget dir. -->
-         <mkdir dir="${build.dir}" />
-         <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
++    <target name="load-simulator">
++        <subant target="load-simulator">
++            <fileset dir="." includes="${subant.file}"/>
++        </subant>
 +    </target>
 +    
-     <!-- BUILD -->
- 
-     <target name="build" depends="package-app">
-         <bbwp code-sign="${code.sign}" />
++    <target name="build">
++        <subant target="build">
++            <fileset dir="." includes="${subant.file}"/>
++        </subant>
 +    </target>
 +
-     <!-- BBWP MACRO -->
- 
-     <macrodef name="bbwp">
-         <attribute name="code-sign" default="false" />
-         <sequential>
- 
-             <!-- Ensure bbwp executable exists. -->
-             <property name="properties.bbwp.bin" location="${properties.bbwp.dir}/bbwp.exe" />
-             <available file="${properties.bbwp.bin}" property="properties.bbwp.exists" />
-             <fail unless="properties.bbwp.exists" message="Cannot find ${properties.bbwp.bin}. Please edit 'bbwp.dir' in your 'project.properties' file." />
- 
-             <if>
-                 <equals arg1="@{code-sign}" arg2="true" />
-                 <then>
-                     <exec executable="${properties.bbwp.bin}">
-                         <arg file="${build.dir}/${cod.name}.zip" />
-                         <arg value="/g" />
-                         <arg value="${properties.sigtool.password}" />
-                         <arg value="/o" />
-                         <arg file="${build.dir}" />
-                     </exec>
-                 </then>
-                 <else>
-                     <exec executable="${properties.bbwp.bin}">
-                         <arg file="${build.dir}/${cod.name}.zip" />
-                         <arg value="/o" />
-                         <arg file="${build.dir}" />
-                     </exec>
-                 </else>
-             </if>
-         </sequential>
-     </macrodef>
- 
-     <!-- CLEAN -->
-     
 +    <target name="clean">
-         <delete dir="${build.dir}" />
-         <delete dir="${widget.dir}" />
++        <subant target="clean">
++            <fileset dir="." includes="${subant.file}"/>
++        </subant>
 +    </target>
 +    
-     <!-- CLEAN DEVICE -->
-     
-     <target name="clean-device" depends="generate-cod-name">
-         <exec executable="${properties.bbwp.dir}/bin/JavaLoader.exe">
-             <arg value="-usb" />
-             <arg value="erase" />
-             <arg value="-f" />
-             <arg value="${cod.name}.cod" />
-         </exec>
++    <target name="clean-device">
++        <subant target="clean-device">
++            <fileset dir="." includes="${subant.file}"/>
++        </subant>
 +    </target>
 +    
-     <!-- CLEAN SIMULATOR -->
-     
 +    <target name="clean-simulator">
-         <!-- Find the simulator directory -->
-         <set-simulator-dir />
-         
-         <exec executable="${simulator.dir}/clean.bat" dir="${simulator.dir}" />
-         
-         <delete>
-             <fileset dir="${simulator.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar" />
-         </delete>
++        <subant target="clean-simulator">
++            <fileset dir="." includes="${subant.file}"/>
++        </subant>
 +    </target>
 +    
 +    <!-- HELP -->
 +    
 +    <target name="help">
 +        <echo>
 +NAME
 +  ${ant.project.name}
 +
 +SYNOPSIS
-   ant COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
++  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
 +
 +DESCRIPTION
 +  You can build and deploy your project to a device or simulator.
++  
++TARGETS
++  blackberry ........ Builds a cod file and deploys to a device or simulator
++ 
++  playbook .......... Builds a bar file and deploys to a device or simulator
 +
 +COMMANDS
 +  help .............. Show this help menu.
 +                        ant, ant help
 +
 +  load-device ....... Builds and deploys project to a connected USB device.
 +                        ant load-device
 +
 +  load-simulator .... Builds and deploys project to default simulator.
 +                        ant load-simulator
 +
 +  build ............. Compiles and packages the project for deployment.
 +                        ant build
 +                                              
 +  clean ............. Remove all files from the build/ directory.
 +                        ant clean
 +
 +  clean-device ...... Remove this project from the connected USB device.
 +                        ant clean-device
 +
 +  clean-simulator ... Remove this project from the simulator (takes a while).
 +                        ant clean-simulator
 +
 +GETTING STARTED
 +  1. Edit project.properties
 +
 +  2. &lt;ant load-simulator&gt; to run the project on the simulator
 +
 +  3. Customize your project by editing www/config.xml
 +
 +  4. To run the project on a BlackBerry device, you will need to obtain
 +     code signing keys from RIM. Once you have the key, a project is
 +     installed by connecting a BlackBerry via USB and running
 +     &lt;ant load-device&gt;.
 +        </echo>
 +    </target>
 +    
-     <!-- HELPER TASKS -->
-     
-     <target name="generate-cod-name">
-         <xmlproperty file="www/config.xml" prefix="config.xml" />
-         <propertyregex property="replaced.name"
-                        input="${config.xml.widget.name}"
-                        regexp="([\W_]+)"
-                        replace=""
-                        casesensitive="false"
-                        global="true"
-                        defaultValue="${config.xml.widget.name}" />
-         <if>
-             <length string="${replaced.name}" length="0" />
-             <then>
-                 <property name="cod.name" value="PhoneGapApplication" />
-             </then>
-             <else>
-                 <property name="cod.name" value="${replaced.name}" />
-             </else>
-         </if>
-         
-         <echo message="Generated name: ${cod.name}.cod" />
-     </target>
-     
-     <!-- MACRO: SET SIMULATOR DIRECTORY -->
-     
-     <macrodef name="set-simulator-dir">
-         <sequential>
-             <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-             <path id="bbwp.sim.path">
-                 <first>
-                     <fileset dir="${properties.bbwp.dir}/simpack">
-                         <include name="**/handhelds.manifest.txt" />
-                     </fileset>
-                 </first>
-             </path>
-             <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
- 
-             <!-- Simulator directory: Use sim.dir property if set in project.properties file.
-                  Otherwise, use bbwp simulator directory. -->
-             <condition
-                 property="simulator.dir"
-                 value="${properties.sim.dir}"
-                 else="${bbwp.sim.dir}">
-                     <available file="${properties.sim.dir}" type="dir" />
-             </condition>
-             <echo message="Simulator directory=${simulator.dir}" />
-         </sequential>
-     </macrodef>
 +    
 +</project>


Mime
View raw message