-
Notifications
You must be signed in to change notification settings - Fork 28
CB-13145: proposal for Play Services Version #74
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
Open
audreyso
wants to merge
3
commits into
apache:master
Choose a base branch
from
audreyso:CB-13145_proposal
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Play Services Version Proposal | ||
|
||
- Status: Proposed | ||
|
||
## Overview | ||
This is a proposal to offer an alternative solution for [CB-13145](https://issues.apache.org/jira/browse/CB-13145). | ||
|
||
## Problem | ||
Plugins using different versions of Google Play Services or the `+` to indicate range cause gradle to error out with the following error: | ||
|
||
``` | ||
> Failed to apply plugin [id 'com.google.gms.google-services'] | ||
> For input string: "+" | ||
``` | ||
|
||
## Potential Solution | ||
Currently, the proposed solution is to create an Android only preference in `config.xml` to control the version of Google Play Services for the whole project. For instance, `config.xml` would look like this: | ||
`<preference name = "PlayServicesVersion" value = "11.0.0"/>` | ||
|
||
Then if, for example, the `phonegap-plugin-push` wanted to include FCM libraries in `plugin.xml`, it would contain: | ||
`<framework src="com.google.firebase:firebase-messaging:$PlayServicesVersion"/>` | ||
|
||
If the `cordova-plugin-google-analytics` wanted to include Play Services in its `plugin.xml` it would contain: | ||
`<framework src="com.google.android.gms:play-services-analytics:$PlayServicesVersion"/>` | ||
|
||
These plugins would both use the same version of Google Play Services. This gets around the problem of plugins using `+` in the framework tag (which isn't supported anymore) or having the two plugins pin different versions of Play Services (gradle errors with that). | ||
|
||
## Proposal | ||
We want to use a generic way to define variables in `config.xml` that `plugin.xml` can use. We propose extending the variable tag. Below is the current variable tag. | ||
|
||
``` | ||
<plugin name="cordova-plugin-device" spec="^1.1.0"> | ||
<variable name="MY_VARIABLE" value="my_variable_value" /> | ||
</plugin> | ||
|
||
``` | ||
|
||
The current variable tag goes in and finds `MY_VARIABLE` in `plugin.xml` of `cordova-plugin-device` and replaces it with the value. | ||
|
||
In order to extend the variable tag, we will need to: | ||
|
||
1. Allow the variable tag to be declared outside of a plugin tag (not nested/root level). | ||
|
||
``` | ||
<variable name="MY_VARIABLE" value="my_variable_value" /> | ||
``` | ||
|
||
2. Run it against every plugin as it is getting installed. | ||
|
||
The original solution assumes that both plugin authors are using the same preference name (PlayServicesVersion) and expects the application author to add it to the `config.xml`. | ||
|
||
The plugin should auto add the variable it needs to `config.xml` if a default isn't there. So assuming we want `<variable name="PlayServicesVersion" value="11.0.1" />` in `config.xml`, it would get auto added by `plugin.xml` if it doesn't already exist. If it does exist, don't touch it. | ||
|
||
We are still dependent on the plugin authors to use the standardized variables. So in this case, both plugin authors would have to use PlayServicesVersion in their plugin.xml | ||
|
||
|
||
## Links | ||
* https://issues.apache.org/jira/browse/CB-13145 | ||
* http://cordova.apache.org/docs/en/latest/config_ref/index.html |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to clarify this is one potential solution. The one from the issue. But the new proposal is actually below.