|
|
@ -17,7 +17,6 @@ |
|
|
|
#include "dbc.hpp" |
|
|
|
#include "dbc.hpp" |
|
|
|
|
|
|
|
|
|
|
|
using std::string; |
|
|
|
using std::string; |
|
|
|
using namespace fmt; |
|
|
|
|
|
|
|
using namespace nlohmann; |
|
|
|
using namespace nlohmann; |
|
|
|
using namespace std::chrono_literals; |
|
|
|
using namespace std::chrono_literals; |
|
|
|
|
|
|
|
|
|
|
@ -92,7 +91,7 @@ void Builder::BUILDING(BuildEvent ev) { |
|
|
|
auto m = parse_line(line); |
|
|
|
auto m = parse_line(line); |
|
|
|
|
|
|
|
|
|
|
|
if(m.match) { |
|
|
|
if(m.match) { |
|
|
|
gui.output(format("HIT WITH {} @ {}:{}:{} {}", m.type, m.file_name, m.lnumber, m.col, m.message)); |
|
|
|
gui.output(fmt::format("HIT WITH {} @ {}:{}:{} {}", m.type, m.file_name, m.lnumber, m.col, m.message)); |
|
|
|
game.event(GameEvent::HIT, m.type); |
|
|
|
game.event(GameEvent::HIT, m.type); |
|
|
|
} |
|
|
|
} |
|
|
|
state(BuildState::READING); |
|
|
|
state(BuildState::READING); |
|
|
@ -100,7 +99,7 @@ void Builder::BUILDING(BuildEvent ev) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Builder::START(BuildEvent ev) { |
|
|
|
void Builder::START(BuildEvent ev) { |
|
|
|
gui.output(format("Using build command: {}", build_cmd)); |
|
|
|
gui.output(fmt::format("Using build command: {}", build_cmd)); |
|
|
|
fileWatcher = new efsw::FileWatcher(); |
|
|
|
fileWatcher = new efsw::FileWatcher(); |
|
|
|
dbc::check(fileWatcher != nullptr, "Failed to create filewatcher."); |
|
|
|
dbc::check(fileWatcher != nullptr, "Failed to create filewatcher."); |
|
|
|
|
|
|
|
|
|
|
@ -112,7 +111,7 @@ void Builder::START(BuildEvent ev) { |
|
|
|
listener = new UpdateListener(repo); |
|
|
|
listener = new UpdateListener(repo); |
|
|
|
dbc::check(listener != nullptr, "Failed to create listener."); |
|
|
|
dbc::check(listener != nullptr, "Failed to create listener."); |
|
|
|
|
|
|
|
|
|
|
|
gui.output(format("Watching directory {} for changes...", git_path)); |
|
|
|
gui.output(fmt::format("Watching directory {} for changes...", git_path)); |
|
|
|
wid = fileWatcher->addWatch(git_path, listener, true); |
|
|
|
wid = fileWatcher->addWatch(git_path, listener, true); |
|
|
|
fileWatcher->watch(); |
|
|
|
fileWatcher->watch(); |
|
|
|
|
|
|
|
|
|
|
@ -123,7 +122,7 @@ void Builder::WAITING(BuildEvent ev) { |
|
|
|
if(listener->changes) { |
|
|
|
if(listener->changes) { |
|
|
|
game.event(GameEvent::BUILD_START); |
|
|
|
game.event(GameEvent::BUILD_START); |
|
|
|
gui.building(); |
|
|
|
gui.building(); |
|
|
|
gui.output(format("CHANGES! Running build {}", build_cmd)); |
|
|
|
gui.output(fmt::format("CHANGES! Running build {}", build_cmd)); |
|
|
|
state(BuildState::FORKING); |
|
|
|
state(BuildState::FORKING); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|