Cocos Creator. Sharing native projects between different machines

It’s ok to work with android studio and xcode project from one machine. Cocos Creator generates project once. And after that it’s possible to add some new classes or modify project files.
But android studio and xcode project are depended from Cocos Creator installation. Paths are absolute. It doesn’t work on other machine. Because on different machine Cocos Creator installation path is different.
Add all projects with all native code to ignore list is not a solution. All progress in native projects will be lost.
How to work in Cocos Creator with native projects? How to share progress between multiple users?

This community is pretty silent. But I need to leave this here. It can helps someone.

The bottom line is to use default template instead of link template

More detailed information:

  • In Cocos Creator open build window (Project->Build…)
  • For template option choose default (Yes. default is not default option. Default option is link)
  • link option - cocos2d-x sources will be referenced as absolute paths in the projects
  • default option - cocos2d-x sources will be added to the build directory

How we share native projects in our team:

  • By default, native projects are builded into the build directory which is in the ignore list. We changed the build path for native project.
  • cocos2d-x sources are big. We added it to the .gitignore.
  • sdkbox plugins don’t work correctly on other machines after import. Plugins should to be imported in every machine.
  • js-generated part also added to the .gitignore. It should be generated on every machine.

Steps to get native projects on new machine (in our team):

  • Update to the last commit
  • Clear all build directory
  • Build native projects from Cocos Creator
  • Import all needed sdkbox plugins.
  • After that cocos2d-x sources and sdkbox files should be added to the build directory.
  • In Git. Revert all changes in the working copy.
  • Try to open and build native project.
  • All important changes in the native projects should be commited to the repository.

Our .gitignore file for build directory:

*/frameworks/cocos2d-x
*/res/import
*/res/raw-assets
*/publish
local.properties
*/backup*
*/.sdkbox_packages.json
*xcuserdata*
*/src/cocos2d-jsb.jsc
*/src/project.jsc
*/src/settings.jsc
*/js backups (useful for debugging)

P.S.
We didn’t finish with all tests. I’m going to add the new information to this thread if I found one.

1 Like