Create file in project directory on successful build for Project Manager

Signed-off-by: AMZN-Phil <pconroy@amazon.com>
monroegm-disable-blank-issue-2
AMZN-Phil 4 years ago
parent cbe2948ba8
commit bc20208f13

@ -10,6 +10,8 @@
#include <ProjectBuilderWorker.h>
#include <ProjectButtonWidget.h>
#include <AzFramework/IO/LocalFileIO.h>
#include <QMessageBox>
#include <QDesktopServices>
#include <QUrl>
@ -80,6 +82,10 @@ namespace O3DE::ProjectManager
void ProjectBuilderController::HandleResults(const QString& result)
{
AZ::IO::LocalFileIO fileIO;
AZStd::string successBuildFilePath = AZStd::string::format("%s/%s",
m_projectInfo.m_path.toStdString().c_str(), "ProjectManagerBuildSuccess");
if (!result.isEmpty())
{
if (result.contains(tr("log")))
@ -109,12 +115,21 @@ namespace O3DE::ProjectManager
emit NotifyBuildProject(m_projectInfo);
}
fileIO.Remove(successBuildFilePath.c_str());
emit Done(false);
return;
}
else
{
m_projectInfo.m_buildFailed = false;
AZ::IO::HandleType fileHandle;
if (fileIO.Open(successBuildFilePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle))
{
// We just need the file to exist
fileIO.Close(fileHandle);
}
}
emit Done(true);

@ -22,6 +22,7 @@
#include <AzFramework/Process/ProcessCommon.h>
#include <AzFramework/Process/ProcessWatcher.h>
#include <AzCore/Utils/Utils.h>
#include <AzFramework/IO/LocalFileIO.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
@ -269,17 +270,33 @@ namespace O3DE::ProjectManager
// Add any missing project buttons and restore buttons to default state
for (const ProjectInfo& project : projectsVector)
{
ProjectButton* currentButton = nullptr;
if (!m_projectButtons.contains(QDir::toNativeSeparators(project.m_path)))
{
m_projectButtons.insert(QDir::toNativeSeparators(project.m_path), CreateProjectButton(project));
currentButton = CreateProjectButton(project);
m_projectButtons.insert(QDir::toNativeSeparators(project.m_path), currentButton);
}
else
{
auto projectButtonIter = m_projectButtons.find(QDir::toNativeSeparators(project.m_path));
if (projectButtonIter != m_projectButtons.end())
{
projectButtonIter.value()->RestoreDefaultState();
m_projectsFlowLayout->addWidget(projectButtonIter.value());
currentButton = projectButtonIter.value();
currentButton->RestoreDefaultState();
m_projectsFlowLayout->addWidget(currentButton);
}
}
// Check whether project manager has successfully built the project
if (currentButton)
{
AZStd::string successfulBuildFilePath = AZStd::string::format("%s/%s",
project.m_path.toStdString().c_str(), "ProjectManagerBuildSuccess");
AZ::IO::LocalFileIO fileIO;
if (!fileIO.Exists(successfulBuildFilePath.c_str()))
{
currentButton->ShowBuildRequired();
}
}
}

Loading…
Cancel
Save