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

Change cordova-lib to execute plugin hooks without the need of Cordova project structure #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

galexandrov
Copy link
Contributor

Change cordova-lib to execute plugin hooks defined in plugin.xml without the need of Cordova project structure and extend Plugman with extra command argument (--nohooks) for preventing plugin hooks execution. By default the hooks will be executed.

@galexandrov galexandrov force-pushed the galexandrov/plugman-hooks branch 4 times, most recently from 7066b38 to 9c1936b Compare June 11, 2015 05:47
@omefire
Copy link
Contributor

omefire commented Jul 17, 2015

What's the reason behind this proposed change ? What use case does this fulfill ?

@galexandrov
Copy link
Contributor Author

In our case we don't use the Cordova CLI we use cordova-{platform} scripts for project creation and that's why we don't have the Cordova CLI Project structure. But it seems that the hooks execution is tightly bound with the Cordova Project structure and more specific with the existence of cordova folder.
The condition for hook execution in plugman is cordovaUtil.isCordova(), which means that when we use cordova-{platform} scripts for project creation and cordova-plugman for plugin management the hooks defined in plugin.xml will not be executed.

isCordova() method implementation

@galexandrov
Copy link
Contributor Author

ping @omefire

@omefire
Copy link
Contributor

omefire commented Aug 13, 2015

@galexandrov , will take a look when possible...

function CordovaHooksRunner(projectRoot) {
DefaultHooksRunner.call(this, projectRoot);
var root = cordovaUtil.isCordova(projectRoot);
if (!root) throw new CordovaError('Not a Cordova project ("' + projectRoot + '"), can\'t use hooks.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:nit please use if (...) { } else { } (with curly braces).

@omefire
Copy link
Contributor

omefire commented Aug 16, 2015

I feel like the plugman changes ( run_hooks ) should be part of a separate pull request.

@stevengill
Copy link
Contributor

I'd like to revive this PR. Hooks should run when using create scripts + plugman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants