Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanunity committed Mar 12, 2024
2 parents f1497f4 + 99a46a2 commit c21ca7e
Show file tree
Hide file tree
Showing 217 changed files with 20,578 additions and 4,506 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ docerrors.log

Assets/**/*.api
Assets/**/*.api.meta
Assets/__TestInputAsset.inputactions
Assets/__TestInputAsset.inputactions.meta

Packages/packages-lock.json
Packages/com.unity.inputsystem/artifacts/**
Expand Down
5 changes: 2 additions & 3 deletions .yamato/config.metadata
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
editors:
- version: 2021.3
- version: 2022.3
- version: 2023.1
- version: 2023.2
- version: trunk
disable_tvos_run: true
Expand Down Expand Up @@ -29,7 +28,7 @@ platforms_win:
flavor: b1.large
runtime: StandaloneWindows64
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP --wait --fast -u
platforms_nix:
- name: mac
type: Unity::VM::osx
Expand All @@ -46,7 +45,7 @@ platforms_nix:
flavor: m1.mac
runtime: StandaloneOSX
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP --wait --fast -u
scripting_backends:
- name: mono
- name: il2cpp
10 changes: 5 additions & 5 deletions .yamato/upm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- move /Y .\Packages\com.unity.inputsystem\Samples .\Assets
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
artifacts:
UTR_Output.zip:
paths:
Expand Down Expand Up @@ -67,7 +67,7 @@
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" %} --suite=editor {% endif %} --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
artifacts:
UTR_Output.zip:
paths:
Expand All @@ -85,7 +85,7 @@ build_ios_{{ editor.version }}:
commands:
- {{ utr_install_nix }}
- {{ unity_downloader_install }}
- unity-downloader-cli -c Editor -c iOS -u {{ editor.version }} --fast -w
- unity-downloader-cli -c Editor -c iOS -u {{ editor.version }} --fast --wait
- ./utr --suite=playmode --platform=iOS --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --build-only --report-performance-data --performance-project-id=InputSystem
artifacts:
players:
Expand Down Expand Up @@ -122,7 +122,7 @@ build_tvos_{{ editor.version }}:
commands:
- {{ utr_install_nix }}
- {{ unity_downloader_install }}
- unity-downloader-cli -c Editor -c AppleTV -u {{ editor.version }} --fast -w
- unity-downloader-cli -c Editor -c AppleTV -u {{ editor.version }} --fast --wait
- ./utr --suite=playmode --platform=tvOS --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --build-only --report-performance-data --performance-project-id=InputSystem
artifacts:
players:
Expand Down Expand Up @@ -159,7 +159,7 @@ build_android_{{ editor.version }}_{{ backend.name }}:
commands:
- {{ utr_install_win }}
- {{ unity_downloader_install }}
- unity-downloader-cli -c Editor -c Android -u {{ editor.version }} --fast -w
- unity-downloader-cli -c Editor -c Android -u {{ editor.version }} --fast --wait
- ./utr --suite=playmode --platform=Android --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --scripting-backend={{ backend.name }} --build-only --repository --performance-project-id=InputSystem
artifacts:
players:
Expand Down
8 changes: 8 additions & 0 deletions Assets/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions Assets/Editor/AddScenesToBuild.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;

[InitializeOnLoad]
public class AddScenesToBuild : EditorWindow
{
private const string corePlatformsMenu = "Assets/QA/Tests/Core Platform Menu/Core Platforms Menu.unity";

[MenuItem("QA Tools/Open Core Scene Menu")]
static void OpenScene()
{
EditorSceneManager.OpenScene(corePlatformsMenu);
}

[MenuItem("QA Tools/Add All Core Samples to Build")]
private static void AddAllScenesToBuildExcludingXboxAndXR()
{
// Get all available scenes in the project
string[] sceneGuids = AssetDatabase.FindAssets("t:Scene");
string[] scenePaths = new string[sceneGuids.Length];

for (int i = 0; i < sceneGuids.Length; i++)
{
scenePaths[i] = AssetDatabase.GUIDToAssetPath(sceneGuids[i]);
}
// Filter out scenes in folders containing "xbox" or "xr"
List<string> filteredScenePaths = new List<string>();
string coreScene = null;

// Find the corePlatformsMenu scene and remove it from the general scene list
for (int i = 0; i < scenePaths.Length; i++)
{
if (scenePaths[i] == corePlatformsMenu)
{
coreScene = scenePaths[i];
}
else if (!IsPathInExcludedFolder(scenePaths[i]))
{
filteredScenePaths.Add(scenePaths[i]);
}
}

// Add and ensure "Core Platforms Menu" is at the beginning of the list
if (!string.IsNullOrEmpty(coreScene))
{
filteredScenePaths.Insert(0, coreScene);
}

// Update the build settings
EditorBuildSettingsScene[] buildScenes = new EditorBuildSettingsScene[filteredScenePaths.Count];
for (int i = 0; i < filteredScenePaths.Count; i++)
{
buildScenes[i] = new EditorBuildSettingsScene(filteredScenePaths[i], true);
}
EditorBuildSettings.scenes = buildScenes;
Debug.Log("All scenes (excluding Xbox and XR) added to build settings.");
}

private static bool IsPathInExcludedFolder(string path)
{
// Specify folder names to exclude
string[] excludedFolders = { "xbox", "xr" };

// Check if the path or any part of it contains any of the excluded folder names
foreach (string folder in excludedFolders)
{
if (path.ToLower().Contains(folder.ToLower()))
{
return true;
}
}
return false;
}

private static void SaveBuildSettings()
{
// Save the current build settings to EditorPrefs
int sceneCount = EditorBuildSettings.scenes.Length;
EditorPrefs.SetInt("BuildSettingsSceneCount", sceneCount);
for (int i = 0; i < sceneCount; i++)
{
EditorPrefs.SetString($"BuildSettingsScenePath_{i}", EditorBuildSettings.scenes[i].path);
EditorPrefs.SetBool($"BuildSettingsSceneEnabled_{i}", EditorBuildSettings.scenes[i].enabled);
}
}

private static void RestoreBuildSettings()
{
// Restore the build settings from EditorPrefs
int sceneCount = EditorPrefs.GetInt("BuildSettingsSceneCount", 0);
EditorBuildSettingsScene[] buildScenes = new EditorBuildSettingsScene[sceneCount];
for (int i = 0; i < sceneCount; i++)
{
string scenePath = EditorPrefs.GetString($"BuildSettingsScenePath_{i}", "");
bool sceneEnabled = EditorPrefs.GetBool($"BuildSettingsSceneEnabled_{i}", false);

buildScenes[i] = new EditorBuildSettingsScene(scenePath, sceneEnabled);
}
EditorBuildSettings.scenes = buildScenes;
}
}
2 changes: 2 additions & 0 deletions Assets/Editor/AddScenesToBuild.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c21ca7e

Please sign in to comment.