V3.0 project management

I’ve just tried the latest V3 RC. I’ve created a new cross-platform project and found out that now the project directory contains ‘cocos2d’ directory which duplicates entirely the codebase of cocos2d-x.
SERIOUSLY??
How do we now supposed to update the codebase of cocos2d-x when a new version or bugfix or hotfix or whatever is released? Recreate the project?

I hope I’m just don’t understand something. Otherwise you definitely make it wrong.

We decide to copy engine when creating a new project is because:

  • by doing it then you can move your project after you creating it
  • if you have more than one project, you can modify engine codes without affecting other projects
  • you can create a project in any place
  • and it make template work easier, because new project can has nice folder structure

Sorry, but I think that all the benefits you’ve listed are teared down by one serious drawback: there is no easy way to update the engine’s codebase.
In v2.x I could do ‘git pull’ and that’s all.
In v3.x we’ll have to do that manually. That’s error-prone and inconvenient.

@zhangxm
i agree with @dotsquid even opened bug request when this option was presented
my solution is simple :
just add new flag in the project-creator script for us the developers to decide
if we want to copy the cocos2d tree or not .

Because our template will use the folder structure, for example, Xcode needs these paths to work. So we can not just have an argument then, it can work. And we will offer an IDE which also needs the folder structure.

Is it possible to make the engine’s directory ( ‘cocos2d’ ) in the project’s directory as a git’s submodule?
The script which creates a new project asks the user if (s)he wants to use a repository or not. If the user chooses the repository the script may ask to select which one should be used: master, dev or user’s fork, and then clones it. If the user doesn’t want to use a repository, just copy the files as you do now in v.3 RC.
This will allow us to update the engine’s codebase easily.

I totally agree with @dotsquid, it’s hard to update cocos2d-x if we are copying the engine’s source code as a new project. It should have another way to create new project inside the cocos2d-x directory

I totally agree with you guys.

I too want to be able to update the base code easily.
Maybe an option in the cocos binary to ‘update’ the base engine (removing the local copy, and replace the files). It should work if the sub-projects don’t change folder.

On ios, it can referece to the cocos2d project too.

Instead of v2 that all game projects must be under sub folder of cocos2d, v3 copies the cocos library to corresponding game projects.

It looks better because now a project includes cocos2d library (v3), not a library has a project (v2). But still it could be further improved by using reference link as mentioned by others.

So developer can switch their cocos reference (Dev/Master/etc) whenever necessary

@dotsquid
But this also have problem, should we clone all codes? Because new project doesn’t need tests and other files.

It is hard to use reference, especially on windows. And if we use reference, it will cause error when building Android projects. Because when using a reference, then what does the path of .. of the reference?

Are you aware of git submodules? http://git-scm.com/book/en/Git-Tools-Submodules
I guess you should, because submodules are used in v.2 for some features, like javascript support etc (I don’t remember exactly, since I don’t use them).
Just make the core of the engine as a submodule and include it into the main repo.

Did you mean we change cocos2d-x repo, make 2d folder as a submodule?

The engine’s directory you are copying to the project’s directory should be a submodule.

It will make engine repo too complex to manage.
Can i create a submodule link to a folder of repo, not link to the whole repo?

I’m not pro in git, so I can’t answer it right now.

I am not familiar in building android solution. But isn’t that using environment variable could work?

Just kindly note that Ant will be replaced by Gradle, which is officially supported by Google to be next advanced build system for android. Maybe it is also good timing to check it out (also Android Studio)?


Gradle would be awesome if it was implemented. Such easy automation.

@winipcfg
Thanks for notification. Did you know when Ant will be replaced?

@zhangxm wrote:

@winipcfg
Thanks for notification. Did you know when Ant will be replaced?

Not sure as I am not an expert on the building system
As previous link (https://developers.google.com/events/io/sessions/325236644), the idea was mentioned in Google I/O 2013

The following pdf file is the presentation powerpoint for the session
http://commondatastorage.googleapis.com/io-2013/presentations/107%20-%20The%20New%20Android%20SDK%20Build%20System.pdf

I think it will be done after Android Studio go Live :slight_smile:
http://developer.android.com/sdk/installing/studio.html