浏览代码

build cleanup

Use internal scripts now and simplify some code
/main
Alex Lian 7 年前
当前提交
9ee6ccc2
共有 1 个文件被更改,包括 13 次插入33 次删除
  1. 46
      build.py

46
build.py


sub_package_folders = {}
publish_order = []
packages = {
("com.unity.render-pipelines.core", os.path.join("ScriptableRenderPipeline", "Core")),
("com.unity.render-pipelines.high-definition", os.path.join("ScriptableRenderPipeline", "HDRenderPipeline")),
("com.unity.render-pipelines.lightweight", os.path.join("ScriptableRenderPipeline", "LightweightPipeline"))
}
def packages_list():
return [
("com.unity.render-pipelines.core", os.path.join("ScriptableRenderPipeline", "Core")),
("com.unity.render-pipelines.high-definition", os.path.join("ScriptableRenderPipeline", "HDRenderPipeline")),
("com.unity.render-pipelines.lightweight", os.path.join("ScriptableRenderPipeline", "LightweightPipeline"))
]
def prepare(logger):
file_path = os.path.join("./ScriptableRenderPipeline", "master-package.json")

with open(package_path, 'w') as file:
json.dump(sub_package, file, indent=4, sort_keys=True)
def packages_list():
package_list = []
for name in publish_order:
package_list.append((name, sub_package_folders[name]))
return package_list
def cleanup(logger):
logger.info("Removing temporary files:")
files = []

logger.info(" {}".format(file))
os.remove(file)
# helper function for preparations of tests
def copy_path_to_project(path, repo_path, project_target_path, logger):
logger.info("Copying {}".format(path))
if platform.system() == "Windows":
subprocess.call(["robocopy", os.path.join(repo_path, path), os.path.join(project_target_path, os.path.dirname(path)), "/e", "/np"])
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_target_path, logger):
logger.info("Copying {}".format(path))
if platform.system() == "Windows":
subprocess.call(["robocopy", os.path.join(repo_path, os.path.dirname(path)), os.path.join(project_target_path, os.path.dirname(path)), os.path.basename(path), "/np"])
else:
shutil.copy(os.path.join(repo_path, path), os.path.join(project_target_path, path))
import unity_package_build
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)
unity_package_build.copy_path_to_project("ImageTemplates", repo_path, dest_path, logger)
unity_package_build.copy_path_to_project("Tests", repo_path, dest_path, logger)
unity_package_build.copy_file_to_project("SRPMARKER", repo_path, dest_path, logger)
unity_package_build.copy_file_to_project("SRPMARKER.meta", repo_path, dest_path, logger)
unity_package_build.copy_file_to_project("ImageTemplates.meta", repo_path, dest_path, logger)
unity_package_build.copy_file_to_project("Tests.meta", repo_path, dest_path, logger)
if __name__ == "__main__":
import sys

正在加载...
取消
保存