keep on refactoring

This commit is contained in:
Blue 2023-09-27 20:30:57 -03:00
parent d30e6ed759
commit b07d017f86
Signed by: blue
GPG key ID: 9B203B252A63EE38
6 changed files with 45 additions and 21 deletions

View file

@ -31,7 +31,7 @@ private:
void printMessage(const Message& message, bool colored = false) const;
private:
bool accumulate;
const bool accumulate;
const Severity currentSeverity;
mutable std::list<Message> history;
mutable std::mutex readMutex;

View file

@ -1,6 +1,8 @@
#include <string>
#include "project.h"
#include "collection.h"
#include "taskmanager.h"
#include "loggger.h"
int main(int argc, char *argv[]) {
std::string firstArg;
@ -15,20 +17,28 @@ int main(int argc, char *argv[]) {
else
secondArg = "./";
Project root(firstArg, secondArg);
bool success = root.read();
int result = -1;
if (success) {
root.info("successfully parsed project " + root.getName());
root.info("dependencies count is " + std::to_string(root.dependenciesCount()));
std::shared_ptr<Logger> logger = std::make_shared<Logger>(Logger::Severity::debug);
std::shared_ptr<TaskManager> taskManager = std::make_shared<TaskManager>();
std::shared_ptr<Collection> collection = std::make_shared<Collection>(secondArg, "", logger, taskManager);
root.discover();
result = 0;
}
taskManager->start();
collection->addSource(firstArg);
root.printLog();
taskManager->wait();
taskManager->stop();
// int result = -1;
// if (success) {
// root.info("successfully parsed project " + root.getName());
// root.info("dependencies count is " + std::to_string(root.dependenciesCount()));
//
// root.discover();
// result = 0;
// }
//
// root.printLog();
return result;
return 0;
}