def run(projPath,curPath, args): this = BuildApk() res_dirs = ["src","res"] tempPath = curPath + "/output_buildRes" Helper.delFolder(tempPath) b64 = False for arg in args: if arg == "-64": b64 = true break for dir in res_dirs: src = projPath + "/" + dir dis = tempPath + "/" + dir Helper.copy(src,dis) this.compileSource(dis,b64) this.removeLuaFile(dis) this.encryptoDir(dis)
def run(projPath, curPath, args): this = DecryptRes() res_dirs = ["src", "res"] tempPath = curPath + "/output_buildRes" outputPath = curPath + "/output_buildRes_decrypt" Helper.delFolder(outputPath) b64 = False for arg in args: if arg == "-64": b64 = true break for dir in res_dirs: src = tempPath + "/" + dir dis = outputPath + "/" + dir Helper.copy(src, dis) this.decryptoDir(dis)
def genrate_one_gameZip(oneGameName, oneGamePath, saveZipDir, mapKey): # print(mapKey) oneGameDirs = os.listdir(oneGamePath) for oneGameSubDir in oneGameDirs: #因为压缩后的文件结构不能变,如src,解压后的格式必须为brnngame/src,因此需要构建一个需要压缩的文件 #构建要压缩的文件夹 如 brnngame/src if not oneGameSubDir.startswith("."): # print "oneGameSubDir:"+oneGameSubDir tempNeedZipDir = os.path.join(oneGamePath, "tempDir") #oneGameSubDir 下创建需要压缩的文件夹路径 tempCopyTargetDir = os.path.join(tempNeedZipDir, oneGameName, oneGameSubDir) needCopyDir = os.path.join(oneGamePath, oneGameSubDir) #拷贝文件 Helper.copy(needCopyDir, tempCopyTargetDir) #压缩文件 saveZipPath = os.path.join( saveZipDir, oneGameName + "_" + oneGameSubDir + ".zip") # print(oneGameName+"_"+oneGameSubDir+".zip") zipNameMap[(oneGameName + "_" + oneGameSubDir + ".zip")] = mapKey Helper.zipFolder(saveZipPath, tempNeedZipDir) delete_dir(tempNeedZipDir)
print("%s fail !" % (command)) tryTimes = 0 srcAndResHandle(); curDir = os.path.dirname(__file__) resDir = os.path.join(curDir,"output_buildRes","res") srcDir = os.path.join(curDir,"output_buildRes","src") winTargetDir = os.path.join(curDir,"..","..","..","gamingcity_common","win") Helper.delFolder(winTargetDir) os.mkdir(winTargetDir) targetSrcDir = os.path.join(winTargetDir,"src") Helper.delFolder(targetSrcDir) os.mkdir(targetSrcDir); Helper.copy(srcDir,targetSrcDir) targetResDir = os.path.join(winTargetDir,"res") Helper.delFolder(targetResDir) os.mkdir(targetResDir); Helper.copy(resDir,targetResDir) # simulatorDir = os.path.join(curDir,"..","simulator") targetSimulatorDir = os.path.join(winTargetDir,"simulator") Helper.delFolder(targetSimulatorDir) os.mkdir(targetSimulatorDir); Helper.copy(simulatorDir,targetSimulatorDir) #copy client_const.json clientJsonPath = os.path.join(curDir,"..","res","client_const.json") targetClientJsonPath = os.path.join(targetResDir,"client_const.json")