Ejemplo n.º 1
0
def PatchPack(clientPath, enginPath, isCreateApk, isCreateIpa):
    createApk = ""
    if isCreateApk:
        createApk = "--createapk"
        cmd = "android update project -p %s/proj.android -t 1" % (clientPath)
        SafeExec(cmd)
        CreateAndroidPropertie(clientPath)
        cmd = "android update project -p %s/lib/cocos2d-x/cocos2dx/platform/android/java -t 1" % (
            enginPath)
        SafeExec(cmd)

    createIpa = ""
    if isCreateIpa:
        createIpa = "--createipa"

    #设置环境变量
    evn_cmd1 = "export QUICK_COCOS2DX_ROOT=%s" % (enginPath)
    evn_cmd2 = "export COCOS2DX_ROOT=${QUICK_COCOS2DX_ROOT}/lib/cocos2d-x"

    #传入相应的路径
    patchScriptPath = "%s/tool/shell/release.py" % (clientPath)
    targetPath = "%s/tool/shell/test" % (clientPath)

    cmd = "%s; %s; python %s --clientpath %s --targetpath %s --skipsvnup %s %s" % (
        evn_cmd1, evn_cmd2, patchScriptPath, clientPath, targetPath, createApk,
        createIpa)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 2
0
def CreateAndroidPropertie(clientPath):
    propertiePath = os.path.join(clientPath, "proj.android",
                                 "project.properties")
    cmd = "rm -rf %s" % (propertiePath)
    SafeExec(cmd)
    f = open(propertiePath, "w")
    propertiesContent = "target=android-14\nandroid.library=false\nandroid.library.reference.1=../../gameplay3d/lib/cocos2d-x/cocos2dx/platform/android/java"
    f.write(propertiesContent)
    f.close()
Ejemplo n.º 3
0
def SvnUp(path, ignoreExt=False, cleanup=False):
    print "svn up " + path
    if ignoreExt:
        strIgnor = "--ignore-externals"
    else:
        strIgnor = ""
        cmd = "svn update %s %s" %(strIgnor, path)
    if cleanup:
        cmd = "svn cleanup %s && %s" %(path, cmd)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 4
0
                      action="store_true",
                      dest="force",
                      help=u'强制更新配置')
    (options, args) = parser.parse_args()

    if options.version:
        version = options.version
    else:
        version = "debug"

    force_publish = False
    if options.force:
        force_publish = True

    parser_config.startWriteCfg(version, force_publish)

    versionoption = "--version %s" % version
    createoption = ""
    servertype = "--publish"
    if options.createipa:
        createoption = createoption + "--createipa" + " "
    if options.createapk:
        createoption = createoption + "--createapk" + " "

    #打patch
    cmd = "python release.py  --skipsvnup " + versionoption + " " + servertype + " " + createoption
    print(cmd)
    SafeExec(cmd)

    print("done!")
Ejemplo n.º 5
0
def SvnExportRpcJson(path):
    url = config.SVN_ROOT_PATH + "/program/server/logic/trunk/rc/rpc/rpcJson.cfg"
    print "svn export --force" + url + "---------->" + path
    cmd = "svn export --force %s %s" % (url, path)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 6
0
def SvnExport(url, path):
    print "svn export --force" + url + "---------->" + path
    cmd = "svn export --force --ignore-externals %s %s" % (url, path)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 7
0
def SvnCheckOutWithExternals(url, path):
    print "svn checkout" + url + "---------->" + path
    cmd = "svn co %s %s" % (url, path)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 8
0
def SvnCheckOut(url, path):
    print "svn checkout" + url + "---------->" + path
    cmd = "svn co --ignore-externals %s %s" % (url, path)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 9
0
def SvnRm(url):
    print "svn rm:" + url
    cmd = "svn rm %s -m removetestbranch" % (url)
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 10
0
def SvnCopy(trunkPath, branchPath, message):
    print "svn cp branch" + trunkPath + "--->" + branchPath
    strIgnor = "--ignore-externals"
    cmd = "svn cp %s %s %s -m %s" % (strIgnor, trunkPath, branchPath, message)
    ret = SafeExec(Encode(cmd))
    return ret
Ejemplo n.º 11
0
        #先创建目录
        CreateDir(releasePath)
    #打客户分支
    if (copy):
        for i in range(len(trunkPaths)):
            SvnCopy(trunkPaths[i], branchPaths[i], message)

        #checkout目录
        SvnCheckOut(branchPaths[0], checkOutPaths[0])
        #开始指定外链
        #一个命令的直接打
        cmd_str = '''cd %s && svn propset svn:externals %s release_%s/client/resource/%s'''
        item_format = "%s %s"
        path_str = '''"%s"''' % (item_format % (branchPaths[1], "res"))
        res_cmd_str = cmd_str % (BRANCH_BACKUPS_PATH, path_str, version, "")
        SafeExec(res_cmd_str)

        # 两条的需要借助临时一个文件来同时对一个目录设置多个属性
        temp_file_name = "%sexternals_temp.txt" % BRANCH_BACKUPS_PATH
        path_str = item_format % (
            branchPaths[2], "battles") + "\n" + item_format % (branchPaths[3],
                                                               "battle_ai")
        common.CreateFile(temp_file_name,
                          path_str.encode(sys.getfilesystemencoding()))
        res_cmd_str = cmd_str % (BRANCH_BACKUPS_PATH, "-F %s" % temp_file_name,
                                 version, "scripts/game_config")
        SafeExec(res_cmd_str.encode(sys.getfilesystemencoding()))
        common.DeleteFile(temp_file_name)

    if checkout:
        #checkout客户端分支  暂不checkout引挚
Ejemplo n.º 12
0
def RmPath(path):
    cmd = "rm -rf " + path
    print cmd
    ret = SafeExec(cmd)
    return ret
Ejemplo n.º 13
0
def CreateDir(path):
    if not os.path.exists(path):
        cmd = "mkdir -p %s" % (path)
        ret = SafeExec(cmd)
        return ret