Merge pull request #5712 from chuanweizhang2013/luamerage

update cocos_2d files generate rules
This commit is contained in:
James Chen 2014-03-12 18:03:56 +08:00
commit d49ada0a57
3 changed files with 18 additions and 9 deletions

View File

@ -503,10 +503,10 @@ public:
for (int i=0;i< sizeof(commands)/sizeof(Console::Command);i++) { for (int i=0;i< sizeof(commands)/sizeof(Console::Command);i++) {
_console->addCommand(commands[i]); _console->addCommand(commands[i]);
} }
_console->listenOnTCP(6001); _console->listenOnTCP(6010);
_fileserver=new FileServer(); _fileserver=new FileServer();
_fileserver->listenOnTCP(6002); _fileserver->listenOnTCP(6020);
} }
~ConsoleCustomCommand() ~ConsoleCustomCommand()
{ {

View File

@ -109,4 +109,4 @@ tags
#include #include
!/tools/cocos2d-console/console/bin/ !/tools/cocos2d-console/console/bin/
!/plugin-x/plugin-x_ios.xcworkspace/ !/plugin-x/plugin-x_ios.xcworkspace/
!/cocos/2d/platform/android/java/res/

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
import os import os
import sys import sys
import re import re
import json
class CocosFileList: class CocosFileList:
""" """
@ -39,7 +40,10 @@ class CocosFileList:
self.excludeConfig=[] self.excludeConfig=[]
self.inludeConfig=[] self.inludeConfig=[]
self.rootDir = "" self.rootDir = ""
self.fileList=[] self.fileList_com=[]
self.fileList_lua=[]
self.luaPath ="cocos/scripting/lua-bindings"
def readIngoreFile(self, fileName): def readIngoreFile(self, fileName):
""" """
@ -84,7 +88,10 @@ class CocosFileList:
self.__bInclude(item) or self.__bInclude(item) or
self.__bInclude("%s/" %item) self.__bInclude("%s/" %item)
): ):
self.fileList.append("%s/" %relativePath) if relativePath.upper().find(self.luaPath.upper())==0:
self.fileList_lua.append("%s/" %relativePath)
else:
self.fileList_com.append("%s/" %relativePath)
continue continue
if ( if (
self.__bExclude("/%s" %relativePath) or self.__bExclude("/%s" %relativePath) or
@ -105,7 +112,10 @@ class CocosFileList:
): ):
continue continue
# print(relativePath) # print(relativePath)
self.fileList.append(relativePath) if relativePath.upper().find(self.luaPath.upper())==0:
self.fileList_lua.append(relativePath)
else:
self.fileList_com.append(relativePath)
def __bExclude(self, item): def __bExclude(self, item):
bexclude = False bexclude = False
@ -128,9 +138,8 @@ class CocosFileList:
Save content to file with json format. Save content to file with json format.
""" """
f = open(fileName,"w") f = open(fileName,"w")
self.fileList.sort() content ={'common':self.fileList_com,'lua':self.fileList_lua}
content = "[\n\"%s\"\n]" % ("\",\n\"".join(self.fileList)) json.dump(content,f,sort_keys=True,indent=4)
f.write(content)
f.close() f.close()
return True return True