def toproject(platform,channel,from_p): out_pro = "" if platform == "android": out_pro = os.path.join("..", "frameworks","runtime-src","proj.android-studio","app","src",channel,"res") copyDir(from_p,out_pro) print from_p, " === ",out_pro elif platform == "ios": pass
def copySrcFromproject(toPath): fromPath = "." floder = "src" # os.system("rm -rf %s"%(os.path.join(toPath, floder))) syncDir(os.path.join(fromPath, floder), os.path.join(toPath, floder)) handleMainjs() main_js = os.path.join(toPath, "main.js") if os.path.exists(main_js): os.system('rm %s' % main_js) os.system("cp mainjs/main.jsc %s" % os.path.join(toPath, "main.jsc")) """ check script """ script_path = "frameworks/cocos2d-x/cocos/scripting/js-bindings/script" script_path_to = "frameworks/runtime-src/proj.android-studio/app/assets/script" if not os.path.exists(script_path_to): copyDir(script_path, script_path_to)
help='android channel') parser.add_option('-tv', '--isTV', dest='isTv', help='isTV') (option, _) = parser.parse_args() if option.channel and option.tv: isTV = True platform_ch = "tv" if isTV == "0": isTV = False platform_ch = "mobile" chan = option.channel Root = "../frameworks/runtime-src/proj.android-studio/app" To_Root = "%s/src/%s" % (Root, chan) if not os.path.exists(To_Root): os.mkdir(To_Root) copyDir(os.path.join(Root, "temaplte/channel"), To_Root) # copyDir(os.path.join(Root, "temaplte/platform/%s"%platform_ch), To_Root) os.system("svn add %s" % To_Root) os.system("svn ci -m '' %s" % To_Root) log("-------------------- start %s ------------------" % chan) log(getInfo(chan)) log("-------------------- end %s ------------------" % chan) addChanndelConfigToBuildGradle(chan, os.path.join(Root, "build.gradle")) handleplatformjson( chan, os.path.join(To_Root, "assets", "platform.json"), isTV) else: print "%s has exists" % chan
"frameworks/cocos2dx", "frameworks/cocos2d-x/cocos", "frameworks/runtime-src/Classes", "frameworks/runtime-src/proj.android/src", "frameworks/runtime-src/proj.android/jni", "frameworks/runtime-src/proj.ios_mac/ios/app", "frameworks/runtime-src/proj.ios_mac/ios/net", "frameworks/runtime-src/proj.ios_mac/ios/utils", "src/core", "src/include", "src/cube/uicore/ui/component" ] syncFiles = [ "cocosAndroid.py", "compressRes.py", "create.py", "checkImage.py", "hot_res.py", "platform.py", "publish/android/justRun.py", "frameworks/runtime-src/proj.ios_mac/ios/AppController.h", "frameworks/runtime-src/proj.ios_mac/ios/AppController.mm", "frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h", "frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm", "frameworks/runtime-src/proj.ios_mac/ios/Info.plist", "main.js", "src/module.js", "src/cube/uicore/ui/NewRichText.js" ] for target in syncTarget: # print os.path.join(project,target), os.path.join(targetDir,target) copyDir(os.path.join(project, target), os.path.join(targetDir, target)) for f in syncFiles: # print os.path.join(project,f), os.path.join(targetDir,f) copyFile(os.path.join(project, f), os.path.join(targetDir, f)) os.chdir(targetDir) os.system("gitup.py")
elif platform == 'android': """ 修改了coocs2d-x-V/tools/cocos2d-console/plugins/plugin_compile/build_android.py old: if self._project._is_js_project(): compile_obj.compile_js_scripts(assets_dir, assets_dir) now if self._project._is_js_project(): if not no_apk: compile_obj.compile_js_scripts(assets_dir, assets_dir) """ if not apk == '1': os.system('cocos compile -p android -m release --no-apk True') copyDir( "frameworks/runtime-src/proj.android/libs/armeabi", "frameworks/runtime-src/proj.android-studio/app/ibs/armeabi" ) else: os.system( 'cocos compile -p android -m release && python publish/android/justRun.py' ) toNormalStatus() pass elif platform == 'android-studio': __decodeJS__() toPath = "frameworks/runtime-src/proj.android-studio/app/assets" if mode == '0': copyResFromproject(toPath) copySrcFromproject(toPath) elif mode == '1': copySrcFromproject(toPath)
#!/usr/bin/python from myutil.utils import copyDir, copyFile import os print os.getcwd() """ cubeWar-ahteuyawqnksliahfvgarrnmskun """ frRoot = "../" toRoot = "/Users/tianyi/Library/Developer/Xcode/DerivedData/cubeWar-ahteuyawqnksliahfvgarrnmskun/Build/Products/Debug/cubeWar-desktop copy.app/Contents/Resources" copyDir(os.path.join(frRoot, "src"), os.path.join(toRoot, "src")) copyDir(os.path.join(frRoot, "res"), os.path.join(toRoot, "res")) copyFile(os.path.join(frRoot, "main.js"), os.path.join(toRoot, "main.js")) copyFile(os.path.join(frRoot, "platform.json"), os.path.join(toRoot, "platform.json")) copyDir( os.path.join(frRoot, "frameworks/cocos2d-x/cocos/scripting/js-bindings/script"), os.path.join(toRoot, "script")) os.system( "open -n /Users/tianyi/Library/Developer/Xcode/DerivedData/cubeWar-ahteuyawqnksliahfvgarrnmskun/Build/Products/Debug/cubeWar-desktop\ copy.app" )