#BlackBerry 10 Cordova Plugins This repo contains plugins for Apache Cordova that expose functionality of the BlackBerry 10 platform.
##Using Cordova BlackBerry Plugins ###Prerequisites
- Install WebWorks
###Adding project plugins
cd
projectwebworks plugin add
plugin_name
###Updating project plugins To update a plugin, run:
webworks plugin remove
plugin_namewebworks plugin add
plugin_name
###Using custom built plugins
webworks plugin add
plugin_name--searchpath
path_to_custom_plugin_directory
##Maintaining / Creating Plugins ###Build Prerequisites
- Install node and npm and add to path
- Install BlackBerry Native SDK if you need to build JNEXT extensions
- [Windows] Add
git.exe
toPATH
, i.e. Git Installation Directory\bin
- Install [jake] globally (
npm install --global jake
) - Install [jshint] globally (
npm install --global jshint
)
###Setup and Build
git clone https://github.com/blackberry/cordova-blackberry-plugins/
cd cordova-blackberry-plugins
git fetch origin
git checkout master
npm install
to install dependencies- Setup bbndk environment variables: (must be done within each session, prior to
jake
)- [Mac/Linux]
source
BBNDK installation directory/bbndk-env.sh
- [Windows] BBNDK installation directory
\bbndk-env.bat
- [Mac/Linux]
jake build
- check that there are no errors
###Running Tests
jake test
- to run js tests using nodejsjake hint
- to run jshint on the JavaScript sourcejake
- default is to build, run tests and jshint
Note: To see a full list of commands available with jake, use jake -T
.
###Dependencies
cpplint
is used for linting C++ code. Source code is located underdependencies/cpplint
- JNEXT 1.0.8.3 is used to build extensions
Original source of JNEXT
Modifications are available in source code and located under
dependencies/jnext_1_0_8_3
- Bryan Higgins
- Chris Del Col
- Daniel Audino
- Danyi Lin
- Derek Watson
- Edwin Feener
- Eric Li
- Eric Pearson
- Erik Johnson
- Gord Tanner
- Hasan Ahmad
- Hoyoung Jang
- Igor Shneur
- James Keshavarzi
- Jeffrey Heifetz
- Jenny Gee
- Josh Soref
- Kristoffer Flores
- Nukul Bhasin
- Rosa Tse
- Rowell Cruz
- Sergey Golod
- Stephan Leroux
- Tracy Li
- client.js – The extension's public API
- index.js – Loaded by Cordova and only accessible across the
cordova.exec
bridge - manifest.json – Metadata for the extension
- native – Contains all the native code for the JNEXT extension
- test
- integration – test app spec using Jasmine browser tests
- unit – unit tests using jasmine. Keeps the same folder structure as the code
Extensions are all under the plugin/
folder. An extension must at least contain the following:
- manifest.json – metadata for the extension
- client.js – Front facing API, this is injected into the App's content
- index.js – Controller loads this part of the API
If your extension requires native C/C++ code, a native JNEXT extension is needed. There is a sample and there are detailed docs.
To contribute code to this repository you must be signed up as an official contributor.
- Fork the cordova-blackberry-plugins repository
- Make the changes/additions to your fork
- Send a pull request from your fork back to the cordova-blackberry-plugins repository
- If you made changes to code which you own, mention a committer listed below to have your code merged using
@user
notation.