cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Omar Mefire (JIRA)" <>
Subject [jira] [Commented] (CB-9434) before_build hook does not fire on run
Date Sun, 16 Aug 2015 15:00:46 GMT


Omar Mefire commented on CB-9434:

This issue is due to the fact that we have two modules (cordova-lib and cordova-<platform>)
that are involved in achieving this :
- cordova-lib is responsible for running the hooks and then delegating the implementation
of build/run/etc... to the underlying platform.

In the case of 'run', we delegate directly to the platform, and the platform is in charge
of running a build before the deployment to the target (emulator/device). Because the run
doesn't happen at the cordova-lib level, there is no way for the platform to run the build
hooks supplied.

Solving this would require rearchitecting the way cordova-lib and cordova-platform work in
the case of the compile, build & run commands.

I don't see this to be enough of a pain to justify that sweeping amount of changes. so, I'll
hold off on making any modifications. Besides, you've got a workaround, :)

> before_build hook does not fire on run
> --------------------------------------
>                 Key: CB-9434
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 5.1.1
>            Reporter: Frank J. Gómez
>            Assignee: Omar Mefire
>            Priority: Minor
> Steps to reproduce:
> * Create hooks/before_build/010_test.js. Have it simply output some text to the console.
> * Do: {noformat}cordova build <platform>{noformat} The expected text is present.
> * Do: {noformat}cordova run <platform>{noformat} My expectation is that the text
would be outputted, since "run" is more or less a wrapper around "prepare," "build," and some
other commands. However, the text is not outputted.
> Workaround:
> * Do: {noformat}cordova build <platform>{noformat} The hook runs, and the app is
> * Do: {noformat}cordova run <platform> --nobuild{noformat} The app built in the
previous step is deployed to the phone/emulator.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message