thaliproject / postcardapp

A sample app to demonstrate how to build Thali applications
MIT License
22 stars 5 forks source link

Gulp build callbacks too soon with cordova hook script #99

Closed deadlyfingers closed 8 years ago

deadlyfingers commented 8 years ago

Gulp is calling the task completed callback just before gulp build process is 100% completed.

Might also want to look at updating to Gulp v4 and using series tasks.

deadlyfingers commented 8 years ago

To build the project for the first time it is best to run gulp build script first:

gulp build
cordova build

One of the gulp tasks is returning the callback too soon.

deadlyfingers commented 8 years ago

It appears 'task_stop' is being fired after first gulp task is complete. But I want to wait until all tasks are completed in the gulp runSequence. This may well work better once gulp 4.0 is released with ability to run a series of tasks using bach.

Until then another option is to use a semaphore file to say all gulp tasks are finally completed and have the Cordova node script check for that then issue the deferral.resolve();.