Exemple #1
0
def getAbspath(key):
    Common.assertExit(m_jsonObj[key], "config配置文件缺少参数key=" + key)

    if os.path.isabs(m_jsonObj[key]):
        return m_jsonObj[key]

    configDir = FileUtils.getFileDirectory(m_configPath)
    return FileUtils.getAbsoluteFromPath(configDir, m_jsonObj[key])
Exemple #2
0
def copyResFiles(file_recorder):
    resDir = FileUtils.getFileDirectory(m_configPath)
    sourceResDir = os.path.abspath(os.path.join(resDir, "res"))
    if not os.path.isdir(sourceResDir):
        return

    targetResDir = FileUtils.getAbsolutePath("./shell_script/res")
    file_recorder.record_folder(targetResDir)
    FileUtils.replaceCopyDirctory(sourceResDir, targetResDir)
Exemple #3
0
def copyConfigFile(file_recorder):
    targetConfigFile = FileUtils.getAbsolutePath("./shell_script/config.json")
    file_recorder.record_file(targetConfigFile)
    FileUtils.copyFile(m_configPath, targetConfigFile)

    configDir = FileUtils.getFileDirectory(m_configPath)
    sourceCfgDir = os.path.join(configDir, "cfg")
    Common.assertExit(os.path.isdir(sourceCfgDir),
                      "cfg配置文件夹不存在" + sourceCfgDir)

    # 检查 cfg_package 中是否定义了 APPLE_ID
    cfg_pkg_file = os.path.join(sourceCfgDir, "cfg_package.lua")
    Common.assertExit(os.path.isfile(cfg_pkg_file),
                      "cfg配置文件夹中不存在 cfg_package 文件")
    f = open(cfg_pkg_file)
    content = f.read()
    f.close()
    if content.find("APPLE_ID") == -1:
        Common.assertExit(False, "cfg_package 中未配置 APPLE_ID ")

    targetCfgDir = FileUtils.getAbsolutePath("./shell_script/cfg")
    file_recorder.record_folder(targetCfgDir)
    FileUtils.replaceCopyDirctory(sourceCfgDir, targetCfgDir)