cocos2d/cocos2d-console — pull request #8 by luisparravicini (2014-01-27 04:06:57+00:00)
Title: Refactor

This pull request has changes mentioned in https://groups.google.com/forum/#!topic/cocos2d-js-devel/3ouCXAIYkUM

* Moved plugin files to plugins/
* Moved main script to bin/
* jscompile plugin has several files associated with it (jsbcc), they are now in plugins/plugin_jscompile/
* cocos2d.ini is now shorter. You only have to list the plugin classname

Some changes not mentioned in the google group (all these was tested with cocos 2.2.0):

* All plugins can abort their execution by raising cocos2d.CCPluginError. The main script catches this and shows the error nicely (check the FIXME in cocos2d.py!)
* Nice output: ansi colors with cocos2d.Logging. Also the output of the commands executed are only shown in the console if the verbose option is set, otherwise it's stored in ~/.cocos2d/cocos2d.log in case of failure. If that happens, an error is shown to the user saying where the log is located.
* Some common code now moved to CCPlugin. All plugins have a -v option.
* version plugin: It was empty, now it extracts the version info from cocos2dx/cocos2d.cpp. Don't know if that's the original purpose of the plugin.
* update plugin: It was empty, now it extracts the latest available cocos2d-x version from http://cocos2d-x.org/download (it should check with the current installed version, but it's unfinished)
* new plugin: compile: Builds the project (now only works with Android)
* new plugin: install: Install the compiled project in a device (now only works with Android)

An example of the new jscompile output:
![jscompile](https://f.cloud.github.com/assets/45163/2006037/9f914b42-8707-11e3-955c-1408e3af8f51.png)

Or the compile plugin output:
![compile](https://f.cloud.github.com/assets/45163/2006042/30d220f4-8708-11e3-8cb3-c7f07280063d.png)