diff --git a/tools/xcode4_template_generator/run_generator.sh b/tools/xcode4_template_generator/run_generator.sh index 5aefd87f2f..960763baea 100755 --- a/tools/xcode4_template_generator/run_generator.sh +++ b/tools/xcode4_template_generator/run_generator.sh @@ -18,7 +18,7 @@ python ./tools/xcode4_template_generator/template_generator.py --directory chipm echo "generating liblua" mkdir -p template/xcode4/lib_lua.xctemplate -python ./tools/xcode4_template_generator/template_generator.py --directory lua --identifier liblua --prefix libs --exclude "android win32 airplay wophone bada Makefile Linux linux CMakeFiles qnx marmalade" > ./template/xcode4/lib_lua.xctemplate/TemplateInfo.plist +python ./tools/xcode4_template_generator/template_generator.py --directory lua --identifier liblua --prefix libs --append ./tools/xcode4_template_generator/template_lua_patch.txt --exclude "android win32 airplay wophone bada Makefile Linux linux CMakeFiles qnx marmalade" > ./template/xcode4/lib_lua.xctemplate/TemplateInfo.plist echo "done" diff --git a/tools/xcode4_template_generator/template_generator.py b/tools/xcode4_template_generator/template_generator.py index affdc14ab3..3b78fc1487 100644 --- a/tools/xcode4_template_generator/template_generator.py +++ b/tools/xcode4_template_generator/template_generator.py @@ -38,7 +38,7 @@ import getopt import glob class Xcode4Template(object): - def __init__( self, directory, group=0, identifier="XXX", prefix="libs", exclude=[] ): + def __init__( self, directory, group=0, identifier="XXX", prefix="libs", exclude=[], append="" ): self.directory = directory self.files_to_include = [] self.wildcard = '*' @@ -56,7 +56,7 @@ class Xcode4Template(object): if currentFile.find(exclude_keyword) >= 0: bExclude = True break - + if bExclude is False: if os.path.isdir(currentFile): self.scandirs(currentFile) @@ -67,10 +67,10 @@ class Xcode4Template(object): # append the definitions # def append_definition( self, output_body, path, group, dont_index ): - #add 'libs/' + #add 'libs/' path = self.prefix + '/' + path group = [ self.prefix ] + group; - + output_body.append("\t\t%s" % path ) output_body.append("\t\t") @@ -122,7 +122,7 @@ class Xcode4Template(object): self.output.append( "\n".join( output_body ) ) self.output.append( output_dict_close ) - # + # # Generates the "Nodes" section # def generate_nodes( self ): @@ -139,12 +139,14 @@ class Xcode4Template(object): self.output.append( output_open ) self.output.append( "\n".join( output_body ) ) self.output.append( output_close ) - + # # Generates the plist. Send it to to stdout # def generate_xml( self ): self.output.append( _template_open_body % self.identifier ) + if append != "": + self.output.append( "".join(open(append, "r").readlines()) ) self.generate_definitions() self.generate_nodes() self.output.append( _template_close_body ) @@ -174,10 +176,11 @@ if __name__ == "__main__": identifier = None prefix = "" exclude = [] + append = "" argv = sys.argv[1:] - try: - opts, args = getopt.getopt(argv, "d:g:i:p:e:", ["directory=","group=","identifier=","prefix=", "exclude="]) + try: + opts, args = getopt.getopt(argv, "d:g:i:p:e:a:", ["directory=","group=","identifier=","prefix=", "exclude=", "append="]) for opt, arg in opts: if opt in ("-d","--directory"): directory = arg @@ -189,6 +192,8 @@ if __name__ == "__main__": prefix = arg if opt in ("-e","--exclude"): exclude = arg.split() + if opt in ("-a","--append"): + append = arg except getopt.GetoptError,e: print e @@ -196,5 +201,5 @@ if __name__ == "__main__": help() #generate libs/cocos2dx - gen = Xcode4Template( directory=directory, group=group, identifier=identifier, prefix=prefix, exclude=exclude ) + gen = Xcode4Template( directory=directory, group=group, identifier=identifier, prefix=prefix, exclude=exclude, append=append ) gen.generate() diff --git a/tools/xcode4_template_generator/template_lua_patch.txt b/tools/xcode4_template_generator/template_lua_patch.txt new file mode 100644 index 0000000000..3204fe298f --- /dev/null +++ b/tools/xcode4_template_generator/template_lua_patch.txt @@ -0,0 +1,20 @@ + Project + + Configurations + + Debug + + GCC_PREPROCESSOR_DEFINITIONS + + CC_LUA_ENGINE_ENABLED=1 + + + Release + + GCC_PREPROCESSOR_DEFINITIONS + + CC_LUA_ENGINE_ENABLED=1 + + + +