add/remove gem python bindings

main
Alex Peterson 5 years ago committed by GitHub
parent a86f61e360
commit cfbae9a18b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -508,6 +508,42 @@ namespace O3DE::ProjectManager
}
}
bool PythonBindings::AddGemToProject(const QString& gemPath, const QString& projectPath)
{
bool result = ExecuteWithLock([&] {
pybind11::str pyGemPath = gemPath.toStdString();
pybind11::str pyProjectPath = projectPath.toStdString();
m_registration.attr("add_gem_to_project")(
pybind11::none(), // gem_name
pyGemPath,
pybind11::none(), // gem_target
pybind11::none(), // project_name
pyProjectPath
);
});
return result;
}
bool PythonBindings::RemoveGemFromProject(const QString& gemPath, const QString& projectPath)
{
bool result = ExecuteWithLock([&] {
pybind11::str pyGemPath = gemPath.toStdString();
pybind11::str pyProjectPath = projectPath.toStdString();
m_registration.attr("remove_gem_to_project")(
pybind11::none(), // gem_name
pyGemPath,
pybind11::none(), // gem_target
pybind11::none(), // project_name
pyProjectPath
);
});
return result;
}
bool PythonBindings::UpdateProject([[maybe_unused]] const ProjectInfo& projectInfo)
{
return false;

@ -47,6 +47,8 @@ namespace O3DE::ProjectManager
AZ::Outcome<ProjectInfo> GetProject(const QString& path) override;
AZ::Outcome<QVector<ProjectInfo>> GetProjects() override;
bool UpdateProject(const ProjectInfo& projectInfo) override;
bool AddGemToProject(const QString& gemPath, const QString& projectPath) override;
bool RemoveGemFromProject(const QString& gemPath, const QString& projectPath) override;
// ProjectTemplate
AZ::Outcome<QVector<ProjectTemplateInfo>> GetProjectTemplates() override;

@ -96,6 +96,22 @@ namespace O3DE::ProjectManager
*/
virtual bool UpdateProject(const ProjectInfo& projectInfo) = 0;
/**
* Add a gem to a project
* @param gemPath the absolute path to the gem
* @param projectPath the absolute path to the project
* @return true on success, false on failure
*/
virtual bool AddGemToProject(const QString& gemPath, const QString& projectPath) = 0;
/**
* Remove gem to a project
* @param gemPath the absolute path to the gem
* @param projectPath the absolute path to the project
* @return true on success, false on failure
*/
virtual bool RemoveGemFromProject(const QString& gemPath, const QString& projectPath) = 0;
// Project Templates

Loading…
Cancel
Save