Skip to content

Commit

Permalink
build runs but tests borked
Browse files Browse the repository at this point in the history
  • Loading branch information
brianleroux committed Dec 11, 2013
1 parent 31aa751 commit 4e0ca1c
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function(grunt) {
options: {
jshintrc: '.jshintrc',
},
src: [ 'lib/**/*.js' ]
src: [ 'src/**/*.js' ]
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/blackberry10/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = function (success, fail, service, action, args) {
request.addParam(name, args[name]);
}
}

response = request.makeSyncCall();

if (response.code < 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/browser/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var cordova = require('cordova');
var execProxy = require('cordova/exec/proxy');

module.exports = function(success, fail, service, action, args) {

var proxy = execProxy.get(service, action);

if (proxy) {
Expand Down
4 changes: 2 additions & 2 deletions src/browser/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ module.exports = {
cordovaVersion: '3.4.0',

bootstrap: function() {

var moduleMapper = require('cordova/modulemapper');
var channel = require('cordova/channel');

moduleMapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');

channel.onPluginsReady.subscribe(function () {
channel.onNativeReady.fire();
});
Expand Down
2 changes: 1 addition & 1 deletion src/common/pluginloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {

function injectPluginScript(pathPrefix, finishPluginLoading) {
var pluginPath = pathPrefix + 'cordova_plugins.js';

if (urlutil.exists(pluginPath)) {
injectScript(pluginPath, function() {
try {
Expand Down
13 changes: 7 additions & 6 deletions tasks/lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@
* under the License.
*/
var fs = require('fs');
var path = require('path');
var collectFiles = require('./collect-files');
var copyProps = require('./copy-props');
var writeModule = require('./write-module');
var writeScript = require('./write-script');


module.exports = function bundle(platform, debug, commitId) {
var modules = collectFiles('lib/common')
var scripts = collectFiles('lib/scripts')
var modules = collectFiles('src/common')
var scripts = collectFiles('src/scripts')

modules[''] = 'lib/cordova.js'
copyProps(modules, collectFiles(path.join('lib', platform)));
modules[''] = 'src/cordova.js'
copyProps(modules, collectFiles(path.join('src', platform)));

if (platform === 'test') {
// FIXME why does 'test' resolve a bunch of android stuff?!
var testFilesPath = path.join('lib', 'android', 'android');
var testFilesPath = path.join('src', 'android', 'android');
copyProps(modules, collectFiles(testFilesPath, 'android/'));
}

Expand All @@ -42,7 +43,7 @@ module.exports = function bundle(platform, debug, commitId) {
output.push("// " + commitId);

// write header
var licensePath = path.join(__dirname, 'tasks', 'lib', 'LICENSE-for-js-file.txt');
var licensePath = path.join(__dirname, 'LICENSE-for-js-file.txt');
output.push('/*', fs.readFileSync(licensePath, 'utf8'), '*/');
output.push(';(function() {');
output.push("var CORDOVA_JS_BUILD_LABEL = '" + commitId + "';");
Expand Down
7 changes: 4 additions & 3 deletions tasks/lib/collect-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and lim
* under the License.
*/
var fs = require('fs');
var path = require('path');
var copyProps = require('./copy-props');
var fs = require('fs');
var path = require('path');
var copyProps = require('./copy-props');
var getModuleId = require('./get-module-id');


function collectFiles(dir, id) {
Expand Down
4 changes: 2 additions & 2 deletions tasks/lib/get-module-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
* under the License.
*/

module.exports = function getModuleId(fileName) {
return fileName.match(/(.*)\.js$/)[1]
module.exports = function getModuleId(filename) {
return filename.match(/(.*)\.js$/)[1]
}
5 changes: 3 additions & 2 deletions tasks/lib/write-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
* specific language governing permissions and lim
* under the License.
*/
var fs = require('fs');
var stripHeader = require('./strip-header');
var fs = require('fs');
var path = require('path');
var stripHeader = require('./strip-header');
var writeContents = require('./write-contents');


Expand Down
3 changes: 2 additions & 1 deletion tasks/lib/write-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* under the License.
*/

var fs = require('fs');
var fs = require('fs');
var writeContents = require('./write-contents');
var stripHeader = require('./strip-header');

module.exports = function writeScript(oFile, fileName, debug) {
var contents = fs.readFileSync(fileName, 'utf8');
Expand Down
1 change: 1 addition & 0 deletions tasks/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
var processWhiteSpace = require('./lib/process-white-space');
var fs = require('fs');

module.exports = function(grunt) {

Expand Down
5 changes: 3 additions & 2 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ var fs = require('fs'),
util = require('util'),
_path = require('path'),
tests = [],
packager = require('../build/packager'),
packager = require('./../tasks/lib/packager'),
exec = require('child_process').exec;

// FIXME this seems to be a copy of module in tasks/lib =/
function collect(path, files, matches) {
matches = matches || function (path) {
return path.match(/test\.(\w|-)+\.js$/);
Expand All @@ -43,7 +44,7 @@ function collect(path, files, matches) {
module.exports = {
node: function(callback) {
console.log('starting node-based tests')
var jas = require("../thirdparty/jasmine/jasmine"),
var jas = require("./../tasks/vendor/jasmine/jasmine"),
TerminalReporter = require('./reporter').TerminalReporter,
jsdom, document, window;

Expand Down

0 comments on commit 4e0ca1c

Please sign in to comment.