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

Support Optional Android Dependencies For Plugin controlled via command line inputs #332

Open
root-ansh opened this issue May 17, 2022 · 0 comments

Comments

@root-ansh
Copy link

Feature Request

Support Optional Android Dependencies For Plugin controlled via command line inputs

Motivation Behind Feature

This will allow us to develop cordova plugins that depend on multiple optional libraries. in android we can develop 2 separate libraries a & b , where a can check whether the user has included b library, and if so, can change its working accordingly.

Feature Description

in cordova, if i have defined the following preference in my plugin.xml:

<preference name="FIREBASE_MESSAGING_VERSION" default="21.0.0"/>

then the users of my plugin can pass this variable while adding the plugin as :

cordova plugin add https://github.com/root-ansh/my-plugin --variable FIREBASE_MESSAGING_VERSION="20.4.0" 

furthermore, in my plugin.xml , i am able to use this version as :

<framework src="com.google.firebase:firebase-messaging:$FIREBASE_MESSAGING_VERSION" />

what we need is

  1. to restrict user to use versions above 21.0.0 (which i think will be covered in next point)
  2. to have 'optional' depenedencies . like if i take a boolean variable ADD_ANALYTICS_SDK as input during plugin installation, then i should be able to add an additional , optional framework, something like this :
<rule>
    <if>
        <conditions>
            <condition var="ADD_ANALYTICS_SDK" >$ADD_ANALYTICS_SDK</condition>
        </conditions>
        <statements>
            <framework src="com.google.firebase:firebase-analytics:21.0.0" />
        </statements>
    </if>
</rule>

is something like this possible for plugin.xml ?

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

No branches or pull requests

1 participant