Skip to content

plugin.xml <dependency> tag commit attribute doesn't work as documented for branches #830

@Lindsay-Needs-Sleep

Description

@Lindsay-Needs-Sleep

Bug Report

Problem

The documentation on how to use plugin.xml dependency tag does not match usage.
Either there is a bug in cordova-lib or the documentation is incorrect.

Here is the documentation:
image

What is expected to happen?

When installing a plugin that has this dependency tag in plugin.xml:

<dependency id="cordova-plugin-ionic-webview" url="https://github.com/miloproductionsinc/cordova-plugin-ionic-webview.git" commit="2.x-custom" />

I expect that most recent version on branch 2.x-custom should be retrieved.

What does actually happen?

Instead it seems to ignore the commit attribute and fetches the master branch. Here is the log:

Plugin dependency "cordova-plugin-ionic-webview" not fetched, retrieving then installing.
fetch: Installing https://github.com/miloproductionsinc/cordova-plugin-ionic-webview.git to S:\Projects\MiloProductions\hello
Running command: npm install https://github.com/miloproductionsinc/cordova-plugin-ionic-webview.git --production --save

Information

Interestingly, this does produce the desired result:

<dependency id="cordova-plugin-ionic-webview" url="https://github.com/miloproductionsinc/cordova-plugin-ionic-webview.git#2.x-custom" />

Environment, Platform, Device

windows building android
mac building ios

Version information

cordova 9.0.0
cordova-lib 9.0.1

Any plugin with this type of dependancy should demonstrate this problem, but in this case, my examples are retrieving:

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions