|
|
@ -88,7 +88,7 @@ void Builder::building(BuildEvent ev) { |
|
|
|
|
|
|
|
|
|
|
|
build_out = NULL; |
|
|
|
build_out = NULL; |
|
|
|
game.event(GameEvent::BUILD_DONE); |
|
|
|
game.event(GameEvent::BUILD_DONE); |
|
|
|
state(DONE); |
|
|
|
state(BuildState::DONE); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
auto m = parse_line(line); |
|
|
|
auto m = parse_line(line); |
|
|
|
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ void Builder::building(BuildEvent ev) { |
|
|
|
gui.output(format("HIT WITH {} @ {}:{}:{} {}", m.type, m.file_name, m.lnumber, m.col, m.message)); |
|
|
|
gui.output(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(READING); |
|
|
|
state(BuildState::READING); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -117,7 +117,7 @@ void Builder::start(BuildEvent ev) { |
|
|
|
wid = fileWatcher->addWatch(git_path, listener, true); |
|
|
|
wid = fileWatcher->addWatch(git_path, listener, true); |
|
|
|
fileWatcher->watch(); |
|
|
|
fileWatcher->watch(); |
|
|
|
|
|
|
|
|
|
|
|
state(WAITING); |
|
|
|
state(BuildState::WAITING); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Builder::waiting(BuildEvent ev) { |
|
|
|
void Builder::waiting(BuildEvent ev) { |
|
|
@ -125,7 +125,7 @@ void Builder::waiting(BuildEvent ev) { |
|
|
|
game.event(GameEvent::BUILD_START); |
|
|
|
game.event(GameEvent::BUILD_START); |
|
|
|
gui.building(); |
|
|
|
gui.building(); |
|
|
|
gui.output(format("CHANGES! Running build {}", build_cmd)); |
|
|
|
gui.output(format("CHANGES! Running build {}", build_cmd)); |
|
|
|
state(FORKING); |
|
|
|
state(BuildState::FORKING); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -135,16 +135,16 @@ void Builder::forking(BuildEvent ev) { |
|
|
|
|
|
|
|
|
|
|
|
if(status == std::future_status::ready) { |
|
|
|
if(status == std::future_status::ready) { |
|
|
|
build_out = build_fut.get(); |
|
|
|
build_out = build_fut.get(); |
|
|
|
state(READING); |
|
|
|
state(BuildState::READING); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
state(FORKING); |
|
|
|
state(BuildState::FORKING); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
build_fut = std::async([&]() { |
|
|
|
build_fut = std::async([&]() { |
|
|
|
return start_command(build_cmd); |
|
|
|
return start_command(build_cmd); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
state(FORKING); |
|
|
|
state(BuildState::FORKING); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -155,9 +155,9 @@ void Builder::reading(BuildEvent ev) { |
|
|
|
|
|
|
|
|
|
|
|
if(status == std::future_status::ready) { |
|
|
|
if(status == std::future_status::ready) { |
|
|
|
line = read_fut.get(); |
|
|
|
line = read_fut.get(); |
|
|
|
state(BUILDING); |
|
|
|
state(BuildState::BUILDING); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
state(READING); |
|
|
|
state(BuildState::READING); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
read_fut = std::async([&]() { |
|
|
|
read_fut = std::async([&]() { |
|
|
@ -173,14 +173,14 @@ void Builder::done(BuildEvent ev) { |
|
|
|
|
|
|
|
|
|
|
|
listener->reset_state(); |
|
|
|
listener->reset_state(); |
|
|
|
gui.output("^^^^^^^^^^^ END ^^^^^^^^^^^"); |
|
|
|
gui.output("^^^^^^^^^^^ END ^^^^^^^^^^^"); |
|
|
|
state(WAITING); |
|
|
|
state(BuildState::WAITING); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Builder::exit(BuildEvent ev) { |
|
|
|
void Builder::exit(BuildEvent ev) { |
|
|
|
if(ev == QUIT) { |
|
|
|
if(ev == QUIT) { |
|
|
|
fileWatcher->removeWatch(wid); |
|
|
|
fileWatcher->removeWatch(wid); |
|
|
|
git_libgit2_shutdown(); |
|
|
|
git_libgit2_shutdown(); |
|
|
|
state(EXIT); |
|
|
|
state(BuildState::EXIT); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|