Skip to content
Permalink
Browse files
stashing my changes
  • Loading branch information
AxelNennker committed Feb 21, 2014
2 parents 98c9c5e + 828f18d commit ad2b3a7c90f07c5a5e701114aa8271f99d648fea
Show file tree
Hide file tree
Showing 45 changed files with 1,733 additions and 750 deletions.
@@ -0,0 +1 @@
spec
@@ -29,6 +29,7 @@ You must have `git` on your PATH to be able to install plugins directly from rem
* Android
* BlackBerry 10
* Windows Phone (7+8)
* Windows 8

## Command Line Usage
plugman help
@@ -74,7 +75,9 @@ This section details how to consume Plugman as a node module and is only for Cor
publish: [Function: publish],
unpublish: [Function: unpublish],
adduser: [Function: adduser],
prepare: [Function: handlePrepare] }
prepare: [Function: handlePrepare],
create: [Function: create],
platform: [Function: platform] }
### `install` method

@@ -164,6 +167,30 @@ Configures registry settings. `params` is an array that describes the action
* module.exports = function(params, callback) {
*/

## Create plugin related actions

### `create` method

Creates basic scaffolding for a new plugin

module.exports = function create( name, id, version, pluginPath, options, callback ) {...}

* `name` : a name for the plugin
* `id` : an id for the plugin
* `version` : a version for the plugin
* `pluginPath` : a path to create the plugin in
* `options` : an array of options
* `callback` : callback to invoke once complete. If specified, will pass in an error object as a first parameter if the action failed. If not and an error occurs, `plugman` will throw the error

### `platform` method

Add/Remove a platform from a newly created plugin

module.exports = function platform( { operation: operation, platform_name: cli_opts.platform_name } );

* `operation` : "add or remove"
* `platform_name` : ios, android

## Example Plugins

- Google has a [bunch of plugins](https://github.com/MobileChromeApps/chrome-cordova/tree/master/plugins) which are maintained actively by a contributor to plugman
@@ -1,4 +1,37 @@
# Changelog
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova-plugman Release Notes

## 0.19.0 (Jan 30, 2014)
* CB-5804 Added repo & issue information into `plugman publish`
* CB-5299 Cache pbxproj to avoid re-parsing it for each plugin.
* Update node-xcode dependency to 0.6.6

## 0.18.0 (Jan 15, 2014)
* CB-5770 plugman prepare.js script content wrapping no longer allows ending parens/braces to be commented out from end of line comment
* CB-4871 Reduced package size significantly.
* CB-5720 Allow <resource-file> on Android
* CB-5006 Add --searchpath option for local plugin search path
* CB-5701 Reference custom frameworks using relative paths
* CB-5495, CB=5568 Fix config.xml path for ios

## 0.17.0 (Dec 11, 2013)
* CB-5579 Add support for --www param for install, uninstall, prepare commands.
@@ -0,0 +1,5 @@
var exec = require('cordova/exec');

exports.coolMethod = function(arg0, success, error) {
exec(success, error, "%pluginName%", "coolMethod", [arg0]);
};
@@ -28,6 +28,8 @@ Optional parameters

- www <directory>: www assets for the plugin will be installed into this directory. Default is to install into the standard www directory for the platform specified
- plugins_dir <directory>: a copy of the plugin will be stored in this directory. Default is to install into the <project directory>/plugins folder
- searchpath <directory>: a directory to look in for a plugin with the provided ID before looking on http://plugins.cordova.io
Use the searchpath flag multiple times to specify several directories (searched in order). The search is not recursive and will only look one level down.

Optional flags
--------------
@@ -78,3 +80,34 @@ Manage owners
$ plugman owner ls org.apache.cordova.core.file
$ plugman owner add username org.apache.cordova.core.file
$ plugman owner rm username org.apache.cordova.core.file

Create A Plugin
---------------

$ plugman create --name <Plugin Name> --plugin_id <Plugin ID> --plugin_version <Plugin Version> [--path <Directory Path>] [--variable NAME=VALUE]

Parameters:

- <Plugin Name>: A Name for a Plugin
- <Plugin ID>: An ID for the plugin, ex: org.bar.foo
- <Plugin Version>: A version for the plugin, ex: 0.0.0
- variable NAME=VALUE: Extra variables such as description or Author

Add a Platform to a Plugin
--------------------------

$ plugman platform add --platform_name <Platform>

Parameters:

- <Platform>: One of android, ios

Remove a Platform from a Plugin
-------------------------------

$ plugman platform remove --platform_name <Platform>

Parameters:

- <Platform>: One of android, ios

@@ -0,0 +1,12 @@
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="%pluginName%">
<param name="android-package" value="%pluginID%.%pluginName%"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/*">
<!--add permissions -->
</config-file>

<source-file src="src/android/%pluginName%.java" target-dir="src/%packageName%/%pluginName%" />
</platform>
@@ -0,0 +1,32 @@
package %pluginID%;

import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
* This class echoes a string called from JavaScript.
*/
public class CDV%pluginName% extends CordovaPlugin {

@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if (action.equals("coolMethod")) {
String message = args.getString(0);
this.coolMethod(message, callbackContext);
return true;
}
return false;
}

private void coolMethod(String message, CallbackContext callbackContext) {
if (message != null && message.length() > 0) {
callbackContext.success(message);
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
}
@@ -0,0 +1,28 @@
/********* CDV%pluginName%.m Cordova Plugin Implementation *******/

#import <Cordova/CDV.h>

@interface CDV%pluginName% : CDVPlugin {
// Member variables go here.
}

- (void)coolMethod:(CDVInvokedUrlCommand*)command;
@end

@implementation CDV%pluginName%

- (void)coolMethod:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* pluginResult = nil;
NSString* echo = [command.arguments objectAtIndex:0];

if (echo != nil && [echo length] > 0) {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];
} else {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
}

[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

@end
@@ -0,0 +1,9 @@
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="%pluginName%">
<param name="ios-package" value="%pluginName%" />
</feature>
</config-file>

<source-file src="src/ios/CDV%pluginName%.m" />
</platform>
@@ -29,7 +29,7 @@ var path = require('path')

var known_opts = { 'platform' : [ 'ios', 'android', 'amazon-fireos', 'blackberry10', 'wp7', 'wp8' , 'windows8', 'firefoxos' ]
, 'project' : path
, 'plugin' : [String, path, url]
, 'plugin' : [String, path, url, Array]
, 'version' : Boolean
, 'help' : Boolean
, 'debug' : Boolean
@@ -38,6 +38,7 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'amazon-fireos', 'blackberry
, 'link': Boolean
, 'variable' : Array
, 'www': path
, 'searchpath' : [path, Array]
}, shortHands = { 'var' : ['--variable'], 'v': ['--version'], 'h': ['--help'] };

var cli_opts = nopt(known_opts, shortHands);
@@ -74,7 +75,7 @@ if (!cli_opts.silent) {
plugman.on('error', console.error);

if (cli_opts.version) {
console.log(package.name + ' version ' + package.version);
console.log(package.version);
} else if (cli_opts.help) {
console.log(plugman.help());
} else if (plugman.commands[cmd]) {
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <alunny@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
"version": "0.17.0",
"version": "0.19.1-dev",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"
@@ -16,28 +16,26 @@
"node": ">=0.9.9"
},
"engineStrict":true,
"//": ["Can remove node-xcode git dependency once pull request is merged:",
"https://github.com/alunny/node-xcode/pull/25"],
"dependencies": {
"nopt": "1.0.x",
"glob": "3.2.x",
"elementtree": "0.1.5",
"xcode": "git+https://github.com/kronenthaler/node-xcode.git",
"plist": "0.4.x",
"xcode": "0.6.6",
"plist-with-patches": "0.5.x",
"bplist-parser": "0.0.x",
"shelljs": "0.1.x",
"osenv": "0.0.x",
"ncallbacks":"1.1.0",
"underscore":"1.4.4",
"dep-graph":"1.1.0",
"semver": "2.0.x",
"q": "~0.9",
"npm": "1.3.4",
"rc": "0.3.0",
"tar.gz": "0.1.1"
"tar": "0.1.x",
"request": "2.22.0"
},
"devDependencies": {
"jasmine-node": "1.7.0"
"jasmine-node": "1.7.0",
"osenv": "0.0.x"
},
"bin" : { "plugman" : "./main.js" },
"scripts": {

0 comments on commit ad2b3a7

Please sign in to comment.