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

Cordova project ignores build-extras after toolchain upgrade #552

Closed
DavidWiesner opened this issue Nov 14, 2018 · 9 comments
Closed

Cordova project ignores build-extras after toolchain upgrade #552

DavidWiesner opened this issue Nov 14, 2018 · 9 comments
Labels

Comments

@DavidWiesner
Copy link
Contributor

DavidWiesner commented Nov 14, 2018

After upgrade my project from cordova-android 6.4 to 7.1.2 my build-extras.gradle get not applied anymore. I checked the documentation for changes but there is still mentioned to place the build-extras.gradle file to platforms/android/.

When I place my build-extras.gradle file to platforms/android/app/ all work like expected.

@DavidWiesner DavidWiesner changed the title Cordova CLI project ignores build-extras after toolchain upgrade Cordova project ignores build-extras after toolchain upgrade Nov 14, 2018
@janpio janpio added the bug label Nov 14, 2018
@brodybits
Copy link
Contributor

Please show exactly exactly what you did in plugin.xml for both 6.4 and 7.1.2. I think we will have to fix bin/templates/cordova/lib/pluginHandlers.js to resolve this issue without introducing a breaking change.

A major bonus is if you can show us a plugin we can use to test the solution.

@DavidWiesner
Copy link
Contributor Author

In my case I did nothing with plugins. I just add a platforms/android/build-extras.gradle file manually adding some dependencies.

Steps for reproduce:

  1. add a platforms/android/build-extras.gradle file with this content
ext.postBuildExtras = { println('### build-extras.gradle called ###') }
  1. run cordova build android
  2. no ### build-extras.gradle called ### was printed in the console

adding the same file to platforms/android/app/ will print the line

@brodybits
Copy link
Contributor

That is because the Android project structure was changed in 7.0. I just raised apache/cordova-docs#905 to update the documentation.

@DavidWiesner
Copy link
Contributor Author

I know the structure has changed. But why also change the location of the build-extras.gradle? All other configuration files e.g.: release-signing.properties are still referenced from the old location: platforms/android/

brodybits pushed a commit to DavidWiesner/cordova-android that referenced this issue Nov 14, 2018
Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
@brodybits brodybits added the bug label Nov 14, 2018
@brodybits
Copy link
Contributor

I just pushed an update to PR #553 to check both locations.

@janpio
Copy link
Member

janpio commented Nov 14, 2018

But why also change the location of the build-extras.gradle?

That was probably overlooked when changing the project structure back in 7.x. You would have to go back to those commits where the other paths were handled and see if there maybe is a comment in the PR or commit message.

@DavidWiesner
Copy link
Contributor Author

Here is one issue (CB-13615) reflecting the new structure and changing the paths accordingly. But this is only for the signing configurations.

@brodybits
Copy link
Contributor

From the history it looks like the work was done in PR #389. It seems like they did try to preserve compatibility, but evidently it was not preserved 100%.

All other configuration files e.g.: release-signing.properties are still referenced from the old location: platforms/android/

I find that really interesting, just discovered that release-signing.properties is referenced by both bin/templates/project/app/build.gradle and bin/templates/project/legacy/build.gradle. I have no idea how or even if they would work together.

brodybits pushed a commit to brodybits/cordova-android that referenced this issue Nov 14, 2018
Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
@brodybits brodybits mentioned this issue Nov 14, 2018
7 tasks
brodybits pushed a commit that referenced this issue Nov 14, 2018
…ctory (#553)

as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle

and deal with multiple build-extras.gradle locations

Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
brodybits pushed a commit to brodybits/cordova-android that referenced this issue Nov 14, 2018
…t directory (apache#553)

as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle

and deal with multiple build-extras.gradle locations

Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
@brodybits
Copy link
Contributor

Closing since PR #553 was merged. This should be fixed in upcoming 7.1.3 release.

brodybits pushed a commit to brodybits/cordova-android that referenced this issue Nov 15, 2018
…t directory (apache#553)

as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle

and deal with multiple build-extras.gradle locations

Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
brodybits pushed a commit to brodybits/cordova-android that referenced this issue Nov 16, 2018
…t directory (apache#553)

as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle

and deal with multiple build-extras.gradle locations

Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
brodybits pushed a commit to brodybits/cordova-android that referenced this issue Nov 16, 2018
…t directory (apache#553)

as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle

and deal with multiple build-extras.gradle locations

Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants