Skip to content

Commit

Permalink
feat(ios): emit build hook during module build before launching test app
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Oct 15, 2020
1 parent 403d7e2 commit 8778f3f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions iphone/cli/commands/_buildModule.js
Expand Up @@ -157,7 +157,9 @@ iOSModuleBuilder.prototype.run = function run(logger, config, cli, finished) {
this.verifyBuildArch().then(next, next);
},
'packageModule',
'runModule',
function (next) {
this.runModule(cli, next);
},

function (next) {
cli.emit('build.module.post.compile', this, next);
Expand Down Expand Up @@ -967,7 +969,7 @@ iOSModuleBuilder.prototype.packageModule = function packageModule(next) {
}
};

iOSModuleBuilder.prototype.runModule = function runModule(next) {
iOSModuleBuilder.prototype.runModule = function runModule(cli, next) {
if (this.buildOnly) {
return next();
}
Expand Down Expand Up @@ -1052,6 +1054,11 @@ iOSModuleBuilder.prototype.runModule = function runModule(next) {
proc.on('exit', () => cb());
},

// Emit hook so modules can also alter project before launch
function (cb) {
cli.emit('create.module.app.finalize', [ this, tmpProjectDir ], cb);
},

function (cb) {
// 6. run the app
this.logger.debug(__('Running example project...', tmpDir.cyan));
Expand Down

0 comments on commit 8778f3f

Please sign in to comment.