Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Issue #9 #10

Merged
merged 1 commit into from
Mar 8, 2019
Merged

Issue #9 #10

merged 1 commit into from
Mar 8, 2019

Conversation

merrygobyebye
Copy link

Description

Replace usage of ext.postBuildExtras with usage of cdvPluginPostBuildExtras.

Related Issue

Issue #9

Motivation and Context

This improves inter-compatibility with other Cordova plugins.

@chemerisuk
Copy link
Owner

chemerisuk commented Sep 10, 2018

Google recommends to apply this plugin in the bottom of grade file. That’s why I use postBuildExtras property.

Hopefully the project will be integrated into Cordova-android soon and it become deprecated. Read apache/cordova-android#438 (comment)

@merrygobyebye
Copy link
Author

@chemerisuk, both ext.postBuildExtras and cdvPluginPostBuildExtras are run at the bottom of the gradle file. See https://github.com/apache/cordova-android/blob/e9750b5cabe70b1fc9abfad28fd1239d9b9415c2/bin/templates/project/app/build.gradle#L316-L324.

As cdvPluginPostBuildExtras is an array, it can be used by many plugins. Each plugin simply adds its gradle code to this array. ext.postBuildExtras is only defined once, so it can only be used by one plugin. For example, if you have a Cordova project with this plugin and
https://github.com/blakgeek/cordova-plugin-flurryanalytics, they both use ext.postBuildExtras (you can see its usage here: https://github.com/blakgeek/cordova-plugin-flurryanalytics/blob/master/src/android/plugin.gradle). Only the last plugin to be added will have its gradle code run in ext.postBuildExtras, so either this plugin or cordova-plugin-flurryanalytics would not work properly.

@chemerisuk chemerisuk merged commit 7e8d275 into chemerisuk:master Mar 8, 2019
@chemerisuk
Copy link
Owner

It seems like apache/cordova-android#438 was not merged into the next cordova-android release. Therefore we have to continue to use this plugin.

Let's merge this PR and include changes into the next minor release.

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

Successfully merging this pull request may close these issues.

3 participants