You probably want to go to the plugin itself
This repo contains scripts to build a plugman plugin for use with Cordova / PhoneGap.
You only need to do this if you are working on the LiteGap plugin. If you just want to use the plugin, you shouldn't need to generate it.
This code shows up in the Couchbase buildbot process via this shell script.
The generator works by downloading the latest Couchbase Lite for iOS and Android, and packaging them with the cblite.getURL
PhoneGap plugin API as implemented in the src
directory of this repository.
Here are rough descriptions of the stages:
- Download the plugin dependencies into a directory structure. Automated buildbot scripts might choose to create this directory structure through a different means.
- Create the plugin directory structure by copying files from the dependencies (and renaming a few of them). You can see a snapshot of what this file tree looks like for me by browsing to
tree.txt
in this repository's root. - Copy PhoneGap specific files from this repo's
src
andwww
directories to the plugin directory structure. - Create the plugin.xml manifest based on the files in the plugin directory structure.
The build product is a directory with plugin.xml in it, as well as src
and lib
directories. The plugman tool likes to look for plugins in git repos, so to release a new version of the plugin you'll manually take the generated directory, and check it into the canonical Couchbase Lite Phonegap Plugin repo.
Steps 1, and 2 above are not yet implemented. Steps 3 and 4 lives in prepare_plugin.js
Updating the github release repo
Preparation: Update the version value here: https://github.com/couchbaselabs/couchbase-lite-phonegap-plugin-builder/blob/master/prepare_plugin.js#L1, and then [kick off Jenkins job to get needed plug-in zip] (http://factory.couchbase.com/view/build/view/mobile_dev/job/package_phonegap_plugin/). When there is a release, you need to do this to push it to github:
- Download and uncompress the zip.
- Clone the repo.
- Copy the
.git/
directory from your clone of this repo into the unzipped build. - Vist this repo on the github website and adjust the settings to make a branch other than
master
into the Default Branch. - Delete the master branch from github with
git push origin :master
from inside the unzipped build. - Create a new branch
pendingmaster
withgit checkout -b pendingmaster
- Check all your stuff into it with
git add --all
andgit commit
- Delete your local master with
git branch -D master
- Create a new local master without any history using
git checkout --orphan master
git commit -m "new plugin bundle"
- Publish the new branch with
git push origin master
- Visit this repo on the github website and adjust the settings to make
master
into the Default Branch again.
npm install -g plugman
From inside the package directory:
plugman createpackagejson .
(Change the name to all lowercase)
name: (com.couchbase.lite.phonegap) couchbase-lite-phonegap-plugin
version: (1.1.1)
git repository: (https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin.git)
author: Couchbase
license: (Apache 2.0)
Note: Change "cordova_name" in package.json to "Couchbase Lite Phonegap Plugin".
- Add the following keywords to package.json
"couchbase-lite-ios",
"couchbase-lite-android",
"couchbase mobile",
"couchbase",
npm adduser
npm publish --loglevel verbose .
- Check the result on npmjs.com