You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2014/04/13 03:08:31 UTC
[49/53] [abbrv] [partial] CB-6440 create - use shelljs rather than
custom copy function
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/api.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/api.js b/blackberry10/node_modules/jake/lib/api.js
deleted file mode 100644
index 97d7c78..0000000
--- a/blackberry10/node_modules/jake/lib/api.js
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-var exec = require('child_process').exec;
-
-var api = new (function () {
- /**
- @name task
- @static
- @function
- @description Creates a Jake Task
- `
- @param {String} name The name of the Task
- @param {Array} [prereqs] Prerequisites to be run before this task
- @param {Function} [action] The action to perform for this task
- @param {Object} [opts]
- @param {Boolean} [opts.asyc=false] Perform this task asynchronously.
- If you flag a task with this option, you must call the global
- `complete` method inside the task's action, for execution to proceed
- to the next task.
-
- @example
- desc('This is the default task.');
- task('default', function (params) {
- console.log('This is the default task.');
- });
-
- desc('This task has prerequisites.');
- task('hasPrereqs', ['foo', 'bar', 'baz'], function (params) {
- console.log('Ran some prereqs first.');
- });
-
- desc('This is an asynchronous task.');
- task('asyncTask', function () {
- setTimeout(complete, 1000);
- }, {async: true});
- */
- this.task = function (name, prereqs, action, opts) {
- var args = Array.prototype.slice.call(arguments)
- , type
- , createdTask;
- args.unshift('task');
- createdTask = jake.createTask.apply(global, args);
- jake.currentTaskDescription = null;
- return createdTask;
- };
-
- /**
- @name directory
- @static
- @function
- @description Creates a Jake DirectoryTask. Can be used as a prerequisite
- for FileTasks, or for simply ensuring a directory exists for use with a
- Task's action.
- `
- @param {String} name The name of the DiretoryTask
-
- @example
-
- // Creates the package directory for distribution
- directory('pkg');
- */
- this.directory = function (name) {
- var args = Array.prototype.slice.call(arguments)
- , createdTask;
- args.unshift('directory');
- createdTask = jake.createTask.apply(global, args);
- jake.currentTaskDescription = null;
- return createdTask;
- };
-
- /**
- @name file
- @static
- @function
- @description Creates a Jake FileTask.
- `
- @param {String} name The name of the FileTask
- @param {Array} [prereqs] Prerequisites to be run before this task
- @param {Function} [action] The action to create this file, if it doesn't
- exist already.
- @param {Object} [opts]
- @param {Array} [opts.asyc=false] Perform this task asynchronously.
- If you flag a task with this option, you must call the global
- `complete` method inside the task's action, for execution to proceed
- to the next task.
-
- */
- this.file = function (name, prereqs, action, opts) {
- var args = Array.prototype.slice.call(arguments)
- , createdTask;
- args.unshift('file');
- createdTask = jake.createTask.apply(global, args);
- jake.currentTaskDescription = null;
- return createdTask;
- };
-
- /**
- @name desc
- @static
- @function
- @description Creates a description for a Jake Task (or FileTask,
- DirectoryTask). When invoked, the description that iscreated will
- be associated with whatever Task is created next.
- `
- @param {String} description The description for the Task
- */
- this.desc = function (description) {
- jake.currentTaskDescription = description;
- };
-
- /**
- @name namespace
- @static
- @function
- @description Creates a namespace which allows logical grouping
- of tasks, and prevents name-collisions with task-names. Namespaces
- can be nested inside of other namespaces.
- `
- @param {String} name The name of the namespace
- @param {Function} scope The enclosing scope for the namespaced tasks
-
- @example
- namespace('doc', function () {
- task('generate', ['doc:clobber'], function () {
- // Generate some docs
- });
-
- task('clobber', function () {
- // Clobber the doc directory first
- });
- });
- */
- this.namespace = function (name, scope) {
- var curr = jake.currentNamespace
- , ns = curr.childNamespaces[name] || new jake.Namespace(name, curr);
- curr.childNamespaces[name] = ns;
- jake.currentNamespace = ns;
- scope();
- jake.currentNamespace = curr;
- jake.currentTaskDescription = null;
- return ns;
- };
-
- /**
- @name complete
- @static
- @function
- @description Complets an asynchronous task, allowing Jake's
- execution to proceed to the next task
- `
- @example
- task('generate', ['doc:clobber'], function () {
- exec('./generate_docs.sh', function (err, stdout, stderr) {
- if (err || stderr) {
- fail(err || stderr);
- }
- else {
- console.log(stdout);
- complete();
- }
- });
- }, {async: true});
- */
- this.complete = function () {
- var current = jake._invocationChain.pop();
- if (current) {
- current.complete();
- }
- };
-
- /**
- @name fail
- @static
- @function
- @description Causes Jake execution to abort with an error.
- Allows passing an optional error code, which will be used to
- set the exit-code of exiting process.
- `
- @param {Error|String} err The error to thow when aborting execution.
- If this argument is an Error object, it will simply be thrown. If
- a String, it will be used as the error-message. (If it is a multi-line
- String, the first line will be used as the Error message, and the
- remaining lines will be used as the error-stack.)
-
- @example
- task('createTests, function () {
- if (!fs.existsSync('./tests')) {
- fail('Test directory does not exist.');
- }
- else {
- // Do some testing stuff ...
- }
- });
- */
- this.fail = function (err, code) {
- var msg
- , errObj;
- if (code) {
- jake.errorCode = code;
- }
- if (err) {
- if (typeof err == 'string') {
- // Use the initial or only line of the error as the error-message
- // If there was a multi-line error, use the rest as the stack
- msg = err.split('/n');
- errObj = new Error(msg.shift());
- if (msg.length) {
- errObj.stack = msg.join('\n');
- }
- throw errObj;
- }
- else if (err instanceof Error) {
- throw err;
- }
- else {
- throw new Error(err.toString());
- }
- }
- else {
- throw new Error();
- }
- };
-
-})();
-
-module.exports = api;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/file_list.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/file_list.js b/blackberry10/node_modules/jake/lib/file_list.js
deleted file mode 100644
index 6bf8401..0000000
--- a/blackberry10/node_modules/jake/lib/file_list.js
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-var fs = require('fs')
-, path = require('path')
-, minimatch = require('minimatch')
-, utils = require('utilities')
-, globSync;
-
-globSync = function (pat) {
- var dirname = jake.basedir(pat)
- , files = jake.readdirR(dirname)
- , matches;
- pat = path.normalize(pat);
- // Hack, Minimatch doesn't support backslashes in the pattern
- // https://github.com/isaacs/minimatch/issues/7
- pat = pat.replace(/\\/g, '/');
- matches = minimatch.match(files, pat, {});
- return matches;
-};
-
-// Constants
-// ---------------
-// List of all the builtin Array methods we want to override
-var ARRAY_METHODS = Object.getOwnPropertyNames(Array.prototype)
-// Array methods that return a copy instead of affecting the original
- , SPECIAL_RETURN = {
- 'concat': true
- , 'slice': true
- , 'filter': true
- , 'map': true
- }
-// Default file-patterns we want to ignore
- , DEFAULT_IGNORE_PATTERNS = [
- /(^|[\/\\])CVS([\/\\]|$)/
- , /(^|[\/\\])\.svn([\/\\]|$)/
- , /(^|[\/\\])\.git([\/\\]|$)/
- , /\.bak$/
- , /~$/
- ]
-// Ignore core files
- , DEFAULT_IGNORE_FUNCS = [
- function (name) {
- var isDir = false
- , stats;
- try {
- stats = fs.statSync(name);
- isDir = stats.isDirectory();
- }
- catch(e) {}
- return (/(^|[\/\\])core$/).test(name) && !isDir;
- }
- ];
-
-var FileList = function () {
- var self = this
- , wrap;
-
- // List of glob-patterns or specific filenames
- this.pendingAdd = [];
- // Switched to false after lazy-eval of files
- this.pending = true;
- // Used to calculate exclusions from the list of files
- this.excludes = {
- pats: DEFAULT_IGNORE_PATTERNS.slice()
- , funcs: DEFAULT_IGNORE_FUNCS.slice()
- , regex: null
- };
- this.items = [];
-
- // Wrap the array methods with the delegates
- wrap = function (prop) {
- var arr;
- self[prop] = function () {
- if (self.pending) {
- self.resolve();
- }
- if (typeof self.items[prop] == 'function') {
- // Special method that return a copy
- if (SPECIAL_RETURN[prop]) {
- arr = self.items[prop].apply(self.items, arguments);
- return FileList.clone(self, arr);
- }
- else {
- return self.items[prop].apply(self.items, arguments);
- }
- }
- else {
- return self.items[prop];
- }
- };
- };
- for (var i = 0, ii = ARRAY_METHODS.length; i < ii; i++) {
- wrap(ARRAY_METHODS[i]);
- }
-
- // Include whatever files got passed to the constructor
- this.include.apply(this, arguments);
-
- // Fix constructor linkage
- this.constructor = FileList;
-};
-
-FileList.prototype = new (function () {
- var globPattern = /[*?\[\{]/;
-
- var _addMatching = function (pat) {
- var matches = globSync(pat);
- this.items = this.items.concat(matches);
- }
-
- , _resolveAdd = function (name) {
- if (globPattern.test(name)) {
- _addMatching.call(this, name);
- }
- else {
- this.push(name);
- }
- }
-
- , _calculateExcludeRe = function () {
- var pats = this.excludes.pats
- , pat
- , excl = []
- , matches = [];
-
- for (var i = 0, ii = pats.length; i < ii; i++) {
- pat = pats[i];
- if (typeof pat == 'string') {
- // Glob, look up files
- if (/[*?]/.test(pat)) {
- matches = globSync(pat);
- matches = matches.map(function (m) {
- return utils.string.escapeRegExpChars(m);
- });
- excl = excl.concat(matches);
- }
- // String for regex
- else {
- excl.push(utils.string.escapeRegExpChars(pat));
- }
- }
- // Regex, grab the string-representation
- else if (pat instanceof RegExp) {
- excl.push(pat.toString().replace(/^\/|\/$/g, ''));
- }
- }
- if (excl.length) {
- this.excludes.regex = new RegExp('(' + excl.join(')|(') + ')');
- }
- else {
- this.excludes.regex = /^$/;
- }
- }
-
- , _resolveExclude = function () {
- var self = this;
- _calculateExcludeRe.call(this);
- // No `reject` method, so use reverse-filter
- this.items = this.items.filter(function (name) {
- return !self.shouldExclude(name);
- });
- }
-
- /**
- * Includes file-patterns in the FileList. Should be called with one or more
- * pattern for finding file to include in the list. Arguments should be strings
- * for either a glob-pattern or a specific file-name, or an array of them
- */
- this.include = function () {
- var args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
- for (var i = 0, ii = args.length; i < ii; i++) {
- this.pendingAdd.push(args[i]);
- }
- return this;
- };
-
- /**
- * Indicates whether a particular file would be filtered out by the current
- * exclusion rules for this FileList.
- * @param {String} name The filename to check
- * @return {Boolean} Whether or not the file should be excluded
- */
- this.shouldExclude = function (name) {
- if (!this.excludes.regex) {
- _calculateExcludeRe.call(this);
- }
- var excl = this.excludes;
- return excl.regex.test(name) || excl.funcs.some(function (f) {
- return !!f(name);
- });
- };
-
- /**
- * Excludes file-patterns from the FileList. Should be called with one or more
- * pattern for finding file to include in the list. Arguments can be:
- * 1. Strings for either a glob-pattern or a specific file-name
- * 2. Regular expression literals
- * 3. Functions to be run on the filename that return a true/false
- */
- this.exclude = function () {
- var args = Array.isArray(arguments[0]) ? arguments[0] : arguments
- , arg;
- for (var i = 0, ii = args.length; i < ii; i++) {
- arg = args[i];
- if (typeof arg == 'function' && !(arg instanceof RegExp)) {
- this.excludes.funcs.push(arg);
- }
- else {
- this.excludes.pats.push(arg);
- }
- }
- if (!this.pending) {
- _resolveExclude.call(this);
- }
- return this;
- };
-
- /**
- * Populates the FileList from the include/exclude rules with a list of
- * actual files
- */
- this.resolve = function () {
- var name;
- if (this.pending) {
- this.pending = false;
- while ((name = this.pendingAdd.shift())) {
- _resolveAdd.call(this, name);
- }
- _resolveExclude.call(this);
- }
- return this;
- };
-
- /**
- * Convert to a plain-jane array
- */
- this.toArray = function () {
- // Call slice to ensure lazy-resolution before slicing items
- var ret = this.slice().items.slice();
- return ret;
- };
-
- /**
- * Get rid of any current exclusion rules
- */
- this.clearExclude = function () {
- this.excludes = {
- pats: []
- , funcs: []
- , regex: null
- };
- return this;
- };
-
-})();
-
-// Static method, used to create copy returned by special
-// array methods
-FileList.clone = function (list, items) {
- var clone = new FileList();
- if (items) {
- clone.items = items;
- }
- clone.pendingAdd = list.pendingAdd;
- clone.pending = list.pending;
- for (var p in list.excludes) {
- clone.excludes[p] = list.excludes[p];
- }
- return clone;
-};
-
-exports.FileList = FileList;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/jake.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/jake.js b/blackberry10/node_modules/jake/lib/jake.js
deleted file mode 100644
index e271342..0000000
--- a/blackberry10/node_modules/jake/lib/jake.js
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var jake
- , EventEmitter = require('events').EventEmitter
- , fs = require('fs')
- , path = require('path')
- , taskNs = require('./task')
- , Task = taskNs.Task
- , FileTask = taskNs.FileTask
- , DirectoryTask = taskNs.DirectoryTask
- , api = require('./api')
- , utils = require('./utils')
- , Program = require('./program').Program
- , Loader = require('./loader').Loader
- , pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString());
-
-var Namespace = function (name, parentNamespace) {
- this.name = name;
- this.parentNamespace = parentNamespace;
- this.childNamespaces = {};
- this.tasks = {};
-
- this.resolve = function(relativeName) {
- var parts = relativeName.split(':')
- , name = parts.pop()
- , ns = this
- , task;
- for(var i = 0, l = parts.length; ns && i < l; i++) {
- ns = ns.childNamespaces[parts[i]];
- }
-
- return (ns && ns.tasks[name]) ||
- (this.parentNamespace && this.parentNamespace.resolve(relativeName));
- }
-
-};
-
-var Invocation = function (taskName, args) {
- this.taskName = taskName;
- this.args = args;
-};
-
-// And so it begins
-jake = new EventEmitter();
-
-// Globalize jake and top-level API methods (e.g., `task`, `desc`)
-global.jake = jake;
-utils.mixin(global, api);
-
-// Copy utils onto base jake
-utils.mixin(jake, utils);
-// File utils should be aliased directly on base jake as well
-utils.mixin(jake, utils.file);
-
-utils.mixin(jake, new (function () {
-
- this._invocationChain = [];
-
- // Private variables
- // =================
- // Local reference for scopage
- var self = this;
-
- // Public properties
- // =================
- this.version = pkg.version;
- // Used when Jake exits with a specific error-code
- this.errorCode = undefined;
- // Loads Jakefiles/jakelibdirs
- this.loader = new Loader();
- // Name/value map of all the various tasks defined in a Jakefile.
- // Non-namespaced tasks are placed into 'default.'
- this.defaultNamespace = new Namespace('default', null);
- // For namespaced tasks -- tasks with no namespace are put into the
- // 'default' namespace so lookup code can work the same for both
- // namespaced and non-namespaced.
- this.currentNamespace = this.defaultNamespace;
- // Saves the description created by a 'desc' call that prefaces a
- // 'task' call that defines a task.
- this.currentTaskDescription = null;
- this.program = new Program()
- this.FileList = require('./file_list').FileList;
- this.PackageTask = require('./package_task').PackageTask;
- this.NpmPublishTask = require('./npm_publish_task').NpmPublishTask;
- this.TestTask = require('./test_task').TestTask;
- this.Task = Task;
- this.FileTask = FileTask;
- this.DirectoryTask = DirectoryTask;
- this.Namespace = Namespace;
-
- this.parseAllTasks = function () {
- var _parseNs = function (name, ns) {
- var nsTasks = ns.tasks
- , task
- , nsNamespaces = ns.childNamespaces
- , fullName;
- // Iterate through the tasks in each namespace
- for (var q in nsTasks) {
- task = nsTasks[q];
- // Preface only the namespaced tasks
- fullName = name == 'default' ? q : name + ':' + q;
- // Save with 'taskname' or 'namespace:taskname' key
- task.fullName = fullName;
- jake.Task[fullName] = task;
- }
- for (var p in nsNamespaces) {
- fullName = name == 'default' ? p : name + ':' + p;
- _parseNs(fullName, nsNamespaces[p]);
- }
- };
-
- _parseNs('default', jake.defaultNamespace);
- };
-
- /**
- * Displays the list of descriptions avaliable for tasks defined in
- * a Jakefile
- */
- this.showAllTaskDescriptions = function (f) {
- var maxTaskNameLength = 0
- , task
- , str = ''
- , padding
- , name
- , descr
- , filter = typeof f == 'string' ? f : null;
-
- for (var p in jake.Task) {
- task = jake.Task[p];
- // Record the length of the longest task name -- used for
- // pretty alignment of the task descriptions
- maxTaskNameLength = p.length > maxTaskNameLength ?
- p.length : maxTaskNameLength;
- }
- // Print out each entry with descriptions neatly aligned
- for (var p in jake.Task) {
- if (filter && p.indexOf(filter) == -1) {
- continue;
- }
- task = jake.Task[p];
-
- name = '\033[32m' + p + '\033[39m ';
-
- // Create padding-string with calculated length
- padding = (new Array(maxTaskNameLength - p.length + 2)).join(' ');
-
- descr = task.description
- if (descr) {
- descr = '\033[90m # ' + descr + '\033[39m \033[37m \033[39m';
- console.log('jake ' + name + padding + descr);
- }
- }
- };
-
- this.createTask = function () {
- var args = Array.prototype.slice.call(arguments)
- , arg
- , task
- , type
- , name
- , action
- , opts = {}
- , prereqs = [];
-
- type = args.shift()
-
- // name, [deps], [action]
- // Name (string) + deps (array) format
- if (typeof args[0] == 'string') {
- name = args.shift();
- if (Array.isArray(args[0])) {
- prereqs = args.shift();
- }
- }
- // name:deps, [action]
- // Legacy object-literal syntax, e.g.: {'name': ['depA', 'depB']}
- else {
- obj = args.shift()
- for (var p in obj) {
- prereqs = prereqs.concat(obj[p]);
- name = p;
- }
- }
-
- // Optional opts/callback or callback/opts
- while ((arg = args.shift())) {
- if (typeof arg == 'function') {
- action = arg;
- }
- else {
- opts = arg;
- }
- }
-
- task = jake.currentNamespace.resolve(name);
- if (task && !action) {
- // Task already exists and no action, just update prereqs, and return it.
- task.prereqs = task.prereqs.concat(prereqs);
- return task;
- }
-
- switch (type) {
- case 'directory':
- action = function () {
- jake.mkdirP(name);
- };
- task = new DirectoryTask(name, prereqs, action, opts);
- break;
- case 'file':
- task = new FileTask(name, prereqs, action, opts);
- break;
- default:
- task = new Task(name, prereqs, action, opts);
- }
-
- if (jake.currentTaskDescription) {
- task.description = jake.currentTaskDescription;
- jake.currentTaskDescription = null;
- }
- jake.currentNamespace.tasks[name] = task;
- task.namespace = jake.currentNamespace;
-
- // FIXME: Should only need to add a new entry for the current
- // task-definition, not reparse the entire structure
- jake.parseAllTasks();
-
- return task;
- };
-
- this.init = function () {
- var self = this;
- process.addListener('uncaughtException', function (err) {
- self.program.handleErr(err);
- });
-
- };
-
- this.run = function () {
- var args = Array.prototype.slice.call(arguments)
- , program = this.program
- , loader = this.loader
- , preempt
- , opts;
-
- program.parseArgs(args);
- program.init();
-
- preempt = program.firstPreemptiveOption();
- if (preempt) {
- preempt();
- }
- else {
- opts = program.opts;
- // Load Jakefile and jakelibdir files
- loader.loadFile(opts.jakefile);
- loader.loadDirectory(opts.jakelibdir);
-
- program.run();
- }
- };
-
-})());
-
-module.exports = jake;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/loader.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/loader.js b/blackberry10/node_modules/jake/lib/loader.js
deleted file mode 100644
index 58c7080..0000000
--- a/blackberry10/node_modules/jake/lib/loader.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var path = require('path')
- , fs = require('fs')
- , existsSync = typeof fs.existsSync == 'function' ?
- fs.existsSync : path.existsSync
- , utils = require('utilities')
- , Loader;
-
-
-Loader = function () {
-
- var JAKEFILE_PAT = /\.jake(\.js|\.coffee)?$/;
-
- var _requireCoffee = function () {
- try {
- return require('coffee-script');
- }
- catch (e) {
- fail('CoffeeScript is missing! Try `npm install coffee-script`');
- }
- };
-
- this.loadFile = function (file) {
- var jakefile = file ?
- file.replace(/\.js$/, '').replace(/\.coffee$/, '') : 'Jakefile'
- , fileSpecified = !!file
- // Dear God, why?
- , isCoffee = false
- // Warning, recursive
- , exists;
-
- exists = function () {
- var cwd = process.cwd();
- if (existsSync(jakefile) || existsSync(jakefile + '.js') ||
- existsSync(jakefile + '.coffee')) {
- return true;
- }
- if (!fileSpecified) {
- process.chdir("..");
- if (cwd === process.cwd()) {
- return false;
- }
- return exists();
- }
- };
-
- if (!exists()) {
- fail('No Jakefile. Specify a valid path with -f/--jakefile, ' +
- 'or place one in the current directory.');
- }
-
- isCoffee = existsSync(jakefile + '.coffee');
- if (isCoffee) {
- CoffeeScript = _requireCoffee();
- }
- require(utils.file.absolutize(jakefile));
- };
-
- this.loadDirectory = function (d) {
- var dirname = d || 'jakelib'
- , dirlist;
- dirname = utils.file.absolutize(dirname);
- if (existsSync(dirname)) {
- dirlist = fs.readdirSync(dirname);
- dirlist.forEach(function (filePath) {
- if (JAKEFILE_PAT.test(filePath)) {
- if (/\.coffee$/.test(filePath)) {
- CoffeeScript = _requireCoffee();
- }
- require(path.join(dirname, filePath));
- }
- });
- }
- };
-};
-
-module.exports.Loader = Loader;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/npm_publish_task.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/npm_publish_task.js b/blackberry10/node_modules/jake/lib/npm_publish_task.js
deleted file mode 100644
index d4f029b..0000000
--- a/blackberry10/node_modules/jake/lib/npm_publish_task.js
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var fs = require('fs')
- , exec = require('child_process').exec
- , utils = require('utilities')
- , currDir = process.cwd();
-
-var NpmPublishTask = function (name, packageFiles) {
- this.name = name;
- this.packageFiles = packageFiles;
- this.define();
-};
-
-
-NpmPublishTask.prototype = new (function () {
-
- var _currentBranch = null;
-
- var getPackage = function () {
- var pkg = JSON.parse(fs.readFileSync(process.cwd() + '/package.json').toString());
- return pkg;
- }
- , getPackageVersionNumber = function () {
- return getPackage().version;
- };
-
- this.define = function () {
- var self = this;
-
- namespace('npm', function () {
- task('fetchTags', {async: true}, function () {
- // Make sure local tags are up to date
- cmds = [
- 'git fetch --tags'
- ];
- jake.exec(cmds, function () {
- console.log('Fetched remote tags.');
- complete();
- });
- });
-
- task('getCurrentBranch', {async: true}, function () {
- // Figure out what branch to push to
- exec('git symbolic-ref --short HEAD',
- function (err, stdout, stderr) {
- if (err) {
- fail(err);
- }
- if (stderr) {
- fail(new Error(stderr));
- }
- if (!stdout) {
- fail(new Error('No current Git branch found'));
- }
- _currentBranch = utils.string.trim(stdout);
- console.log('On branch ' + _currentBranch);
- complete();
- });
- });
-
- task('version', {async: true}, function () {
- // Only bump, push, and tag if the Git repo is clean
- exec('git status --porcelain --untracked-files=no',
- function (err, stdout, stderr) {
- var cmds
- , path
- , pkg
- , version
- , arr
- , patch
- , message;
-
- if (err) {
- fail(err);
- }
- if (stderr) {
- fail(new Error(stderr));
- }
- if (stdout.length) {
- fail(new Error('Git repository is not clean.'));
- }
-
- // Grab the current version-string
- path = process.cwd() + '/package.json';
- pkg = getPackage();
- version = pkg.version;
- // Increment the patch-number for the version
- arr = version.split('.');
- patch = parseInt(arr.pop(), 10) + 1;
- arr.push(patch);
- version = arr.join('.');
- // New package-version
- pkg.version = version;
- // Commit-message
- message = 'Version ' + version
-
- // Update package.json with the new version-info
- fs.writeFileSync(path, JSON.stringify(pkg, true, 2));
-
- cmds = [
- 'git commit package.json -m "' + message + '"'
- , 'git push origin ' + _currentBranch
- , 'git tag -a v' + version + ' -m "' + message + '"'
- , 'git push --tags'
- ];
-
- jake.exec(cmds, function () {
- var version = getPackageVersionNumber();
- console.log('Bumped version number to v' + version + '.');
- complete();
- });
- });
- });
-
- task('definePackage', function () {
- var version = getPackageVersionNumber()
- , t;
- t = new jake.PackageTask(self.name, 'v' + version, function () {
- this.packageFiles.include(self.packageFiles);
- this.needTarGz = true;
- });
- });
-
- task('package', {async: true}, function () {
- var definePack = jake.Task['npm:definePackage']
- , pack = jake.Task['package']
- , version = getPackageVersionNumber();
- // May have already been run
- definePack.reenable(true);
- definePack.addListener('complete', function () {
- pack.addListener('complete', function () {
- console.log('Created package for ' + self.name + ' v' + version);
- complete();
- });
- pack.invoke();
- });
- definePack.invoke();
- });
-
- task('publish', {async: true}, function () {
- var version = getPackageVersionNumber();
- console.log('Publishing ' + self.name + ' v' + version);
- cmds = [
- 'npm publish pkg/' + self.name + '-v' + version + '.tar.gz'
- ];
- // Hackity hack -- NPM publish sometimes returns errror like:
- // Error sending version data\nnpm ERR!
- // Error: forbidden 0.2.4 is modified, should match modified time
- setTimeout(function () {
- jake.exec(cmds, function () {
- console.log('Published to NPM');
- complete();
- }, {stdout: true});
- }, 5000);
- });
-
- task('cleanup', function () {
- var clobber = jake.Task['clobber'];
- clobber.reenable(true);
- clobber.invoke();
- console.log('Cleaned up package');
- });
-
- });
-
- desc('Bump version-number, package, and publish to NPM.');
- task('publish', ['npm:fetchTags', 'npm:getCurrentBranch', 'npm:version',
- 'npm:package', 'npm:publish', 'npm:cleanup'], function () {});
-
- jake.Task['npm:definePackage'].invoke();
- };
-
-})();
-
-jake.NpmPublishTask = NpmPublishTask;
-exports.NpmPublishTask = NpmPublishTask;
-
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/package_task.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/package_task.js b/blackberry10/node_modules/jake/lib/package_task.js
deleted file mode 100644
index 6d972ef..0000000
--- a/blackberry10/node_modules/jake/lib/package_task.js
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var path = require('path')
- , fs = require('fs')
- , exec = require('child_process').exec
- , FileList = require('./file_list').FileList;
-
-/**
- @name jake
- @namespace jake
-*/
-/**
- @name jake.PackageTask
- @constructor
- @description Instantiating a PackageTask creates a number of Jake
- Tasks that make packaging and distributing your software easy.
-
- @param {String} name The name of the project
- @param {String} version The current project version (will be
- appended to the project-name in the package-archive
- @param {Function} definition Defines the contents of the package,
- and format of the package-archive. Will be executed on the instantiated
- PackageTask (i.e., 'this', will be the PackageTask instance),
- to set the various instance-propertiess.
-
- @example
- var t = new jake.PackageTask('rous', 'v' + version, function () {
- var files = [
- 'Capfile'
- , 'Jakefile'
- , 'README.md'
- , 'package.json'
- , 'app/*'
- , 'bin/*'
- , 'config/*'
- , 'lib/*'
- , 'node_modules/*'
- ];
- this.packageFiles.include(files);
- this.packageFiles.exclude('node_modules/foobar');
- this.needTarGz = true;
- });
-
- */
-var PackageTask = function (name, version, definition) {
- /**
- @name jake.PackageTask#name
- @public
- @type {String}
- @description The name of the project
- */
- this.name = name;
- /**
- @name jake.PackageTask#version
- @public
- @type {String}
- @description The project version-string
- */
- this.version = version;
- /**
- @name jake.PackageTask#version
- @public
- @type {String='pkg'}
- @description The directory-name to use for packaging the software
- */
- this.packageDir = 'pkg';
- /**
- @name jake.PackageTask#packageFiles
- @public
- @type {jake.FileList}
- @description The list of files and directories to include in the
- package-archive
- */
- this.packageFiles = new FileList();
- /**
- @name jake.PackageTask#needTar
- @public
- @type {Boolean=false}
- @description If set to true, uses the `tar` utility to create
- a gzip .tgz archive of the pagckage
- */
- this.needTar = false;
- /**
- @name jake.PackageTask#needTar
- @public
- @type {Boolean=false}
- @description If set to true, uses the `tar` utility to create
- a gzip .tar.gz archive of the pagckage
- */
- this.needTarGz = false;
- /**
- @name jake.PackageTask#needTarBz2
- @public
- @type {Boolean=false}
- @description If set to true, uses the `tar` utility to create
- a bzip2 .bz2 archive of the pagckage
- */
- this.needTarBz2 = false;
- /**
- @name jake.PackageTask#needJar
- @public
- @type {Boolean=false}
- @description If set to true, uses the `jar` utility to create
- a .jar archive of the pagckage
- */
- this.needJar = false;
- /**
- @name jake.PackageTask#needZip
- @public
- @type {Boolean=false}
- @description If set to true, uses the `zip` utility to create
- a .zip archive of the pagckage
- */
- this.needZip = false;
- /**
- @name jake.PackageTask#manifestFile
- @public
- @type {String=null}
- @description Can be set to point the `jar` utility at a manifest
- file to use in a .jar archive. If unset, one will be automatically
- created by the `jar` utility. This path should be relative to the
- root of the package directory (this.packageDir above, likely 'pkg')
- */
- this.manifestFile = null;
- /**
- @name jake.PackageTask#tarCommand
- @public
- @type {String='tar'}
- @description The shell-command to use for creating tar archives.
- */
- this.tarCommand = 'tar';
- /**
- @name jake.PackageTask#jarCommand
- @public
- @type {String='jar'}
- @description The shell-command to use for creating jar archives.
- */
- this.jarCommand = 'jar';
- /**
- @name jake.PackageTask#zipCommand
- @public
- @type {String='zip'}
- @description The shell-command to use for creating zip archives.
- */
- this.zipCommand = 'zip';
- /**
- @name jake.PackageTask#archiveChangeDir
- @public
- @type {String=null}
- @description Equivalent to the '-C' command for the `tar` and `jar`
- commands. ("Change to this directory before adding files.")
- */
- this.archiveChangeDir = null;
- /**
- @name jake.PackageTask#archiveContentDir
- @public
- @type {String=null}
- @description Specifies the files and directories to include in the
- package-archive. If unset, this will default to the main package
- directory -- i.e., name + version.
- */
- this.archiveContentDir = null;
-
- if (typeof definition == 'function') {
- definition.call(this);
- }
- this.define();
-};
-
-PackageTask.prototype = new (function () {
-
- var _compressOpts = {
- Tar: {
- ext: '.tgz'
- , flags: 'cvzf'
- , cmd: 'tar'
- }
- , TarGz: {
- ext: '.tar.gz'
- , flags: 'cvzf'
- , cmd: 'tar'
- }
- , TarBz2: {
- ext: '.tar.bz2'
- , flags: 'cvjf'
- , cmd: 'tar'
- }
- , Jar: {
- ext: '.jar'
- , flags: 'cf'
- , cmd: 'jar'
- }
- , Zip: {
- ext: '.zip'
- , flags: 'r'
- , cmd: 'zip'
- }
- };
-
- this.define = function () {
- var self = this
- , packageDirPath = this.packageDirPath()
- , compressTaskArr = [];
-
- desc('Build the package for distribution');
- task('package', ['clobberPackage', 'buildPackage']);
- // Backward-compat alias
- task('repackage', ['package']);
-
- task('clobberPackage', function () {
- jake.rmRf(self.packageDir, {silent: true});
- });
-
- desc('Remove the package');
- task('clobber', ['clobberPackage']);
-
- for (var p in _compressOpts) {
- if (this['need' + p]) {
- (function (p) {
- var filename = path.resolve(self.packageDir + '/' + self.packageName() +
- _compressOpts[p].ext);
- compressTaskArr.push(filename);
-
- file(filename, [packageDirPath], function () {
- var cmd
- , opts = _compressOpts[p]
- // Directory to move to when doing the compression-task
- // Changes in the case of zip for emulating -C option
- , chdir = self.packageDir
- // Save the current dir so it's possible to pop back up
- // after compressing
- , currDir = process.cwd();
-
- cmd = self[opts.cmd + 'Command'];
- cmd += ' -' + opts.flags;
- if (opts.cmd == 'jar' && self.manifestFile) {
- cmd += 'm';
- }
-
- // The name of the archive to create -- use full path
- // so compression can be performed from a different dir
- // if needed
- cmd += ' ' + filename;
-
- if (opts.cmd == 'jar' && self.manifestFile) {
- cmd += ' ' + self.manifestFile;
- }
-
- // Where to perform the compression -- -C option isn't
- // supported in zip, so actually do process.chdir for this
- if (self.archiveChangeDir) {
- if (opts.cmd == 'zip') {
- chdir = path.join(chdir, self.archiveChangeDir);
- }
- else {
- cmd += ' -C ' + self.archiveChangeDir;
- }
- }
-
- // Where to stick the archive
- if (self.archiveContentDir) {
- cmd += ' ' + self.archiveContentDir;
- }
- else {
- cmd += ' ' + self.packageName();
- }
-
- // Move into the desired dir (usually packageDir) to compress
- // Return back up to the current dir after the exec
- process.chdir(chdir);
-
- exec(cmd, function (err, stdout, stderr) {
- if (err) { throw err; }
-
- // Return back up to the starting directory (see above,
- // before exec)
- process.chdir(currDir);
-
- complete();
- });
- }, {async: true});
- })(p);
- }
- }
-
- task('buildPackage', compressTaskArr, function () {});
-
- directory(this.packageDir);
-
- file(packageDirPath,
- FileList.clone(this.packageFiles).include(this.packageDir), function () {
- var fileList = [];
- self.packageFiles.forEach(function (name) {
- var f = path.join(self.packageDirPath(), name)
- , fDir = path.dirname(f)
- , stats;
- jake.mkdirP(fDir, {silent: true});
-
- // Add both files and directories
- fileList.push({
- from: name
- , to: f
- });
- });
- var _copyFile = function () {
- var cmd
- , file = fileList.pop()
- , stat;
- if (file) {
- stat = fs.statSync(file.from);
- // Target is a directory, just create it
- if (stat.isDirectory()) {
- jake.mkdirP(file.to, {silent: true});
- _copyFile();
- }
- // Otherwise copy the file
- else {
- jake.cpR(file.from, file.to, {silent: true});
- _copyFile();
- }
- }
- else {
- complete();
- }
- };
- _copyFile();
- }, {async: true});
-
-
- };
-
- this.packageName = function () {
- if (this.version) {
- return this.name + '-' + this.version;
- }
- else {
- return this.name;
- }
- };
-
- this.packageDirPath = function () {
- return this.packageDir + '/' + this.packageName();
- };
-
-})();
-
-jake.PackageTask = PackageTask;
-exports.PackageTask = PackageTask;
-
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/parseargs.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/parseargs.js b/blackberry10/node_modules/jake/lib/parseargs.js
deleted file mode 100644
index dd2495b..0000000
--- a/blackberry10/node_modules/jake/lib/parseargs.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var parseargs = {};
-
-/**
- * @constructor
- * Parses a list of command-line args into a key/value object of
- * options and an array of positional commands.
- * @ param {Array} opts A list of options in the following format:
- * [{full: 'foo', abbr: 'f'}, {full: 'bar', abbr: 'b'}]]
- */
-parseargs.Parser = function (opts) {
- // A key/value object of matching options parsed out of the args
- this.opts = {};
- this.taskNames = null;
- this.envVars = null;
-
- // Data structures used for parsing
- this.reg = [];
- this.shortOpts = {};
- this.longOpts = {};
-
- var item;
- for (var i = 0, ii = opts.length; i < ii; i++) {
- item = opts[i];
- this.shortOpts[item.abbr] = item;
- this.longOpts[item.full] = item;
- }
- this.reg = opts;
-};
-
-parseargs.Parser.prototype = new function () {
-
- var _trueOrNextVal = function (argParts, args) {
- if (argParts[1]) {
- return argParts[1];
- }
- else {
- return (!args[0] || (args[0].indexOf('-') == 0)) ?
- true : args.shift();
- }
- };
-
- /**
- * Parses an array of arguments into options and positional commands
- * @param {Array} args The command-line args to parse
- */
- this.parse = function (args) {
- var cmds = []
- , cmd
- , envVars = {}
- , opts = {}
- , arg
- , argItem
- , argParts
- , cmdItems
- , taskNames = []
- , preempt;
-
- while (args.length) {
- arg = args.shift();
-
- if (arg.indexOf('-') == 0) {
- arg = arg.replace(/^--/, '').replace(/^-/, '');
- argParts = arg.split('=');
- argItem = this.longOpts[argParts[0]] || this.shortOpts[argParts[0]];
- if (argItem) {
- // First-encountered preemptive opt takes precedence -- no further opts
- // or possibility of ambiguity, so just look for a value, or set to
- // true and then bail
- if (argItem.preempts) {
- opts[argItem.full] = _trueOrNextVal(argParts, args);
- preempt = true;
- break;
- }
- // If the opt requires a value, see if we can get a value from the
- // next arg, or infer true from no-arg -- if it's followed by another
- // opt, throw an error
- if (argItem.expectValue) {
- opts[argItem.full] = _trueOrNextVal(argParts, args);
- if (!opts[argItem.full]) {
- throw new Error(argItem.full + ' option expects a value.');
- }
- }
- else {
- opts[argItem.full] = true;
- }
- }
- }
- else {
- cmds.unshift(arg);
- }
- }
-
- if (!preempt) {
- // Parse out any env-vars and task-name
- while (!!(cmd = cmds.pop())) {
- cmdItems = cmd.split('=');
- if (cmdItems.length > 1) {
- envVars[cmdItems[0]] = cmdItems[1];
- }
- else {
- taskNames.push(cmd);
- }
- }
-
- }
-
- return {
- opts: opts
- , envVars: envVars
- , taskNames: taskNames
- };
- };
-
-};
-
-module.exports = parseargs;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/program.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/program.js b/blackberry10/node_modules/jake/lib/program.js
deleted file mode 100644
index c6c00ea..0000000
--- a/blackberry10/node_modules/jake/lib/program.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var fs = require('fs')
- , parseargs = require('./parseargs')
- , utils = require('./utils')
- , Program
- , optsReg
- , preempts
- , usage
- , die;
-
-optsReg = [
- { full: 'jakefile'
- , abbr: 'f'
- , preempts: false
- , expectValue: true
- }
-, { full: 'quiet'
- , abbr: 'q'
- , preempts: false
- , expectValue: false
- }
-, { full: 'directory'
- , abbr: 'C'
- , preempts: false
- , expectValue: true
- }
-, { full: 'always-make'
- , abbr: 'B'
- , preempts: false
- , expectValue: false
- }
-, { full: 'tasks'
- , abbr: 'T'
- , preempts: true
- }
-// Alias ls
-, { full: 'tasks'
- , abbr: 'ls'
- , preempts: true
- }
-, { full: 'trace'
- , abbr: 't'
- , preempts: false
- , expectValue: false
- }
-, { full: 'help'
- , abbr: 'h'
- , preempts: true
- }
-, { full: 'version'
- , abbr: 'V'
- , preempts: true
- }
- // Alias lowercase v
-, { full: 'version'
- , abbr: 'v'
- , preempts: true
- }
-, { full: 'jakelibdir'
- , abbr: 'J'
- , preempts: false
- , expectValue: true
- }
-];
-
-preempts = {
- version: function () {
- die(jake.version);
- }
-, help: function () {
- die(usage);
- }
-};
-
-usage = ''
- + 'Jake JavaScript build tool\n'
- + '********************************************************************************\n'
- + 'If no flags are given, Jake looks for a Jakefile or Jakefile.js in the current directory.\n'
- + '********************************************************************************\n'
- + '{Usage}: jake [options ...] [env variables ...] target\n'
- + '\n'
- + '{Options}:\n'
- + ' -f, --jakefile FILE Use FILE as the Jakefile.\n'
- + ' -C, --directory DIRECTORY Change to DIRECTORY before running tasks.\n'
- + ' -q, --quiet Do not log messages to standard output.\n'
- + ' -B, --always-make Unconditionally make all targets.\n'
- + ' -T/ls, --tasks Display the tasks (matching optional PATTERN) with descriptions, then exit.\n'
- + ' -J, --jakelibdir JAKELIBDIR Auto-import any .jake files in JAKELIBDIR. (default is \'jakelib\')\n'
- + ' -t, --trace Enable full backtrace.\n'
- + ' -h, --help Display this help message.\n'
- + ' -V/v, --version Display the Jake version.\n'
- + '';
-
-Program = function () {
- this.opts = {};
- this.taskNames = null;
- this.taskArgs = null;
- this.envVars = null;
-};
-
-Program.prototype = new (function () {
-
- this.handleErr = function (err) {
- var msg;
- utils.logger.error('jake aborted.');
- if (this.opts.trace && err.stack) {
- utils.logger.error(err.stack);
- }
- else {
- if (err.stack) {
- msg = err.stack.split('\n').slice(0, 2).join('\n');
- utils.logger.error(msg);
- utils.logger.error('(See full trace by running task with --trace)');
- }
- else {
- utils.logger.error(err.message);
- }
- }
- process.exit(jake.errorCode || 1);
- };
-
- this.parseArgs = function (args) {
- var result = (new parseargs.Parser(optsReg)).parse(args);
- this.setOpts(result.opts);
- this.setTaskNames(result.taskNames);
- this.setEnvVars(result.envVars);
- };
-
- this.setOpts = function (options) {
- var opts = options || {};
- utils.mixin(this.opts, opts);
- };
-
- this.setTaskNames = function (names) {
- if (names && !Array.isArray(names)) {
- throw new Error('Task names must be an array');
- }
- this.taskNames = (names && names.length) ? names : ['default'];
- };
-
- this.setEnvVars = function (vars) {
- this.envVars = vars || null;
- };
-
- this.firstPreemptiveOption = function () {
- var opts = this.opts;
- for (var p in opts) {
- if (preempts[p]) {
- return preempts[p];
- }
- }
- return false;
- };
-
- this.init = function (configuration) {
- var self = this
- , config = configuration || {};
- if (config.options) {
- this.setOpts(config.options);
- }
- if (config.taskNames) {
- this.setTaskNames(config.taskNames);
- }
- if (config.envVars) {
- this.setEnvVars(config.envVars);
- }
- process.addListener('uncaughtException', function (err) {
- self.handleErr(err);
- });
- if (this.envVars) {
- utils.mixin(process.env, this.envVars);
- }
- };
-
- this.run = function () {
- var taskNames
- , dirname
- , opts = this.opts;
-
- // Run with `jake -T`, just show descriptions
- if (opts.tasks) {
- return jake.showAllTaskDescriptions(opts.tasks);
- }
-
- taskNames = this.taskNames;
- if (!(Array.isArray(taskNames) && taskNames.length)) {
- throw new Error('Please pass jake.runTasks an array of task-names');
- }
-
- // Set working dir
- dirname = opts.directory;
- if (dirname) {
- if (utils.file.existsSync(dirname) &&
- fs.statSync(dirname).isDirectory()) {
- process.chdir(dirname);
- }
- else {
- throw new Error(dirname + ' is not a valid directory path');
- }
- }
-
- task('__root__', taskNames, function () {});
-
- rootTask = jake.Task['__root__'];
- rootTask.once('complete', function () {
- jake.emit('complete');
- });
- jake.emit('start');
- rootTask.invoke();
- };
-
-})();
-
-die = function (msg) {
- console.log(msg);
- process.exit();
-};
-
-module.exports.Program = Program;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/task/directory_task.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/task/directory_task.js b/blackberry10/node_modules/jake/lib/task/directory_task.js
deleted file mode 100644
index 39c1b68..0000000
--- a/blackberry10/node_modules/jake/lib/task/directory_task.js
+++ /dev/null
@@ -1,29 +0,0 @@
-var DirectoryTask
- , FileTask = require('./file_task').FileTask;
-
-/**
- @name jake
- @namespace jake
-*/
-/**
- @name jake.DirectoryTask
- @constructor
- @augments EventEmitter
- @augments jake.Task
- @augments jake.FileTask
- @description A Jake DirectoryTask
-
- @param {String} name The name of the directory to create.
- */
-DirectoryTask = function (name) {
- this.modTime = null;
- // Do constructor-work only on actual instances, not when used
- // for inheritance
- if (arguments.length) {
- this.init.apply(this, arguments);
- }
-};
-DirectoryTask.prototype = new FileTask();
-DirectoryTask.prototype.constructor = DirectoryTask;
-
-exports.DirectoryTask = DirectoryTask;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/task/file_task.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/task/file_task.js b/blackberry10/node_modules/jake/lib/task/file_task.js
deleted file mode 100644
index 4525f01..0000000
--- a/blackberry10/node_modules/jake/lib/task/file_task.js
+++ /dev/null
@@ -1,134 +0,0 @@
-var fs = require('fs')
- , Task = require('./task').Task
- , FileTask
- , FileBase
- , DirectoryTask
- , utils = require('../utils');
-
-FileBase = new (function () {
- var isFileOrDirectory = function (t) {
- return (t instanceof FileTask ||
- t instanceof DirectoryTask);
- }
- , isFile = function (t) {
- return (t instanceof FileTask && !(t instanceof DirectoryTask));
- };
-
- this.shouldRunAction = function () {
- var runAction = false
- , prereqs = this.prereqs
- , prereqName
- , prereqTask;
-
- // No repeatsies
- if (this.done) {
- return false;
- }
- // The always-make override
- else if (jake.program.opts['always-make']) {
- // Run if there actually is an action
- if (typeof this.action == 'function') {
- return true;
- }
- else {
- return false;
- }
- }
- // Default case
- else {
- // We need either an existing file, or an action to create one.
- // First try grabbing the actual mod-time of the file
- try {
- this.updateModTime();
- }
- // Then fall back to looking for an action
- catch(e) {
- if (typeof this.action == 'function') {
- return true;
- }
- else {
- throw new Error('File-task ' + this.fullName + ' has no ' +
- 'existing file, and no action to create one.');
- }
- }
-
- // Compare mod-time of all the prereqs with its mod-time
- // If any prereqs are newer, need to run the action to update
- if (prereqs && prereqs.length) {
- for (var i = 0, ii = prereqs.length; i < ii; i++) {
- prereqName = prereqs[i];
- prereqTask = jake.Task[prereqName];
- // Run the action if:
- // 1. The prereq is a normal task (not file/dir)
- // 2. The prereq is a file-task with a mod-date more recent than
- // the one for this file/dir
- if (prereqTask) {
- if (!isFileOrDirectory(prereqTask) ||
- (isFile(prereqTask) && prereqTask.modTime > this.modTime)) {
- return true;
- }
- }
- }
- }
- // File/dir has no prereqs, and exists -- no need to run
- else {
- return false;
- }
- }
- };
-
- this.updateModTime = function () {
- var stats = fs.statSync(this.name);
- this.modTime = stats.mtime;
- };
-
- this.complete = function () {
- if (!this.dummy) {
- this.updateModTime();
- }
- this._currentPrereqIndex = 0;
- this.done = true;
- this.emit('complete');
- };
-
-})();
-
-/**
- @name jake
- @namespace jake
-*/
-/**
- @name jake.FileTask
- @constructor
- @augments EventEmitter
- @augments jake.Task
- @description A Jake FileTask
-
- @param {String} name The name of the Task
- @param {Array} [prereqs] Prerequisites to be run before this task
- @param {Function} [action] The action to perform to create this file
- @param {Object} [opts]
- @param {Array} [opts.asyc=false] Perform this task asynchronously.
- If you flag a task with this option, you must call the global
- `complete` method inside the task's action, for execution to proceed
- to the next task.
- */
-FileTask = function (name, prereqs, action, opts) {
- this.modTime = null;
- this.dummy = false;
- // Do constructor-work only on actual instances, not when used
- // for inheritance
- if (arguments.length) {
- this.init.apply(this, arguments);
- }
-};
-FileTask.prototype = new Task();
-FileTask.prototype.constructor = FileTask;
-utils.mixin(FileTask.prototype, FileBase);
-
-exports.FileTask = FileTask;
-
-// DirectoryTask is a subclass of FileTask, depends on it
-// being defined
-DirectoryTask = require('./directory_task').DirectoryTask;
-
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/task/index.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/task/index.js b/blackberry10/node_modules/jake/lib/task/index.js
deleted file mode 100644
index e9bef5e..0000000
--- a/blackberry10/node_modules/jake/lib/task/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-
-var Task = require('./task').Task
- , FileTask = require('./file_task').FileTask
- , DirectoryTask = require('./directory_task').DirectoryTask;
-
-exports.Task = Task;
-exports.FileTask = FileTask;
-exports.DirectoryTask = DirectoryTask;
-
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/task/task.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/task/task.js b/blackberry10/node_modules/jake/lib/task/task.js
deleted file mode 100644
index 034a6fd..0000000
--- a/blackberry10/node_modules/jake/lib/task/task.js
+++ /dev/null
@@ -1,241 +0,0 @@
-var util = require('util') // Native Node util module
- , fs = require('fs')
- , path = require('path')
- , existsSync = typeof fs.existsSync == 'function' ?
- fs.existsSync : path.existsSync
- , EventEmitter = require('events').EventEmitter
- , Task
- , TaskBase
- , utils = require('../utils');
-
-/**
- @name jake
- @namespace jake
-*/
-/**
- @name jake.Task
- @constructor
- @augments EventEmitter
- @description A Jake Task
-
- @param {String} name The name of the Task
- @param {Array} [prereqs] Prerequisites to be run before this task
- @param {Function} [action] The action to perform for this task
- @param {Object} [opts]
- @param {Array} [opts.asyc=false] Perform this task asynchronously.
- If you flag a task with this option, you must call the global
- `complete` method inside the task's action, for execution to proceed
- to the next task.
- */
-Task = function () {
- // Do constructor-work only on actual instances, not when used
- // for inheritance
- if (arguments.length) {
- this.init.apply(this, arguments);
- }
-};
-
-util.inherits(Task, EventEmitter);
-
-TaskBase = new (function () {
-
- // Parse any positional args attached to the task-name
- var parsePrereqName = function (name) {
- var taskArr = name.split('[')
- , taskName = taskArr[0]
- , taskArgs = [];
- if (taskArr[1]) {
- taskArgs = taskArr[1].replace(/\]$/, '');
- taskArgs = taskArgs.split(',');
- }
- return {
- name: taskName
- , args: taskArgs
- };
- };
-
- /**
- @name jake.Task#event:complete
- @event
- */
-
- this.init = function (name, prereqs, action, options) {
- var opts = options || {};
-
- this._currentPrereqIndex = 0;
-
- this.name = name;
- this.prereqs = prereqs;
- this.action = action;
- this.async = false;
- this.done = false;
- this.fullName = null;
- this.description = null;
- this.args = [];
- this.namespace = null;
-
- // Support legacy async-flag -- if not explicitly passed or falsy, will
- // be set to empty-object
- if (typeof opts == 'boolean' && opts === true) {
- this.async = true;
- }
- else {
- if (opts.async) {
- this.async = true;
- }
- }
- };
-
- /**
- @name jake.Task#invoke
- @function
- @description Runs prerequisites, then this task. If the task has already
- been run, will not run the task again.
- */
- this.invoke = function () {
- jake._invocationChain.push(this);
- this.args = Array.prototype.slice.call(arguments);
- this.runPrereqs();
- };
-
- /**
- @name jake.Task#reenable
- @function
- @description Runs this task, without running any prerequisites. If the task
- has already been run, it will still run it again.
- */
- this.execute = function () {
- jake._invocationChain.push(this);
- this.reenable();
- this.run();
- };
-
- this.runPrereqs = function () {
- if (this.prereqs && this.prereqs.length) {
- this.nextPrereq();
- }
- else {
- this.run();
- }
- };
-
- this.nextPrereq = function () {
- var self = this
- , index = this._currentPrereqIndex
- , name = this.prereqs[index]
- , absolute
- , prereq
- , parsed
- , filePath
- , stats;
-
- if (name) {
- parsed = parsePrereqName(name);
- absolute = parsed.name[0] === '^';
-
- if (absolute) {
- parsed.name = parsed.name.slice(1);
- prereq = jake.Task[parsed.name];
- } else {
- prereq = this.namespace.resolve(parsed.name);
- }
-
- // Task doesn't exist, may be a static file
- if (!prereq) {
- // May be namespaced
- filePath = name.split(':').pop();
- // Create a dummy FileTask if file actually exists
- if (existsSync(filePath)) {
- // If there's not already an existing dummy FileTask for it,
- // create one
- prereq = jake.Task[filePath];
- if (!prereq) {
- stats = fs.statSync(filePath);
- prereq = new jake.FileTask(filePath);
- prereq.modTime = stats.mtime;
- prereq.dummy = true;
- // Put this dummy Task in the global Tasks list so
- // modTime will be eval'd correctly
- jake.Task[filePath] = prereq;
- }
- }
- // Otherwise it's not a valid task
- else {
- throw new Error('Unknown task "' + name + '"');
- }
- }
-
- // Do when done
- if (prereq.done) {
- self.handlePrereqComplete(prereq);
- } else {
- prereq.once('complete', function () {
- self.handlePrereqComplete(prereq);
- });
- prereq.invoke.apply(prereq, parsed.args);
- }
- }
- };
-
- this.reenable = function (deep) {
- var prereqs
- , prereq;
- this.done = false;
- if (deep && this.prereqs) {
- prereqs = this.prereqs;
- for (var i = 0, ii = prereqs.length; i < ii; i++) {
- prereq = jake.Task[prereqs[i]];
- if (prereq) {
- prereq.reenable(deep);
- }
- }
- }
- };
-
- this.handlePrereqComplete = function (prereq) {
- var self = this;
- this._currentPrereqIndex++;
- if (this._currentPrereqIndex < this.prereqs.length) {
- setTimeout(function () {
- self.nextPrereq();
- }, 0);
- }
- else {
- this.run();
- }
- };
-
- this.shouldRunAction = function () {
- if (this.done || typeof this.action != 'function') {
- return false
- }
- return true;
- };
-
- this.run = function () {
- var runAction = this.shouldRunAction();
- if (runAction) {
- this.emit('start');
- try {
- this.action.apply(this, this.args);
- }
- catch (e) {
- this.emit('error', e);
- return; // Bail out, not complete
- }
- }
- if (!(runAction && this.async)) {
- complete();
- }
- };
-
- this.complete = function () {
- this._currentPrereqIndex = 0;
- this.done = true;
- this.emit('complete');
- };
-
-})();
-utils.mixin(Task.prototype, TaskBase);
-
-exports.Task = Task;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/test_task.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/test_task.js b/blackberry10/node_modules/jake/lib/test_task.js
deleted file mode 100644
index 24e1ccf..0000000
--- a/blackberry10/node_modules/jake/lib/test_task.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-var path = require('path')
- , fs = require('fs')
- , exec = require('child_process').exec
- , currDir = process.cwd();
-
-/**
- @name jake
- @namespace jake
-*/
-/**
- @name jake.TestTask
- @constructor
- @description Instantiating a TestTask creates a number of Jake
- Tasks that make running tests for your software easy.
-
- @param {String} name The name of the project
- @param {Function} definition Defines the list of files containing the tests,
- and the name of the namespace/task for running them. Will be executed on the
- instantiated TestTask (i.e., 'this', will be the TestTask instance), to set
- the various instance-propertiess.
-
- @example
- var t = new jake.TestTask('bij-js', function () {
- this.testName = 'testSpecial';
- this.testFiles.include('test/**');
- });
-
- */
-var TestTask = function (name, definition) {
- var self = this;
-
- /**
- @name jake.TestTask#testNam
- @public
- @type {String}
- @description The name of the namespace to place the tests in, and
- the top-level task for running tests. Defaults to "test"
- */
- this.testName = 'test';
-
- /**
- @name jake.TestTask#testFiles
- @public
- @type {jake.FileList}
- @description The list of files containing tests to load
- */
- this.testFiles = new jake.FileList();
-
- /**
- @name jake.TestTask#showDescription
- @public
- @type {Boolean}
- @description Show the created task when doing Jake -T
- */
- this.showDescription = true;
-
- if (typeof definition == 'function') {
- definition.call(this);
- }
-
- if (this.showDescription) {
- desc('Run the tests for ' + name);
- }
- task(this.testName, function () {
- var t = jake.Task[self.testName + ':run'];
- t.invoke.apply(t, arguments);
- }, {async: true});
-
- namespace(self.testName, function () {
-
- task('run', function (pat) {
- var p = pat || '.*'
- , re
- , testFiles;
-
- // Don't nest; make a top-level namespace. Don't want
- // re-calling from inside to nest infinitely
- jake.currentNamespace = jake.defaultNamespace;
-
- re = new RegExp(pat);
- testFiles = self.testFiles.toArray().filter(function (f) {
- return (re).test(f);
- });
-
- // Create a namespace for all the testing tasks to live in
- namespace(self.testName + 'Exec', function () {
- // Each test will be a prereq for the dummy top-level task
- var prereqs = []
- // Continuation to pass to the async tests, wrapping `continune`
- , next = function () {
- complete();
- }
- // Create the task for this test-function
- , createTask = function (name, action) {
- // If the test-function is defined with a continuation
- // param, flag the task as async
- isAsync = !!action.length;
-
- // Define the actual namespaced task with the name, the
- // wrapped action, and the correc async-flag
- task(name, createAction(name, action), {
- async: isAsync
- });
- }
- // Used as the action for the defined task for each test.
- , createAction = function (n, a) {
- // A wrapped function that passes in the `next` function
- // for any tasks that run asynchronously
- return function () {
- var cb
- , msg;
- if (a.length) {
- cb = next;
- }
- if (!(n == 'before' || n == 'after')) {
- if (n.toLowerCase().indexOf('test') === 0) {
- msg = n;
- }
- else {
- msg = 'test ' + n;
- }
- jake.logger.log(n);
- }
- // 'this' will be the task when action is run
- return a.call(this, cb);
- };
- }
- // Dummy top-level task for everything to be prereqs for
- , topLevel;
-
- // Pull in each test-file, and iterate over any exported
- // test-functions. Register each test-function as a prereq task
- testFiles.forEach(function (file) {
- var exp = require(path.join(currDir, file))
- , name
- , action
- , banner
- , isAsync;
-
- // Create a namespace for each filename, so test-name collisions
- // won't be a problem
- namespace(file, function () {
-
- // For displaying file banner
- banner = '*** Running ' + file + ' ***';
- prereqs.push(self.testName + 'Exec:' + file + ':' + banner);
- // Create the task
- createTask(banner, function () {});
-
- if (typeof exp.before == 'function') {
- prereqs.push(self.testName + 'Exec:' + file + ':before');
- // Create the task
- createTask('before', exp.before);
- }
-
- // Walk each exported function, and create a task for each
- for (var p in exp) {
- if (p == 'before' || p == 'after') {
- continue;
- }
- // Add the namespace:name of this test to the list of prereqs
- // for the dummy top-level task
- prereqs.push(self.testName + 'Exec:' + file + ':' + p);
- // Create the task
- createTask(p, exp[p]);
- }
-
- if (typeof exp.after == 'function') {
- prereqs.push(self.testName + 'Exec:' + file + ':after');
- // Create the task
- createTask('after', exp.after);
- }
-
- });
- });
-
- // Create the dummy top-level task. When calling a task internally
- // with `invoke` that is async (or has async prereqs), have to listen
- // for the 'complete' event to know when it's done
- topLevel = task('__top__', prereqs);
- topLevel.addListener('complete', function () {
- jake.logger.log('All tests ran successfully');
- complete();
- });
-
- topLevel.invoke(); // Do the thing!
- });
-
-
- }, {async: true});
- });
-
-
-};
-
-jake.TestTask = TestTask;
-exports.TestTask = TestTask;
-
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/utils/index.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/utils/index.js b/blackberry10/node_modules/jake/lib/utils/index.js
deleted file mode 100644
index 389e9c3..0000000
--- a/blackberry10/node_modules/jake/lib/utils/index.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Jake JavaScript build tool
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed 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.
- *
-*/
-
-
-var util = require('util') // Native Node util module
- , exec = require('child_process').exec
- , spawn = require('child_process').spawn
- , EventEmitter = require('events').EventEmitter
- , utils = require('utilities')
- , logger = require('./logger')
- , Exec;
-
-var parseArgs = function (argumentsObj) {
- var args
- , arg
- , cmds
- , callback
- , opts = {
- interactive: false
- , printStdout: false
- , printStderr: false
- , breakOnError: true
- };
-
- args = Array.prototype.slice.call(argumentsObj);
-
- cmds = args.shift();
- // Arrayize if passed a single string command
- if (typeof cmds == 'string') {
- cmds = [cmds];
- }
- // Make a copy if it's an actual list
- else {
- cmds = cmds.slice();
- }
-
- // Get optional callback or opts
- while((arg = args.shift())) {
- if (typeof arg == 'function') {
- callback = arg;
- }
- else if (typeof arg == 'object') {
- utils.mixin(opts, arg);
- }
- }
-
- // Backward-compat shim
- if (typeof opts.stdout != 'undefined') {
- opts.printStdout = opts.stdout;
- delete opts.stdout;
- }
- if (typeof opts.stderr != 'undefined') {
- opts.printStderr = opts.stderr;
- delete opts.stderr;
- }
-
- return {
- cmds: cmds
- , opts: opts
- , callback: callback
- }
-};
-
-/**
- @name jake
- @namespace jake
-*/
-utils.mixin(utils, new (function () {
- /**
- @name jake.exec
- @static
- @function
- @description Executes shell-commands asynchronously with an optional
- final callback.
- `
- @param {String[]} cmds The list of shell-commands to execute
- @param {Object} [opts]
- @param {Boolean} [opts.printStdout=false] Print stdout from each command
- @param {Boolean} [opts.printStderr=false] Print stderr from each command
- @param {Boolean} [opts.breakOnError=true] Stop further execution on
- the first error.
- @param {Function} [callback] Callback to run after executing the
- commands
-
- @example
- var cmds = [
- 'echo "showing directories"'
- , 'ls -al | grep ^d'
- , 'echo "moving up a directory"'
- , 'cd ../'
- ]
- , callback = function () {
- console.log('Finished running commands.');
- }
- jake.exec(cmds, {stdout: true}, callback);
- */
- this.exec = function (a, b, c) {
- var parsed = parseArgs(arguments)
- , cmds = parsed.cmds
- , opts = parsed.opts
- , callback = parsed.callback;
-
- var ex = new Exec(cmds, opts, callback);
-
- if (!opts.interactive) {
- if (opts.printStdout) {
- ex.addListener('stdout', function (data) {
- console.log(utils.string.rtrim(data.toString()));
- });
- }
- if (opts.printStderr) {
- ex.addListener('stderr', function (data) {
- console.log(utils.string.rtrim(data.toString()));
- });
- }
- }
- ex.addListener('error', function (msg, code) {
- if (opts.breakOnError) {
- fail(msg, code);
- }
- });
- ex.run();
-
- return ex;
- };
-
- this.createExec = function (a, b, c) {
- return new Exec(a, b, c);
- };
-
-})());
-
-Exec = function () {
- var parsed = parseArgs(arguments)
- , cmds = parsed.cmds
- , opts = parsed.opts
- , callback = parsed.callback;
-
- this._cmds = cmds;
- this._callback = callback;
- this._config = opts;
-};
-
-util.inherits(Exec, EventEmitter);
-
-utils.mixin(Exec.prototype, new (function () {
-
- var _run = function () {
- var self = this
- , sh
- , cmd
- , args
- , next = this._cmds.shift()
- , config = this._config
- , errData = '';
-
- // Keep running as long as there are commands in the array
- if (next) {
- this.emit('cmdStart', next);
-
- // Ganking part of Node's child_process.exec to get cmdline args parsed
- cmd = '/bin/sh';
- args = ['-c', next];
-
- if (process.platform == 'win32') {
- cmd = 'cmd';
- args = ['/c', next];
- }
-
- if (config.interactive) {
- sh = spawn(cmd, args, { stdio: [process.stdin, process.stdout, 'pipe']});
- }
- else {
- sh = spawn(cmd, args, { stdio: [process.stdin, 'pipe', 'pipe'] });
- // Out
- sh.stdout.on('data', function (data) {
- self.emit('stdout', data);
- });
- }
-
- // Err
- sh.stderr.on('data', function (data) {
- var d = data.toString();
- self.emit('stderr', data);
- // Accumulate the error-data so we can use it as the
- // stack if the process exits with an error
- errData += d;
- });
-
- // Exit, handle err or run next
- sh.on('exit', function (code) {
- var msg;
- if (code != 0) {
- msg = errData || 'Process exited with error.';
- msg = utils.string.trim(msg);
- self.emit('error', msg, code);
- }
- if (code == 0 || !config.breakOnError) {
- self.emit('cmdEnd', next);
- _run.call(self);
- }
- });
-
- }
- else {
- self.emit('end');
- if (typeof self._callback == 'function') {
- self._callback();
- }
- }
- };
-
- this.append = function (cmd) {
- this._cmds.push(cmd);
- };
-
- this.run = function () {
- _run.call(this);
- };
-
-})());
-
-utils.Exec = Exec;
-utils.logger = logger;
-
-module.exports = utils;
-
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/lib/utils/logger.js
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/lib/utils/logger.js b/blackberry10/node_modules/jake/lib/utils/logger.js
deleted file mode 100644
index 71e0d13..0000000
--- a/blackberry10/node_modules/jake/lib/utils/logger.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var util = require('util');
-
-var logger = new (function () {
- var _output = function (type, out) {
- var quiet = typeof jake != 'undefined' && jake.program &&
- jake.program.opts && jake.program.opts.quiet
- , msg;
- if (!quiet) {
- msg = typeof out == 'string' ? out : util.inspect(out);
- console[type](msg);
- }
- };
-
- this.log = function (out) {
- _output('log', out);
- };
-
- this.error = function (out) {
- _output('error', out);
- };
-
-})();
-
-module.exports = logger;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/3016473f/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE
----------------------------------------------------------------------
diff --git a/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE b/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE
deleted file mode 100644
index 05a4010..0000000
--- a/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.