Fixed bin and obj folders respawning and causing engine crashes
This commit is contained in:
parent
4b6ede88e2
commit
a83a38eba8
|
@ -17,6 +17,7 @@ of DigiPen Institute of Technology is prohibited.
|
||||||
#include <fstream> // std::fstream
|
#include <fstream> // std::fstream
|
||||||
#include <filesystem> // std::filesystem::canonical, std::filesystem::remove
|
#include <filesystem> // std::filesystem::canonical, std::filesystem::remove
|
||||||
#include <memory> // std::shared_ptr
|
#include <memory> // std::shared_ptr
|
||||||
|
#include <thread> // std::this_thread::sleep_for
|
||||||
// Project Headers
|
// Project Headers
|
||||||
#include "Tools/SHLogger.h"
|
#include "Tools/SHLogger.h"
|
||||||
#include "Tools/SHStringUtils.h"
|
#include "Tools/SHStringUtils.h"
|
||||||
|
@ -25,7 +26,6 @@ of DigiPen Institute of Technology is prohibited.
|
||||||
#include "Events/SHEventReceiver.h"
|
#include "Events/SHEventReceiver.h"
|
||||||
#include "Events/SHEventManager.hpp"
|
#include "Events/SHEventManager.hpp"
|
||||||
#include "Physics/SHPhysicsSystem.h"
|
#include "Physics/SHPhysicsSystem.h"
|
||||||
|
|
||||||
#include "Assets/SHAssetMacros.h"
|
#include "Assets/SHAssetMacros.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
|
@ -177,10 +177,10 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare directory (delete useless files)
|
// Prepare directory (delete useless files)
|
||||||
deleteFolder(CSPROJ_DIR + "\\net5.0");
|
deleteFolder(CSPROJ_DIR + "/net5.0");
|
||||||
deleteFolder(CSPROJ_DIR + "\\ref");
|
deleteFolder(CSPROJ_DIR + "/ref");
|
||||||
deleteFolder(CSPROJ_DIR + "\\obj");
|
deleteFolder(CSPROJ_DIR + "/obj");
|
||||||
deleteFolder(CSPROJ_DIR + "\\bin");
|
deleteFolder(CSPROJ_DIR + "/bin");
|
||||||
|
|
||||||
// Attempt to build the assembly
|
// Attempt to build the assembly
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
@ -214,7 +214,10 @@ namespace SHADE
|
||||||
|
|
||||||
// Clean up built files
|
// Clean up built files
|
||||||
deleteFolder("./tmp");
|
deleteFolder("./tmp");
|
||||||
deleteFolder(CSPROJ_DIR + "\\obj");
|
deleteFolder(CSPROJ_DIR + "/bin");
|
||||||
|
using namespace std::chrono_literals;
|
||||||
|
std::this_thread::sleep_for(50ms); // Not sure why this works but it prevents the folders from respawning
|
||||||
|
deleteFolder(CSPROJ_DIR + "/obj");
|
||||||
|
|
||||||
// Read the build log and output to the console
|
// Read the build log and output to the console
|
||||||
dumpBuildLog(BUILD_LOG_PATH);
|
dumpBuildLog(BUILD_LOG_PATH);
|
||||||
|
|
Loading…
Reference in New Issue