Closed knight9999 closed 6 years ago
Thanks ! Before merging it, I'm just going to check with the Cordova team if it is possible to expose this function. I don't understand why it's not the case and this will prevent us to copy/paste their sources.
I see. Exposing the function getPlatVersionsFromFileSystem
is usable.
For me/us would this Pull Request be also pretty important because we need to use the master branch for cordova-ios because there are fixes regarding XCode 9 and they are not sure when a new version of cordova-ios will be released.
This probably fixes #43
You're right ! I'm fixing the conflicts and merge this one.
Squashed and merged manually. thx @knight9999 and sorry for the late.
This PR is like https://github.com/akofman/cordova-plugin-add-swift-support/pull/35.
Instead of the webpack dependent method
__non_webpack_require__
, This PR uses thegetPlatVersionsFromFileSystem
method which is same as the one defined in cordova-lib/platform_metadata.js.PR #35 is the following.
iOSPlatform version should be the semver form, like "4.4.0". However, If the user add platform ios by using the directory name or git:// case, like
cordova platform add /Home/user/cordova/ios/cordova-ios4.4.0
The iOSPlatform version is Home/user/cordova/ios/cordova-ios4.4.0 not 4.4.0. (See https://github.com/apache/cordova-lib/blob/master/src/cordova/platform_metadata.js and its comment above the getVersions method)
In such case, this plugin hook script does not work.
This pull request, the correct iOSPlatform version is obtained by accessing platform/ios/cordova/version file.