Skip to content
Permalink
Browse files
Merge branch 'master' into browserify
  • Loading branch information
Anis Kadri committed Apr 24, 2014
2 parents 93c6578 + 8aca4cb commit 013adc61c852561810994d899692d63b65176c6c
Show file tree
Hide file tree
Showing 49 changed files with 175 additions and 162 deletions.
@@ -39,7 +39,7 @@ You must have `git` on your PATH to be able to install plugins directly from rem


plugman install --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin <name|url|path> [--plugins_dir <directory>] [--www <directory>] [--variable <name>=<value> [--variable <name>=<value> ...]]
plugman uninstall --platform <ios|amazon-fireos|android|blackberr10|wp7|wp8> --project <directory> --plugin <id> [--www <directory>] [--plugins_dir <directory>]
plugman uninstall --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin <id> [--www <directory>] [--plugins_dir <directory>]

* Using minimum parameters, installs a plugin into a cordova project. You must specify a platform and cordova project location for that platform. You also must specify a plugin, with the different `--plugin` parameter forms being:
* `name`: The directory name where the plugin contents exist. This must be an existing directory under the `--plugins_dir` path (see below for more info) or a plugin in the Cordova registry.
@@ -91,7 +91,7 @@ Installs a plugin into a specified cordova project of a specified platform.
* `id`: a string representing the `id` of the plugin, a path to a cordova plugin with a valid `plugin.xml` file, or an `https://` or `git://` url to a git repository of a valid cordova plugin or a plugin published to the Cordova registry
* `plugins_dir`: path to directory where plugins will be stored, defaults to `<project_dir>/cordova/plugins`
* `subdir`: subdirectory within the plugin directory to consider as plugin directory root, defaults to `.`
* `cli_variables`: an object mapping cordova plugin specification variable namess (see [plugin specification](plugin_spec.md)) to values
* `cli_variables`: an object mapping cordova plugin specification variable names (see [plugin specification](plugin_spec.md)) to values
* `www_dir`: path to directory where web assets are to be copied to, defaults to the specified project directory's `www` dir (dependent on platform)
* `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

@@ -106,7 +106,7 @@ Uninstalls a previously-installed cordova plugin from a specified cordova projec
* `id`: a string representing the `id` of the plugin
* `plugins_dir`: path to directory where plugins are stored, defaults to `<project_dir>/cordova/plugins`
* `subdir`: subdirectory within the plugin directory to consider as plugin directory root, defaults to `.`
* `cli_variables`: an object mapping cordova plugin specification variable namess (see [plugin specification](plugin_spec.md)) to values
* `cli_variables`: an object mapping cordova plugin specification variable names (see [plugin specification](plugin_spec.md)) to values
* `www_dir`: path to directory where web assets are to be copied to, defaults to the specified project directory's `www` dir (dependent on platform)
* `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

@@ -143,7 +143,7 @@ Adds a user account to the registry. Function takes no arguments other than a an

### `publish` method

Publishes plugins to the registry. `plugin_paths` is an array of plugin paths to publish to the reigstry.
Publishes plugins to the registry. `plugin_paths` is an array of plugin paths to publish to the registry.

module.exports = function(plugin_paths, callback) {

@@ -84,7 +84,7 @@
* Overhaul dependency uninstallation
* [CB-4872] - adding in custom semver check for project
* [CB-4872] - updated paths to version files
* Update action-stack to avoid static platform detection + test if parseProjectFile is present instea
* Update action-stack to avoid static platform detection + test if parseProjectFile is present instead
* Update spec to match new ios parse method name
* Update references to old ios parse method
* Rename parse method and add a write method to result + parseIOSProjectFiles --> parseProjectFile +
@@ -102,10 +102,10 @@
* [CB-4837]: Version 0.12.0. Release notes updated.
* Rename CHANGELOG.md -> RELEASENOTES.md
* CB-4492 tracking which of cli or plugman is used to fetch from registry
* removed unncessary console.logs
* removed unnecessary console.logs
* add full ff support to plugman
* add firefoxos
* removed unncessary console.logs
* removed unnecessary console.logs
* add full ff support to plugman
* add firefoxos
* Fix tests broken by lazy module requiring.
@@ -30,7 +30,7 @@ if(opt.debug) {
}

module.exports = common = {
spy: {
spy: {
getInstall: function(emitSpy){
return common.spy.startsWith(emitSpy, 'Install start');
},
@@ -33,7 +33,7 @@ var install = require('../src/install'),
'G' : path.join(plugins_dir, 'dependencies', 'G')
},
promise,
results = {},
results = {},
dummy_id = 'com.phonegap.plugins.dummyplugin';

function installPromise(f) {
@@ -83,7 +83,7 @@ describe('start', function() {
.then(
function(){ return install('android', project, plugins['DummyPlugin']) }
).then(
function(){
function(){
results['actions_callCount'] = actions_push.callCount;
results['actions_create'] = ca.argsForCall[0];
results['config_add'] = config_queue_add.argsForCall[0];
@@ -95,14 +95,14 @@ describe('start', function() {
).then(
function(){
emit = spyOn(events, 'emit');
return install('android', project, plugins['ChildBrowser'])
return install('android', project, plugins['ChildBrowser'])
}
).then(
function(){
return install('android', project, plugins['VariablePlugin'], plugins_install_dir, { cli_variables:{API_KEY:'batman'} })
function(){
return install('android', project, plugins['VariablePlugin'], plugins_install_dir, { cli_variables:{API_KEY:'batman'} })
}
).then(
function(){
function(){
done = true;
results['prepareCount'] = prepare.callCount;
results['emit_results'] = [];
@@ -124,7 +124,7 @@ describe('install', function() {

beforeEach(function() {
prepare = spyOn(plugman, 'prepare').andReturn( Q(true) );

exec = spyOn(child_process, 'exec').andCallFake(function(cmd, cb) {
cb(false, '', '');
});
@@ -353,7 +353,7 @@ describe('install', function() {
waitsFor(function () { return done; }, 'install promise never resolved', 200);
runs(function () {
var install = common.spy.getInstall(emit);

expect(done.message).toEqual('Cyclic dependency from G to H');
});
});
@@ -455,7 +455,7 @@ describe('install', function() {


describe('end', function() {

it('end', function() {
done = false;

@@ -13,13 +13,13 @@ var amazon_fireos = require('../../src/platforms/amazon-fireos'),
dummyplugin = path.join(__dirname, '..', 'plugins', 'DummyPlugin'),
faultyplugin = path.join(__dirname, '..', 'plugins', 'FaultyPlugin'),
variableplugin = path.join(__dirname, '..', 'plugins', 'VariablePlugin'),
amzon_fireos_one_project = path.join(__dirname, '..', 'projects', 'android_one', '*'),
amazon_fireos_one_project = path.join(__dirname, '..', 'projects', 'android_one', '*'),
amazon_fireos_two_project = path.join(__dirname, '..', 'projects', 'android_two', '*');

var xml_path = path.join(dummyplugin, 'plugin.xml')
, xml_text = fs.readFileSync(xml_path, 'utf-8')
, plugin_et = new et.ElementTree(et.XML(xml_text));

var platformTag = plugin_et.find('./platform[@name="amazon-fireos"]');
var dummy_id = plugin_et._root.attrib['id'];

@@ -82,13 +82,13 @@ describe('amazon-fireos project handler', function() {
it('should copy stuff from one location to another by calling common.copyFile', function() {
var source = copyArray(valid_source);
var s = spyOn(common, 'copyFile');
amazon_fireos['source-file'].install(source[0], dummyplugin, temp);
amazon_fireos['source-file'].install(source[0], dummyplugin, temp);
expect(s).toHaveBeenCalledWith(dummyplugin, 'src/amazon-fireos/DummyPlugin.java', temp, path.join('src', 'com', 'phonegap', 'plugins', 'dummyplugin', 'DummyPlugin.java'));
});
it('should throw if source file cannot be found', function() {
var source = copyArray(invalid_source);
expect(function() {
amazon_fireos['source-file'].install(source[0], faultyplugin, temp);
amazon_fireos['source-file'].install(source[0], faultyplugin, temp);
}).toThrow('"' + path.resolve(faultyplugin, 'src/amazon-fireos/NotHere.java') + '" not found!');
});
it('should throw if target file already exists', function() {
@@ -100,7 +100,7 @@ describe('amazon-fireos project handler', function() {
var source = copyArray(valid_source);
expect(function() {
amazon_fireos['source-file'].install(source[0], dummyplugin, temp);
amazon_fireos['source-file'].install(source[0], dummyplugin, temp);
}).toThrow('"' + target + '" already exists!');
});
});
@@ -105,7 +105,7 @@ describe('common platform handler', function() {
shell.rm('-rf', java_dir);
});

it('should delete empty directories after removing source code in a java src path heirarchy', function(){
it('should delete empty directories after removing source code in a java src path hierarchy', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');

@@ -304,17 +304,17 @@ describe('ios project handler', function() {
});
it('should rm the file from the right target location when element has a target-dir', function(){
var source = copyArray(valid_source).filter(function(s) { return s.attrib['target-dir'] != undefined});
shell.cp('-rf', ios_config_xml_project, temp);
shell.cp('-rf', ios_config_xml_project, temp);
var spy = spyOn(shell, 'rm');

ios['source-file'].uninstall(source[0], temp, dummy_id, proj_files);
expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'));
});
it('should call into xcodeproj\'s removeFramework appropriately when element framework=true set', function(){
var source = copyArray(valid_source).filter(function(s) { return s.attrib['framework'] == "true"});
shell.cp('-rf', ios_config_xml_project, temp);
var spy = spyOn(proj_files.xcode, 'removeFramework');

ios['source-file'].uninstall(source[0], temp, dummy_id, proj_files);
expect(spy).toHaveBeenCalledWith(path.join('SampleApp', 'Plugins', dummy_id, 'SourceWithFramework.m'));
});
@@ -89,7 +89,7 @@ describe('windows8 project handler', function() {
it('should copy stuff from one location to another by calling common.copyFile', function() {
var source = copyArray(valid_source);
var s = spyOn(common, 'copyFile');
windows8['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
windows8['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
expect(s).toHaveBeenCalledWith(dummyplugin, 'src/windows8/dummer.js', temp, path.join('www', 'plugins', 'com.phonegap.plugins.dummyplugin', 'dummer.js'));
});
it('should throw if source-file src cannot be found', function() {
@@ -83,7 +83,7 @@ describe('wp7 project handler', function() {
it('should copy stuff from one location to another by calling common.copyFile', function() {
var source = copyArray(valid_source);
var s = spyOn(common, 'copyFile');
wp7['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
wp7['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
expect(s).toHaveBeenCalledWith(dummyplugin, 'src/wp7/DummyPlugin.cs', temp, path.join('Plugins', 'com.phonegap.plugins.dummyplugin', 'DummyPlugin.cs'));
});
it('should throw if source-file src cannot be found', function() {
@@ -88,7 +88,7 @@ describe('wp8 project handler', function() {
it('should copy stuff from one location to another by calling common.copyFile', function() {
var source = copyArray(valid_source);
var s = spyOn(common, 'copyFile');
wp8['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
wp8['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
expect(s).toHaveBeenCalledWith(dummyplugin, 'src/wp8/DummyPlugin.cs', temp, path.join('Plugins', 'com.phonegap.plugins.dummyplugin', 'DummyPlugin.cs'));
});
it('should throw if source-file src cannot be found', function() {
@@ -537,7 +537,7 @@ private string FormatJSONEmails(Contact con)
return retVal.TrimEnd(',');
}

private string getFormattedJSONAddress(ContactAddress address, bool isPrefered)
private string getFormattedJSONAddress(ContactAddress address, bool isPreferred)
{

string addressFormatString = "\"pref\":{0}," + // bool
@@ -557,7 +557,7 @@ private string getFormattedJSONAddress(ContactAddress address, bool isPrefered)
+ address.PhysicalAddress.PostalCode;

string jsonAddress = string.Format(addressFormatString,
isPrefered ? "\"true\"" : "\"false\"",
isPreferred ? "\"true\"" : "\"false\"",
address.Kind.ToString(),
formattedAddress,
address.PhysicalAddress.AddressLine1 + " " + address.PhysicalAddress.AddressLine2,
@@ -127,7 +127,7 @@

<source-file src="src/wp7/FaultyPlugin.cs" />

<!-- this desn't exist -->
<!-- this doesn't exist -->
<source-file src="src/wp7/NotHere.cs" />
</platform>

@@ -141,7 +141,7 @@

<source-file src="src/wp8/FaultyPlugin.cs" />

<!-- this desn't exist -->
<!-- this doesn't exist -->
<source-file src="src/wp8/NotHere.cs" />
</platform>

@@ -10,7 +10,7 @@
//NSString *body = [notification.userInfo objectForKey:@"body"];
NSString *tag = [notification.userInfo objectForKey:@"tag"];

[(WebNotifications*)[self.viewController getCommandInstance:@"WebNotifications"] clickNofification:tag];
[(WebNotifications*)[self.viewController getCommandInstance:@"WebNotifications"] clickNotification:tag];

application.applicationIconBadgeNumber = 0;
application.scheduledLocalNotifications = [NSArray arrayWithArray:application.scheduledLocalNotifications]; // "hack" to clear seen notifications
@@ -30,6 +30,6 @@
- (void)createNotification:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void)closeNotification:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;

- (void)clickNofification:(NSString*)tag;
- (void)clickNotification:(NSString*)tag;

@end
@@ -96,7 +96,7 @@ - (void)closeNotification:(CDVInvokedUrlCommand*)command
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:0] callbackId:command.callbackId];
}

- (void)clickNofification:(NSString*)tag {
- (void)clickNotification:(NSString*)tag {
NSString *jsCallBack;

jsCallBack = [NSString stringWithFormat:@"window.Notification.callOnclickByTag('%@')", tag];
@@ -43,7 +43,7 @@ if (typeof window.Notification == 'undefined') {
this.soundUrl = options.soundUrl || '';
this.badgeNumber = options.badgeNumber || 0;

// there must be one unique notification per tag, so close any existing outstanting notifications
// there must be one unique notification per tag, so close any existing outstanding notifications
if (window.Notification.active[this.tag])
window.Notification.active[this.tag].close();
window.Notification.active[this.tag] = this;
@@ -47,7 +47,7 @@ namespace Json {

/** \brief Lightweight wrapper to tag static string.
*
* Value constructor and objectValue member assignement takes advantage of the
* Value constructor and objectValue member assignment takes advantage of the
* StaticString and avoid the cost of string duplication when storing the
* string or the member name.
*
@@ -102,7 +102,7 @@ namespace Json {
* The sequence of an #arrayValue will be automatically resize and initialized
* with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
*
* The get() methods can be used to obtanis default value in the case the required element
* The get() methods can be used to obtains default value in the case the required element
* does not exist.
*
* It is possible to iterate over the list of a #objectValue values using
@@ -479,7 +479,7 @@ namespace Json {
* - ".name1.name2.name3"
* - ".[0][1][2].name1[3]"
* - ".%" => member name is provided as parameter
* - ".[%]" => index is provied as parameter
* - ".[%]" => index is provided as parameter
*/
class Path
{
@@ -616,7 +616,7 @@ namespace Json {


/** \brief A linked page based hash-table implementation used internally by Value.
* \internal ValueInternalMap is a tradional bucket based hash-table, with a linked
* \internal ValueInternalMap is a traditional bucket based hash-table, with a linked
* list in each bucket to handle collision. There is an addional twist in that
* each node of the collision linked list is a page containing a fixed amount of
* value. This provides a better compromise between memory usage and speed.
@@ -23,7 +23,7 @@ namespace Json {
/** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format without formatting (not human friendly).
*
* The JSON document is written in a single line. It is not intended for 'human' consumption,
* but may be usefull to support feature such as RPC where bandwith is limited.
* but may be useful to support feature such as RPC where bandwidth is limited.
* \sa Reader, Value
*/
class JSON_API FastWriter : public Writer
@@ -41,7 +41,7 @@ namespace Json {
void writeValue( const Value &value );

std::string document_;
bool yamlCompatiblityEnabled_;
bool yamlCompatibilityEnabled_;
};

/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way.

0 comments on commit 013adc6

Please sign in to comment.