浏览代码

Build automation

Add basic script for build automation needs for ShaderGraph
/main
Alex Lian 7 年前
当前提交
1f1622ac
共有 3 个文件被更改,包括 45 次插入0 次删除
  1. 2
      .gitignore
  2. 3
      MaterialGraphProject/Assets/UnityShaderEditor/.npmignore
  3. 40
      build.py

2
.gitignore


artifacts/**
build/**
MaterialGraphProject/.vs
MaterialGraphProject/.vscode
MaterialGraphProject/Library

3
MaterialGraphProject/Assets/UnityShaderEditor/.npmignore


artifacts/**
build/**
.npmignore

40
build.py


#!/usr/bin/python -B
import os
import json
import logging
import shutil
import textwrap
sub_packages = {}
sub_package_folders = {}
publish_order = []
def packages_list():
return [
("com.unity.shadergraph", os.path.join("MaterialGraphProject", "Assets", "UnityShaderEditor"))
]
# helper function for preparations of tests
def copy_path_to_project(path, repo_path, project_path, logger):
logger.info("Copying {}".format(path))
shutil.copytree(os.path.join(repo_path, path), os.path.join(project_path, "Assets", os.path.basename(path)))
def copy_file_to_project(path, repo_path, project_path, logger):
logger.info("Copying {}".format(path))
shutil.copy(os.path.join(repo_path, path), os.path.join(project_path, "Assets", path))
# Prepare an empty project for editor tests
def prepare_editor_test_project(repo_path, project_path, logger):
copy_path_to_project(os.path.join("MaterialGraphProject", "Assets", "NewNodes"), repo_path, project_path, logger)
copy_path_to_project(os.path.join("MaterialGraphProject", "Assets", "TestAssets"), repo_path, project_path, logger)
copy_path_to_project(os.path.join("MaterialGraphProject", "Assets", "UnityShaderEditor", "Editor", "Testing"), repo_path, project_path, logger)
if __name__ == "__main__":
import sys
sys.path.insert(0, os.path.abspath(os.path.join("..", "automation-tools")))
try:
import unity_package_build
build_log = unity_package_build.setup()
except ImportError:
print "No Automation Tools found."
正在加载...
取消
保存