Search code examples
ioscordovacommand-line-interfacephonegap-buildhybrid-mobile-app

How to configure Cordova CLI to use custom project template repo for given platform?


Cordova CLI is simple:

cordova platform add ios

Plus you can append @<VERSION_TAG> and so use a different version. But my goal is to have something like this:

cordova platform add ios@https://github.com/<MY_FORK>/cordova-ios.git@<MY_VERSION_TAG/BRANCH>

So platform add command will use my fork instead of https://github.com/apache/cordova-ios.git. Cordova CLI doesn't seem to allow this type of weird statement, but is there (where?) a way to customise it somehow to use a different repo URL for the Cordova platform?


Solution

  • Ok, I got it,

    I found it while traversing Cordova-CLI files and then Cordova-Lib. Here's the answer:

    cordova platform add git-url#custom-branch

    And here is the source: https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/platform.js