|
|
@ -18,18 +18,17 @@ |
|
|
|
#include <stdlib.h> // for EXIT_SUCCESS |
|
|
|
#include <stdlib.h> // for EXIT_SUCCESS |
|
|
|
#include <string> // for operator+, to_string |
|
|
|
#include <string> // for operator+, to_string |
|
|
|
#include <unistd.h> |
|
|
|
#include <unistd.h> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include <nlohmann/json.hpp> |
|
|
|
#include <nlohmann/json.hpp> |
|
|
|
#include <fstream> |
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
|
|
|
|
using namespace std; |
|
|
|
using std::string; |
|
|
|
using namespace fmt; |
|
|
|
using namespace fmt; |
|
|
|
using namespace nlohmann; |
|
|
|
using namespace nlohmann; |
|
|
|
|
|
|
|
|
|
|
|
#define BUF_MAX 1024 |
|
|
|
#define BUF_MAX 1024 |
|
|
|
|
|
|
|
|
|
|
|
Builder::Builder(GUI &g, GameEngine &engine) : gui(g), game(engine) { |
|
|
|
Builder::Builder(GUI &g, GameEngine &engine) : gui(g), game(engine) { |
|
|
|
ifstream infile(".tarpit.json"); |
|
|
|
std::ifstream infile(".tarpit.json"); |
|
|
|
json config = json::parse(infile); |
|
|
|
json config = json::parse(infile); |
|
|
|
|
|
|
|
|
|
|
|
config["git_path"].template get_to<string>(git_path); |
|
|
|
config["git_path"].template get_to<string>(git_path); |
|
|
@ -37,14 +36,14 @@ Builder::Builder(GUI &g, GameEngine &engine) : gui(g), game(engine) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Task<unsigned> Builder::run_build() { |
|
|
|
Task<unsigned> Builder::run_build() { |
|
|
|
regex err_re("(.*?):([0-9]+):([0-9]+):\\s*(.*?):\\s*(.*)\n*"); |
|
|
|
std::regex err_re("(.*?):([0-9]+):([0-9]+):\\s*(.*?):\\s*(.*)\n*"); |
|
|
|
|
|
|
|
|
|
|
|
char buffer[BUF_MAX]; // BUF_MAX is a define already?
|
|
|
|
char buffer[BUF_MAX]; // BUF_MAX is a define already?
|
|
|
|
ofstream stats_out; |
|
|
|
std::ofstream stats_out; |
|
|
|
|
|
|
|
|
|
|
|
co_await Pass{}; |
|
|
|
co_await Pass{}; |
|
|
|
|
|
|
|
|
|
|
|
stats_out.open("stats.csv", ios::out | ios::app); |
|
|
|
stats_out.open("stats.csv", std::ios::out | std::ios::app); |
|
|
|
std::time_t tstamp = std::time(nullptr); |
|
|
|
std::time_t tstamp = std::time(nullptr); |
|
|
|
|
|
|
|
|
|
|
|
dbc::check(stats_out.good(), "Error opening stats.csv file."); |
|
|
|
dbc::check(stats_out.good(), "Error opening stats.csv file."); |
|
|
@ -64,10 +63,8 @@ Task<unsigned> Builder::run_build() { |
|
|
|
co_yield 3; |
|
|
|
co_yield 3; |
|
|
|
string line(buffer); // yeah, that's probably a problem
|
|
|
|
string line(buffer); // yeah, that's probably a problem
|
|
|
|
|
|
|
|
|
|
|
|
cerr << buffer; |
|
|
|
std::smatch err; |
|
|
|
|
|
|
|
bool match = std::regex_match(line, err, err_re); |
|
|
|
smatch err; |
|
|
|
|
|
|
|
bool match = regex_match(line, err, err_re); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(match) { |
|
|
|
if(match) { |
|
|
|
string file_name = err[1].str(); |
|
|
|
string file_name = err[1].str(); |
|
|
|