chore: attempted to change build path to see if CI fails

This commit is contained in:
Paolo Abela 2024-06-03 09:24:43 +01:00
Родитель 43437554ff
Коммит 72f91399c8
2 изменённых файлов: 43 добавлений и 44 удалений

Просмотреть файл

@ -15,24 +15,24 @@ namespace Unity.DedicatedGameServerSample.Editor
const string k_BuildClientAndServer = k_MenuRoot + "Build Client(s) and Server(s)"; const string k_BuildClientAndServer = k_MenuRoot + "Build Client(s) and Server(s)";
const string k_ToggleAllName = k_MenuRoot + "Toggle All clients and servers"; const string k_ToggleAllName = k_MenuRoot + "Toggle All clients and servers";
const string k_ClientToggleName = k_MenuRoot + "Toggle All clients"; const string k_ClientToggleName = k_MenuRoot + "Toggle All clients";
const string k_ClientMacOSToggleName = k_MenuRoot + "Toggle MacOS client"; const string k_ClientMacOSToggleName = k_MenuRoot + "Toggle MacOS client";
const string k_ClientWindowsToggleName = k_MenuRoot + "Toggle Windows client"; const string k_ClientWindowsToggleName = k_MenuRoot + "Toggle Windows client";
const string k_ClientLinuxToggleName = k_MenuRoot + "Toggle Linux client"; const string k_ClientLinuxToggleName = k_MenuRoot + "Toggle Linux client";
const string k_ServerToggleName = k_MenuRoot + "Toggle All servers"; const string k_ServerToggleName = k_MenuRoot + "Toggle All servers";
const string k_ServerMacOSToggleName = k_MenuRoot + "Toggle MacOS server"; const string k_ServerMacOSToggleName = k_MenuRoot + "Toggle MacOS server";
const string k_ServerWindowsToggleName = k_MenuRoot + "Toggle Windows server"; const string k_ServerWindowsToggleName = k_MenuRoot + "Toggle Windows server";
const string k_ServerLinuxToggleName = k_MenuRoot + "Toggle Linux server"; const string k_ServerLinuxToggleName = k_MenuRoot + "Toggle Linux server";
const int k_MenuGroupingBuild = 0; // to add separator in menus const int k_MenuGroupingBuild = 0; // to add separator in menus
const int k_MenuGroupingToggles = 11; const int k_MenuGroupingToggles = 11;
const int k_MenuGroupingClientPlatforms = 22; const int k_MenuGroupingClientPlatforms = 22;
const int k_MenuGroupingServerPlatforms = 33; const int k_MenuGroupingServerPlatforms = 33;
static bool s_ExitApplicationOnFailure = false; static bool s_ExitApplicationOnFailure = false;
[MenuItem(k_ToggleAllName, false, k_MenuGroupingToggles)] [MenuItem(k_ToggleAllName, false, k_MenuGroupingToggles)]
static void ToggleAllClientsAndServers() static void ToggleAllClientsAndServers()
{ {
@ -46,7 +46,7 @@ namespace Unity.DedicatedGameServerSample.Editor
ToggleMenu(k_ServerWindowsToggleName, newValue); ToggleMenu(k_ServerWindowsToggleName, newValue);
ToggleMenu(k_ServerLinuxToggleName, newValue); ToggleMenu(k_ServerLinuxToggleName, newValue);
} }
[MenuItem(k_ClientToggleName, false, k_MenuGroupingToggles)] [MenuItem(k_ClientToggleName, false, k_MenuGroupingToggles)]
static void ToggleAllClients() static void ToggleAllClients()
{ {
@ -55,25 +55,25 @@ namespace Unity.DedicatedGameServerSample.Editor
ToggleMenu(k_ClientWindowsToggleName, newValue); ToggleMenu(k_ClientWindowsToggleName, newValue);
ToggleMenu(k_ClientLinuxToggleName, newValue); ToggleMenu(k_ClientLinuxToggleName, newValue);
} }
[MenuItem(k_ClientMacOSToggleName, false, k_MenuGroupingClientPlatforms)] [MenuItem(k_ClientMacOSToggleName, false, k_MenuGroupingClientPlatforms)]
static void ToggleClientMacOS() static void ToggleClientMacOS()
{ {
ToggleMenu(k_ClientMacOSToggleName); ToggleMenu(k_ClientMacOSToggleName);
} }
[MenuItem(k_ClientWindowsToggleName, false, k_MenuGroupingClientPlatforms)] [MenuItem(k_ClientWindowsToggleName, false, k_MenuGroupingClientPlatforms)]
static void ToggleClientWindows() static void ToggleClientWindows()
{ {
ToggleMenu(k_ClientWindowsToggleName); ToggleMenu(k_ClientWindowsToggleName);
} }
[MenuItem(k_ClientLinuxToggleName, false, k_MenuGroupingClientPlatforms)] [MenuItem(k_ClientLinuxToggleName, false, k_MenuGroupingClientPlatforms)]
static void ToggleClientLinux() static void ToggleClientLinux()
{ {
ToggleMenu(k_ClientLinuxToggleName); ToggleMenu(k_ClientLinuxToggleName);
} }
[MenuItem(k_ServerToggleName, false, k_MenuGroupingToggles)] [MenuItem(k_ServerToggleName, false, k_MenuGroupingToggles)]
static void ToggleAllServers() static void ToggleAllServers()
{ {
@ -82,25 +82,25 @@ namespace Unity.DedicatedGameServerSample.Editor
ToggleMenu(k_ServerWindowsToggleName, newValue); ToggleMenu(k_ServerWindowsToggleName, newValue);
ToggleMenu(k_ServerLinuxToggleName, newValue); ToggleMenu(k_ServerLinuxToggleName, newValue);
} }
[MenuItem(k_ServerMacOSToggleName, false, k_MenuGroupingServerPlatforms)] [MenuItem(k_ServerMacOSToggleName, false, k_MenuGroupingServerPlatforms)]
static void ToggleServerMacOS() static void ToggleServerMacOS()
{ {
ToggleMenu(k_ServerMacOSToggleName); ToggleMenu(k_ServerMacOSToggleName);
} }
[MenuItem(k_ServerWindowsToggleName, false, k_MenuGroupingServerPlatforms)] [MenuItem(k_ServerWindowsToggleName, false, k_MenuGroupingServerPlatforms)]
static void ToggleServerWindows() static void ToggleServerWindows()
{ {
ToggleMenu(k_ServerWindowsToggleName); ToggleMenu(k_ServerWindowsToggleName);
} }
[MenuItem(k_ServerLinuxToggleName, false, k_MenuGroupingServerPlatforms)] [MenuItem(k_ServerLinuxToggleName, false, k_MenuGroupingServerPlatforms)]
static void ToggleServerLinux() static void ToggleServerLinux()
{ {
ToggleMenu(k_ServerLinuxToggleName); ToggleMenu(k_ServerLinuxToggleName);
} }
[MenuItem(k_BuildClientAndServer, true)] [MenuItem(k_BuildClientAndServer, true)]
static bool CanBuildServerAndClient() static bool CanBuildServerAndClient()
{ {
@ -113,7 +113,7 @@ namespace Unity.DedicatedGameServerSample.Editor
BuildAllEnabledServers(); BuildAllEnabledServers();
BuildAllEnabledClients(); BuildAllEnabledClients();
} }
[MenuItem(k_BuildServer, true)] [MenuItem(k_BuildServer, true)]
static bool CanBuildServer() static bool CanBuildServer()
{ {
@ -129,7 +129,7 @@ namespace Unity.DedicatedGameServerSample.Editor
bool buildWindows = Menu.GetChecked(k_ServerWindowsToggleName); bool buildWindows = Menu.GetChecked(k_ServerWindowsToggleName);
bool buildLinux = Menu.GetChecked(k_ServerLinuxToggleName); bool buildLinux = Menu.GetChecked(k_ServerLinuxToggleName);
var buildPathRoot = Path.Combine("Builds", "Server"); var buildPathRoot = Path.Combine(Application.dataPath, "..", "Builds", "Server");
DeleteOutputFolder("Server/"); DeleteOutputFolder("Server/");
@ -148,7 +148,7 @@ namespace Unity.DedicatedGameServerSample.Editor
BuildProcessor.BuildServer(BuildTarget.StandaloneLinux64, Path.Combine(buildPathRoot, "Linux64", "Game.x86_64"), s_ExitApplicationOnFailure); BuildProcessor.BuildServer(BuildTarget.StandaloneLinux64, Path.Combine(buildPathRoot, "Linux64", "Game.x86_64"), s_ExitApplicationOnFailure);
} }
} }
[MenuItem(k_BuildClient, true)] [MenuItem(k_BuildClient, true)]
static bool CanBuildClient() static bool CanBuildClient()
{ {
@ -164,7 +164,7 @@ namespace Unity.DedicatedGameServerSample.Editor
bool buildWindows = Menu.GetChecked(k_ClientWindowsToggleName); bool buildWindows = Menu.GetChecked(k_ClientWindowsToggleName);
bool buildLinux = Menu.GetChecked(k_ClientLinuxToggleName); bool buildLinux = Menu.GetChecked(k_ClientLinuxToggleName);
var buildPathRoot = Path.Combine("Builds", "Client"); var buildPathRoot = Path.Combine(Application.dataPath, "..", "Builds", "Client");
DeleteOutputFolder("Client/"); DeleteOutputFolder("Client/");
@ -183,7 +183,7 @@ namespace Unity.DedicatedGameServerSample.Editor
BuildProcessor.BuildClient(BuildTarget.StandaloneLinux64, Path.Combine(buildPathRoot, "Linux64", "Game.x86_64"), s_ExitApplicationOnFailure); BuildProcessor.BuildClient(BuildTarget.StandaloneLinux64, Path.Combine(buildPathRoot, "Linux64", "Game.x86_64"), s_ExitApplicationOnFailure);
} }
} }
/// <summary> /// <summary>
/// Toggles everything on and builds a client and a server for each platform. This is used in the continuous integration flow. /// Toggles everything on and builds a client and a server for each platform. This is used in the continuous integration flow.
/// </summary> /// </summary>
@ -192,7 +192,7 @@ namespace Unity.DedicatedGameServerSample.Editor
// setting menus unchecked so toggling afterwards will check everything // setting menus unchecked so toggling afterwards will check everything
ToggleMenu(k_ClientToggleName, false); ToggleMenu(k_ClientToggleName, false);
ToggleMenu(k_ServerToggleName, false); ToggleMenu(k_ServerToggleName, false);
// toggling on every platform // toggling on every platform
ToggleAllClients(); ToggleAllClients();
ToggleAllServers(); ToggleAllServers();

Просмотреть файл

@ -130,37 +130,36 @@ namespace Unity.DedicatedGameServerSample.Editor
internal static void BuildServer(BuildTarget target, string locationPathName, bool exitApplicationOnFailure = false) internal static void BuildServer(BuildTarget target, string locationPathName, bool exitApplicationOnFailure = false)
{ {
Debug.Log($"Building {target} server"); Debug.Log($"Building {target} server in: {locationPathName}");
EditorUserBuildSettings.SwitchActiveBuildTarget(NamedBuildTarget.Server, BuildTarget.StandaloneLinux64); EditorUserBuildSettings.SwitchActiveBuildTarget(NamedBuildTarget.Server, BuildTarget.StandaloneLinux64);
//var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions
//{ {
// scenes = GetScenePaths(), scenes = GetScenePaths(),
// locationPathName = locationPathName, locationPathName = locationPathName,
// target = target, target = target,
// subtarget = (int) StandaloneBuildSubtarget.Server, subtarget = (int)StandaloneBuildSubtarget.Server,
//}); });
//if (exitApplicationOnFailure && report.summary.result != BuildResult.Succeeded) if (exitApplicationOnFailure && report.summary.result != BuildResult.Succeeded)
//{ {
// EditorApplication.Exit(1); EditorApplication.Exit(1);
//} }
} }
internal static void BuildClient(BuildTarget target, string locationPathName, bool exitApplicationOnFailure = false) internal static void BuildClient(BuildTarget target, string locationPathName, bool exitApplicationOnFailure = false)
{ {
Debug.Log($"Building {target} client"); Debug.Log($"Building {target} client in: {locationPathName}");
EditorUserBuildSettings.SwitchActiveBuildTarget(NamedBuildTarget.Standalone, target); EditorUserBuildSettings.SwitchActiveBuildTarget(NamedBuildTarget.Standalone, target);
//var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions
//{ {
// scenes = GetScenePaths(), scenes = GetScenePaths(),
// locationPathName = locationPathName, locationPathName = locationPathName,
// target = target, target = target,
// subtarget = (int) StandaloneBuildSubtarget.Player, subtarget = (int)StandaloneBuildSubtarget.Player,
//}); });
//if (exitApplicationOnFailure && report.summary.result != BuildResult.Succeeded) if (exitApplicationOnFailure && report.summary.result != BuildResult.Succeeded)
//{ {
// EditorApplication.Exit(1); EditorApplication.Exit(1);
//} }
} }
static string[] GetScenePaths() static string[] GetScenePaths()