浏览代码

Merge pull request #918 from Unity-Technologies/build/automation

Get build automation working in the package test scenario
/main
GitHub 7 年前
当前提交
f32803ee
共有 5 个文件被更改,包括 28 次插入16 次删除
  1. 1
      Tests/Scripts/Editor/Tests_Editor.asmdef
  2. 3
      Tests/Scripts/Tests.asmdef
  3. 32
      build.py
  4. 8
      Tests/Scripts/Editor/Renderloop.meta

1
Tests/Scripts/Editor/Tests_Editor.asmdef


"com.unity.render-pipelines.high-defintion.Editor",
"com.unity.render-pipelines.lightweight.Editor",
"GraphicTests",
"com.unity.render-pipelines.testbed-pipelines",
"com.unity.postprocessing.Runtime",
"com.unity.render-pipelines.core.IncludePaths",
"com.unity.render-pipelines.core.Runtime",

3
Tests/Scripts/Tests.asmdef


"com.unity.render-pipelines.core.IncludePaths",
"com.unity.render-pipelines.core.Runtime",
"com.unity.render-pipelines.high-definition.Runtime",
"com.unity.render-pipelines.lightweight.Runtime",
"com.unity.render-pipelines.testbed-pipelines"
"com.unity.render-pipelines.lightweight.Runtime"
],
"optionalUnityReferences": [
"TestAssemblies"

32
build.py


import os
import json
import logging
import platform
import subprocess
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 prepare(logger):
file_path = os.path.join("./ScriptableRenderPipeline", "master-package.json")

# 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", 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))
copy_path_to_project("ImageTemplates", repo_path, project_path, logger)
copy_path_to_project("Tests", 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

8
Tests/Scripts/Editor/Renderloop.meta


fileFormatVersion: 2
guid: 9f616a5dc14c31c4ab4f51ef213335dc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存