cordova icon indicating copy to clipboard operation
cordova copied to clipboard

Plugin support for breaking Cordova platform changes

Open brody4hire opened this issue 6 years ago • 1 comments

Nice suggestion by @j3k0 in https://github.com/apache/cordova-android/issues/585 that it should be possible for plugins to support breaking platform changes.

Example by @j3k0, with edits by @brodybits:

<plugin ...>
  <platform type="android" version="*">
    <!-- common stuff here -->
  </platform>
  <platform type="android" version="<8.0.0">
    <!-- ... -->
    <source-file src="src/android/ILib.aidl" target-dir="src/com/android/vending/billing" />
    <!-- ... -->
  </platform>
  <platform type="android" version=">=8.0.0">
    <!-- ... -->
    <lib-file src="src/android/ILib.aidl" />
    <!-- ... -->
  </platform>
</plugin>

Keep in mind that I think version attribute should mean Cordova platform framework, not Cordova framework version, Android OS version, Android SDK version, etc. ~~I wonder if we can think of a smarter attribute name such as "platform-engine-version" or "cordova-platform-version" to make this clear?~~

I think it should be possible to do this in a way that cordova-common would abstract this mechanism away from the Cordova platforms.

I also think that the need to deal with such breaking changes should be considered an exceptional and avoided whenever practical.

P.S. The alternative to specify Cordova dependencies as described in https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html#specifying-cordova-dependencies means that a plugin author would have to support multiple versions in multiple branches in order to deal with breaking changes.

Related email forum thread: https://lists.apache.org/thread.html/68c60d9d31a4c3dcba7bb1a3da5672a4a860743f34e205baeb98ac4f@%3Cdev.cordova.apache.org%3E

brody4hire avatar Nov 26 '18 18:11 brody4hire

Keep in mind that I think version attribute should mean Cordova platform framework, not Cordova framework version, Android OS version, Android SDK version, etc. I wonder if we can think of a smarter attribute name such as "platform-engine-version" or "cordova-platform-version" to make this clear?

No need: It is the attribute version of the tag platform. You can't much more clear and specific.

janpio avatar Nov 26 '18 20:11 janpio