Add Project Manager File menu options to Editor

This commit is contained in:
Alex Peterson
2021-06-01 15:30:14 -07:00
committed by GitHub
parent 9e3b7b45d9
commit afe20906db
14 changed files with 147 additions and 17 deletions
@@ -78,7 +78,7 @@ namespace AzFramework::ProjectManager
projectJsonPath.c_str());
}
if (LaunchProjectManager(engineRootPath))
if (LaunchProjectManager())
{
AZ_TracePrintf("ProjectManager", "Project Manager launched successfully, requesting exit.");
return ProjectPathCheckResult::ProjectManagerLaunched;
@@ -87,7 +87,7 @@ namespace AzFramework::ProjectManager
return ProjectPathCheckResult::ProjectManagerLaunchFailed;
}
bool LaunchProjectManager([[maybe_unused]] const AZ::IO::FixedMaxPath& engineRootPath)
bool LaunchProjectManager(const AZStd::string& commandLineArgs)
{
bool launchSuccess = false;
#if (AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER)
@@ -109,7 +109,7 @@ namespace AzFramework::ProjectManager
}
AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo;
processLaunchInfo.m_commandlineParameters = executablePath.String();
processLaunchInfo.m_commandlineParameters = executablePath.String() + commandLineArgs;
launchSuccess = AzFramework::ProcessLauncher::LaunchUnwatchedProcess(processLaunchInfo);
}
if (ownsSystemAllocator)
@@ -12,6 +12,7 @@
#pragma once
#include <AzCore/IO/Path/Path_fwd.h>
#include <AzCore/std/string/string.h>
namespace AzFramework::ProjectManager
{
@@ -21,8 +22,16 @@ namespace AzFramework::ProjectManager
ProjectManagerLaunched = 0,
ProjectPathFound = 1
};
// Check for a project name, if not found, attempts to launch project manager and returns false
//! Check for a project name, if not found, attempts to launch project manager and returns false
//! @param argc the number of arguments in argv
//! @param argv arguments provided to this executable
//! @return a ProjectPathCheckResult
ProjectPathCheckResult CheckProjectPathProvided(const int argc, char* argv[]);
// Attempt to Launch the project manager. Requires locating the engine root, project manager script, and python.
bool LaunchProjectManager(const AZ::IO::FixedMaxPath& engineRootPath);
//! Attempt to Launch the project manager, assuming the o3de executable exists in same folder as
//! current executable. Requires the o3de cli and python.
//! @param commandLineArgs additional command line arguments to provide to the project manager
//! @return true on success, false if failed to find or launch the executable
bool LaunchProjectManager(const AZStd::string& commandLineArgs = "");
} // AzFramework::ProjectManager