浏览代码

Modify copy step for Windows

Windows is failing for copying a tree. Try direct copying
/main
Alex Lian 7 年前
当前提交
17629e50
共有 1 个文件被更改,包括 16 次插入10 次删除
  1. 26
      build.py

26
build.py


import os
import json
import logging
import platform
import subprocess
import textwrap
sub_packages = {}

# helper function for preparations of tests
def copy_path_to_project(path, repo_path, project_path, logger):
def copy_path_to_project(path, repo_path, project_target_path, logger):
shutil.copytree(os.path.join(repo_path, path), os.path.join(project_path, "Assets", "ScriptableRenderLoop", path))
if platform.system() == "Windows":
subprocess.call(["xcopy", os.path.join(repo_path, path), os.path.join(project_target_path, path), "/E", "/Q", "/Y"])
else:
shutil.copytree(os.path.join(repo_path, path),os.path.join(project_target_path, path))
def copy_file_to_project(path, repo_path, project_path, logger):
def copy_file_to_project(path, repo_path, project_target_path, logger):
shutil.copy(os.path.join(repo_path, path), os.path.join(project_path, "Assets", "ScriptableRenderLoop", path))
shutil.copy(os.path.join(repo_path, path), os.path.join(project_target_path, path))
copy_path_to_project("ImageTemplates", repo_path, project_path, logger)
copy_path_to_project("Tests", repo_path, project_path, logger)
copy_file_to_project("SRPMARKER", repo_path, project_path, logger)
copy_file_to_project("SRPMARKER.meta", repo_path, project_path, logger)
copy_file_to_project("ImageTemplates.meta", repo_path, project_path, logger)
copy_file_to_project("Tests.meta", repo_path, project_path, logger)
dest_path = os.path.join(project_path, "Assets", "ScriptableRenderLoop")
copy_path_to_project("ImageTemplates", repo_path, dest_path, logger)
copy_path_to_project("Tests", repo_path, dest_path, logger)
copy_file_to_project("SRPMARKER", repo_path, dest_path, logger)
copy_file_to_project("SRPMARKER.meta", repo_path, dest_path, logger)
copy_file_to_project("ImageTemplates.meta", repo_path, dest_path, logger)
copy_file_to_project("Tests.meta", repo_path, dest_path, logger)
if __name__ == "__main__":
import sys

正在加载...
取消
保存