cocos2d / cocos2d-console

cocos2d command line tool
152 stars 190 forks source link

Fix AttributeError: 'CCPluginCompile' object has no attribute 'project_name' #367

Closed gelldur closed 7 years ago

gelldur commented 8 years ago

Fix for such bug:

In CMakeLists.txt script is searching for "set(APP_NAME " but for example CLion formats CMakeLists.txt and make it:

SET(APP_NAME  MyApp)

Error occurs:

Deploying mode: debug
Traceback (most recent call last):
  File "/home/dawid/Projects/ESportSolutions/Games/cocos2d-x/tools/cocos2d-console/bin/cocos.py", line 998, in <module>
    run_plugin(command, argv, plugins)
  File "/home/dawid/Projects/ESportSolutions/Games/cocos2d-x/tools/cocos2d-console/bin/cocos.py", line 913, in run_plugin
    dep_name, argv, plugins)
  File "/home/dawid/Projects/ESportSolutions/Games/cocos2d-x/tools/cocos2d-console/bin/cocos.py", line 916, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "/home/dawid/Projects/ESportSolutions/Games/cocos2d-x/tools/cocos2d-console/plugins/plugin_deploy.py", line 205, in run
    self.deploy_linux(dependencies)
  File "/home/dawid/Projects/ESportSolutions/Games/cocos2d-x/tools/cocos2d-console/plugins/plugin_deploy.py", line 167, in deploy_linux
    self.project_name = compile_dep.project_name
AttributeError: 'CCPluginCompile' object has no attribute 'project_name'

Now it can find it and accepts forms like:

SET(APP_NAME MyApp)
set(APP_NAME MyApp)
      set(APP_NAME MyApp)
        SET     (    APP_NAME MyApp)

If it still can't find APP_NAME we get nice error message:

Cauldn't find APP_NAME in CMakeLists.txt

gelldur commented 7 years ago

Any comments?

natural-law commented 7 years ago

Sorry for the late reply! It looks good to me.