|
18 | 18 | # Note that for now all of those builds are being made on Windows machine (so for example combination of macOS + il2cpp is expected to fail) |
19 | 19 | # TODO: for now all builds are being made on Windows machine, but it would be nice to have a Mac build as well. |
20 | 20 | # TODO: add iOS support |
21 | | - {% for buildProject in BuildProjects -%} |
| 21 | +{% for buildProject in BuildProjects -%} |
22 | 22 | build_{{ buildProject[0] }}_project: |
23 | 23 | name: {{ buildProject[0] }} |
24 | 24 | agent: |
25 | 25 | type: Unity::VM |
26 | 26 | image: package-ci/win10:v4 |
27 | 27 | flavor: b1.xlarge |
28 | | -variables: |
29 | | - UNITY_VERSION: {{ buildProject[1].minUnityVersion }} |
30 | | - SCRIPTING_BACKEND_IL2CPP_MONO: il2cpp |
31 | | - BURST_ON_OFF: on |
32 | | - PLATFORM_WIN64_MAC_ANDROID: win64 |
33 | | - SAMPLE_BRANCH: {{ buildProject[1].defaultBranch }} |
34 | | -commands: |
35 | | - - echo Building {{ buildProject[0] }} project from branch %SAMPLE_BRANCH% with Unity version of %UNITY_VERSION%, Scripting backend %SCRIPTING_BACKEND_IL2CPP_MONO%, Burst %BURST_ON_OFF% for platform %PLATFORM_WIN64_MAC_ANDROID% |
| 28 | + variables: |
| 29 | + UNITY_VERSION: {{ buildProject[1].minUnityVersion }} |
| 30 | + SCRIPTING_BACKEND_IL2CPP_MONO: il2cpp |
| 31 | + BURST_ON_OFF: on |
| 32 | + PLATFORM_WIN64_MAC_ANDROID: win64 |
| 33 | + SAMPLE_BRANCH: {{ buildProject[1].defaultBranch }} |
| 34 | + commands: |
| 35 | + - echo Building {{ buildProject[0] }} project from branch %SAMPLE_BRANCH% with Unity version of %UNITY_VERSION%, Scripting backend %SCRIPTING_BACKEND_IL2CPP_MONO%, Burst %BURST_ON_OFF% for platform %PLATFORM_WIN64_MAC_ANDROID% |
36 | 36 |
|
37 | | - # Validate inputs passed via Yamato variables |
38 | | - - python Tools/CI/scripts/BuildAutomation/validate_params.py |
| 37 | + # Validate inputs passed via Yamato variables |
| 38 | + - python Tools/CI/scripts/BuildAutomation/validate_params.py |
39 | 39 |
|
40 | | - # Clone the external project repository into a specific directory. Notice that branch is also specified. |
41 | | - - git clone --single-branch --branch %SAMPLE_BRANCH% {{ buildProject[1].GithubRepo }} {{ ClonedProjectRoot }} |
| 40 | + # Clone the external project repository into a specific directory. Notice that branch is also specified. |
| 41 | + - git clone --single-branch --branch %SAMPLE_BRANCH% {{ buildProject[1].GithubRepo }} {{ ClonedProjectRoot }} |
42 | 42 |
|
43 | | - # Replace file: references in the manifest with latest released versions from Unity Package Vision API. |
44 | | - # This replaces the need for maintaining separate release-manifest.json files in each project. |
45 | | - - python Tools/CI/scripts/BuildAutomation/resolve_file_references.py --manifest-path C:/ClonedProject/{{ buildProject[1].manifestPath }} |
| 43 | + # Replace file: references in the manifest with latest released versions from Unity Package Vision API. |
| 44 | + # This replaces the need for maintaining separate release-manifest.json files in each project. |
| 45 | + - python Tools/CI/scripts/BuildAutomation/resolve_file_references.py --manifest-path C:/ClonedProject/{{ buildProject[1].manifestPath }} |
46 | 46 |
|
47 | | - # Modify the external project's manifest to use the local N4E package from current branch on which this Yamato job is running. (requires python that should be preinstalled in the image) |
48 | | - - python Tools/CI/scripts/BuildAutomation/manifest_update.py --manifest-path {{ ClonedProjectRoot }}/{{ buildProject[1].manifestPath }} --package-name {{ buildProject[1].localPackageName }} --local-package-path %YAMATO_SOURCE_DIR%/{{ buildProject[1].localPackagePath }}{% if buildProject[1].remove %} --remove-folder {{ buildProject[1].remove }}{% endif %} --cloned-project-root {{ ClonedProjectRoot }} |
| 47 | + # Modify the external project's manifest to use the local N4E package from current branch on which this Yamato job is running. (requires python that should be preinstalled in the image) |
| 48 | + - python Tools/CI/scripts/BuildAutomation/manifest_update.py --manifest-path {{ ClonedProjectRoot }}/{{ buildProject[1].manifestPath }} --package-name {{ buildProject[1].localPackageName }} --local-package-path %YAMATO_SOURCE_DIR%/{{ buildProject[1].localPackagePath }}{% if buildProject[1].remove %} --remove-folder {{ buildProject[1].remove }}{% endif %} --cloned-project-root {{ ClonedProjectRoot }} |
49 | 49 |
|
50 | | - # Run python script to update ProjectSettings.asset in order to connect the project to Unity Services/set proper values. |
51 | | - # Notice that if a project has this already set up then in theory we don't need to run this script. |
52 | | - - python Tools/CI/scripts/BuildAutomation/connect_services.py --project-settings-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}/ProjectSettings/ProjectSettings.asset |
| 50 | + # Run python script to update ProjectSettings.asset in order to connect the project to Unity Services/set proper values. |
| 51 | + # Notice that if a project has this already set up then in theory we don't need to run this script. |
| 52 | + - python Tools/CI/scripts/BuildAutomation/connect_services.py --project-settings-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}/ProjectSettings/ProjectSettings.asset |
53 | 53 |
|
54 | | - # Enable or disable Burst compilation. This step is specific to Netcode package (or any package that uses Burst) |
55 | | - - IF "%BURST_ON_OFF%"=="on" (python Tools/CI/scripts/BuildAutomation/disable-enable-burst.py --enable-burst --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}) |
56 | | - ELSE (python Tools/CI/scripts/BuildAutomation/disable-enable-burst.py --disable-burst --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}) |
| 54 | + # Enable or disable Burst compilation. This step is specific to Netcode package (or any package that uses Burst) |
| 55 | + - IF "%BURST_ON_OFF%"=="on" (python Tools/CI/scripts/BuildAutomation/disable-enable-burst.py --enable-burst --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}) |
| 56 | + ELSE (python Tools/CI/scripts/BuildAutomation/disable-enable-burst.py --disable-burst --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}) |
57 | 57 |
|
58 | | - # Download the Unity Editor version specified in the UNITY_VERSION variable. Il2cpp component is downloaded only if the SCRIPTING_BACKEND_IL2CPP_MONO is set to "il2cpp". |
59 | | - # TODO: we could download components only if needed |
60 | | - - unity-downloader-cli --fast --wait -u %UNITY_VERSION% -p C:/TestingEditor -c Editor -c il2cpp -c Android -c macOS |
| 58 | + # Download the Unity Editor version specified in the UNITY_VERSION variable. Il2cpp component is downloaded only if the SCRIPTING_BACKEND_IL2CPP_MONO is set to "il2cpp". |
| 59 | + # TODO: we could download components only if needed |
| 60 | + - unity-downloader-cli --fast --wait -u %UNITY_VERSION% -p C:/TestingEditor -c Editor -c il2cpp -c Android -c macOS |
61 | 61 |
|
62 | | - # Add BuilderScript.cs to the project so we can modify and build the project using Unity Editor. |
63 | | - # This requires proper assembly definition in order for those scripts to compile properly. |
64 | | - - python Tools/CI/scripts/BuildAutomation/setup_build_scripts.py --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }} --source-dir %YAMATO_SOURCE_DIR% |
| 62 | + # Add BuilderScript.cs to the project so we can modify and build the project using Unity Editor. |
| 63 | + # This requires proper assembly definition in order for those scripts to compile properly. |
| 64 | + - python Tools/CI/scripts/BuildAutomation/setup_build_scripts.py --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }} --source-dir %YAMATO_SOURCE_DIR% |
65 | 65 |
|
66 | | - # Build the project using Unity Editor. This calls the appropriate static BuilderScripts method. |
67 | | - - python Tools/CI/scripts/BuildAutomation/get_build_method.py --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }} |
| 66 | + # Build the project using Unity Editor. This calls the appropriate static BuilderScripts method. |
| 67 | + - python Tools/CI/scripts/BuildAutomation/get_build_method.py --project-path {{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }} |
68 | 68 |
|
69 | | - # Print manifest dependencies after Unity Editor has processed the manifest to verify package overrides. |
70 | | - - python Tools/CI/scripts/BuildAutomation/print_manifest_info.py --manifest-path {{ ClonedProjectRoot }}/{{ buildProject[1].manifestPath }} |
| 69 | + # Print manifest dependencies after Unity Editor has processed the manifest to verify package overrides. |
| 70 | + - python Tools/CI/scripts/BuildAutomation/print_manifest_info.py --manifest-path {{ ClonedProjectRoot }}/{{ buildProject[1].manifestPath }} |
71 | 71 |
|
72 | | - # Copy build artifacts to source directory for Yamato artifact collection. |
73 | | - # TODO: This can be omitted if building directly in YAMATO_SOURCE_DIR instead of ClonedProjectRoot |
74 | | - - python -c "import os, shutil; os.makedirs('./build', exist_ok=True); shutil.copytree('{{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}/build', './build', dirs_exist_ok=True)" |
| 72 | + # Copy build artifacts to source directory for Yamato artifact collection. |
| 73 | + # TODO: This can be omitted if building directly in YAMATO_SOURCE_DIR instead of ClonedProjectRoot |
| 74 | + - python -c "import os, shutil; os.makedirs('./build', exist_ok=True); shutil.copytree('{{ ClonedProjectRoot }}/{{ buildProject[1].projectPath }}/build', './build', dirs_exist_ok=True)" |
75 | 75 |
|
76 | | -artifacts: |
77 | | - logs: |
78 | | - paths: |
79 | | - - '*.log' |
80 | | - - '*.xml' |
81 | | - - artifacts/**/* |
82 | | - players: |
83 | | - paths: |
84 | | - - build/**/* |
85 | | - {% endfor -%} |
| 76 | + artifacts: |
| 77 | + logs: |
| 78 | + paths: |
| 79 | + - '*.log' |
| 80 | + - '*.xml' |
| 81 | + - artifacts/**/* |
| 82 | + players: |
| 83 | + paths: |
| 84 | + - build/**/* |
| 85 | +{% endfor -%} |
0 commit comments