3

I'm building application using Cordova (PhoneGap). The directory structure it create is I have my source code in www root and when I add iOS platform it generate the required XCode project in platforms/ios/

As far as I can tell all the content of platforms/ios is automatically generated so it should not be committed, right?

The problem is it looks like cordova command line tool is not built to read and "rebuild" the platforms directory according to platforms/platforms.json

The problem is that when another developer or the CI server will checkout the project from git they will not be able to simply run 'cordova build' and have the project built.

I have workaround this problem by adding shell-scripts that run the following commands:

cordova platform remove ios
cordova platform add ios

The problem it is getting more compilcated as I have plugins so I also have to add script to add them. I expected platforms.json act like package.json file in node and have cordova re-generate the files.

Ido Ran
  • 10,584
  • 17
  • 80
  • 143
  • 3
    Code which is auto-generated during your regular build normally isn't part of version control. – Tim Biegeleisen Jul 12 '15 at 07:58
  • 1
    I agree, the problem is I don't understand the right workflow of cordova if I do not check in the platoforms/ios directory – Ido Ran Jul 12 '15 at 09:24
  • 1
    Could you update your question with the current Git workflow? Perhaps that will make it easier to answer your question. What would be wrong with not having Git track autogenerated code? – Tim Biegeleisen Jul 12 '15 at 10:07
  • 2
    Quite a few answers to a similar question here: http://stackoverflow.com/questions/17911204/gitignore-for-phonegap-cordova-3-0-projects-what-should-i-commit - voting to close as duplicate. Please check whether the answers over there cover your question... – nwinkler Jul 13 '15 at 11:49
  • 1
    I found an excellent, current answer at: http://stackoverflow.com/a/29972835/1283667 – brodybits Feb 26 '16 at 07:56

0 Answers0