Best practise for Cordova apps. Include platforms directory?

I have a number of Cordova apps being built by Bitrise but I still don’t think that I have achieved the perfect process. We currently have ignored all of the compiled ‘platforms’ directory except for the .xcodeproj because it needed to save the project setup when more than one dev works on the project. Is this correct?

Unfortunately cordova doesn’t like it when these files already exist when adding platforms, a step that is run on each Bitrise build. FYI, I am using fastlane + match, gym & cert as well.

What files should I be ignoring/adding to my repo. What other tips do you have to improve my build process? Any other advice on the best approach would be gratefully received.

Cheers, Zander

1 Like

So far this is the best setup we could come up with:

I know it’s for Ionic 2, but the same things apply for Cordova (AFAIK), as the Xcode project is generated by Cordova, Ionic (again, as far as I know) just wraps these cordova CLI calls.

Note: the key to make the cordova/ionic generated Xcode project to work with Xcode 8 is to force a team id and “iPhone Developer” as the identity:

If you have any questions, just let us know! Also, if someone else has a better setup / some insights, please share it with us!

Hi @viktorbenei, thanks for your help and the link. As I mentioned already, my build uses fastlane and some of it’s tools, which generates the ipa I need for which is then passed to Appaloosa. I don’t think I need to switch out this part of the build, but I do want to clarify if the platforms directory is ignored by git for the build that you linked to, can you answer that?

Yes it is ignored, it’s always generated during the build (in the linked How To / config), but because the cordova/ionic generated Xcode project is not compatible with Xcode 8’s new code signing mechanism you need to force the Team ID and the Code Signing Identity (as you can see it at:[quote=“viktorbenei, post:2, topic:885”]
Note: the key to make the cordova/ionic generated Xcode project to work with Xcode 8 is to force a team id and “iPhone Developer” as the identity
[/quote]
)

How you can force that depends on the tool, our example demonstrates how you can do it with our Xcode Archive step.

Thanks @viktorbenei. I think my process although different works just the same, I just needed to remove/ignore the platforms directory.

1 Like

Correct, there’s nothing Bitrise specific here, forcing the Team ID and Identity is done through passing these as parameters for the xcodebuild Xcode command line tool which does the archive. How you can do that (to pass these params) depends on the tool.