Exemple #1
0
def createNewProj(file_recorder, tmp_files):
    srcDir = os.path.join(m_projectDir, "../%s.xcodeproj" % m_projectName)
    dstDir = os.path.join(m_projectDir, "../%s.xcodeproj" % m_newProjName)
    FileUtils.copyDirctory(srcDir, dstDir)

    tmp_files.append(dstDir)

    # # 拷贝配置文件
    # srcFile = os.path.join(m_projectDir, "WeiLeProjV3-mobile.entitlements")
    # Common.assertExit(os.path.isfile(srcFile), "文件 %s 不存在" % srcFile)
    # dstFile = os.path.join(m_projectDir, "%s-mobile.entitlements" % m_newProjName)
    # FileUtils.copyFile(srcFile, dstFile)
    # tmp_files.append(dstFile)

    # 修改工程名字
    projFilePath = getProjectConfigPath()
    Sed.replaceContent(m_projectName, m_newProjName, projFilePath)

    # 移除临时文件
    for item in os.listdir(dstDir):
        full_path = os.path.join(dstDir, item)
        if full_path == projFilePath:
            continue

        if os.path.isdir(full_path):
            FileUtils.removeDirectory(full_path)
        elif os.path.isfile(full_path):
            FileUtils.removeFile(full_path)
Exemple #2
0
def copyResFiles():
    sourcePath = getAbspathForKey(kResFiles)
    if None == sourcePath:
        return

    resPath = os.path.join(m_appPath, "res")
    FileUtils.copyDirctory(sourcePath, resPath)
Exemple #3
0
def copyConfigFiles():
    sourcePath = getAbspathForKey(kCfgFiles)
    if None == sourcePath:
        return

    srcPath = os.path.join(m_appPath, "src")
    FileUtils.copyDirctory(sourcePath, srcPath)
Exemple #4
0
def copyLaunchImages(file_recorder):
    sourceDir = getAbspath("launch_iamge_source")
    targetDir = getAbspath("launch_iamge_target")
    file_recorder.record_folder(targetDir)
    FileUtils.copyDirctory(sourceDir, targetDir)
Exemple #5
0
def copyIcons(file_recorder):
    sourceDir = getAbspath("icons_source")
    targetDir = os.path.join(m_projectDir,
                             'ios/Images.xcassets/AppIcon.appiconset')
    file_recorder.record_folder(targetDir)
    FileUtils.copyDirctory(sourceDir, targetDir)