Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-16153] Fixed up the various hook calls to use the correct API and... #5206

Merged
merged 1 commit into from
Jan 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 10 additions & 14 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,8 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
}, conf.options['store-password']);
delete conf.options.password.abbr;

callback(_t.conf = conf);
})(function (err, results, result) {
callback(null, _t.conf = conf);
})(function (err, result) {
finished(result);
});
}.bind(this);
Expand Down Expand Up @@ -2564,13 +2564,13 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) {
path.join(this.platformPath, titaniumPrep),
args,
opts,
function (err, results, error) {
if (!error) {
function (err) {
if (!err) {
return next();
}

if (process.platform != 'win32') {
fatal(error);
fatal(err);
}

// windows 64-bit failed, try again using 32-bit
Expand All @@ -2580,9 +2580,9 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) {
path.join(this.platformPath, titaniumPrep),
args,
opts,
function (err, results, error) {
if (error) {
fatal(error);
function (err) {
if (err) {
fatal(err);
}
next();
}
Expand Down Expand Up @@ -3978,9 +3978,7 @@ AndroidBuilder.prototype.writeBuildManifest = function writeBuildManifest(callba
this.cli.createHook('build.android.writeBuildManifest', this, function (manifest, cb) {
fs.existsSync(this.buildDir) || wrench.mkdirSyncRecursive(this.buildDir);
fs.existsSync(this.buildManifestFile) && fs.unlinkSync(this.buildManifestFile);
fs.writeFile(this.buildManifestFile, JSON.stringify(this.buildManifest = manifest, null, '\t'), function () {
cb();
});
fs.writeFile(this.buildManifestFile, JSON.stringify(this.buildManifest = manifest, null, '\t'), cb);
})({
target: this.target,
deployType: this.deployType,
Expand Down Expand Up @@ -4014,9 +4012,7 @@ AndroidBuilder.prototype.writeBuildManifest = function writeBuildManifest(callba
servicesHash: this.servicesHash,
jssFilesHash: this.jssFilesHash,
jarLibHash: this.jarLibHash
}, function (err, results, result) {
callback();
});
}, callback);
};

// create the builder instance and expose the public api
Expand Down
4 changes: 1 addition & 3 deletions android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ exports.init = function (logger, config, cli) {
})(builder.deviceId, {
logger: logger,
checkMounts: builder.debugPort || builder.profilerPort
}, function (err, results, opts) {
finished();
});
}, finished);

} else if (builder.target == 'device') {
var adb = new ADB(config);
Expand Down
4 changes: 2 additions & 2 deletions cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ exports.config = function (logger, config, cli) {
}, ti.commonOptions(logger, config)),
platforms: platformConf
};
callback(conf);
callback(null, conf);
});
})(function (err, results, result) {
})(function (err, result) {
finished(result);
});
};
Expand Down
4 changes: 2 additions & 2 deletions cli/commands/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.desc = __('removes previous build directories');
exports.config = function (logger, config, cli) {
return function (finished) {
cli.createHook('clean.config', function (callback) {
callback({
callback(null, {
options: appc.util.mix({
platform: {
// this is for backwards compatibility and eventually should be dropped
Expand All @@ -40,7 +40,7 @@ exports.config = function (logger, config, cli) {
}
}, ti.commonOptions(logger, config))
});
})(function (err, results, result) {
})(function (err, result) {
finished(result);
});
};
Expand Down
14 changes: 5 additions & 9 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ iOSBuilder.prototype.config = function config(logger, config, cli) {
var provisioningProfileLookup = {};

cli.createHook('build.ios.config', function (callback) {
callback({
callback(null, {
flags: {
'force-copy': {
desc: __('forces files to be copied instead of symlinked for %s builds only', 'simulator'.cyan)
Expand Down Expand Up @@ -766,8 +766,8 @@ iOSBuilder.prototype.config = function config(logger, config, cli) {
}
}
});
})(function (err, results, result) {
done(_t.conf = result);
})(function (err, result) {
done(result);
});
}.bind(this));
}.bind(this));
Expand Down Expand Up @@ -2090,9 +2090,7 @@ iOSBuilder.prototype.writeBuildManifest = function writeBuildManifest(next) {
this.cli.createHook('build.ios.writeBuildManifest', this, function (manifest, cb) {
fs.existsSync(this.buildDir) || wrench.mkdirSyncRecursive(this.buildDir);
fs.existsSync(this.buildManifestFile) && fs.unlinkSync(this.buildManifestFile);
fs.writeFile(this.buildManifestFile, JSON.stringify(this.buildManifest = manifest, null, '\t'), function () {
cb();
});
fs.writeFile(this.buildManifestFile, JSON.stringify(this.buildManifest = manifest, null, '\t'), cb);
})({
target: this.target,
deployType: this.deployType,
Expand All @@ -2118,9 +2116,7 @@ iOSBuilder.prototype.writeBuildManifest = function writeBuildManifest(next) {
forceCopy: !!this.forceCopy,
forceCopyAll: !!this.forceCopyAll,
encryptJS: !!this.encryptJS
}, function (err, results, result) {
next();
});
}, next);
};

iOSBuilder.prototype.compileI18NFiles = function compileI18NFiles(next) {
Expand Down
4 changes: 2 additions & 2 deletions mobileweb/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ UglifyJS.AST_Node.warn_function = function () {};
exports.config = function (logger, config, cli) {
return function (finished) {
cli.createHook('build.mobileweb.config', function (callback) {
callback({
callback(null, {
options: {
'deploy-type': {
abbr: 'D',
Expand All @@ -54,7 +54,7 @@ exports.config = function (logger, config, cli) {
}
}
});
})(function (err, results, result) {
})(function (err, result) {
finished(result);
});
};
Expand Down