mason/src/main.cpp

45 lines
1.0 KiB
C++
Raw Normal View History

2023-08-30 20:54:59 +00:00
#include <string>
2023-09-27 23:30:57 +00:00
#include "collection.h"
#include "taskmanager.h"
#include "loggger.h"
2023-08-27 17:55:04 +00:00
int main(int argc, char *argv[]) {
2023-08-30 20:54:59 +00:00
std::string firstArg;
2023-09-01 21:39:24 +00:00
std::string secondArg;
2023-08-30 20:54:59 +00:00
if (argc > 1)
firstArg = argv[1];
else
firstArg = "./";
2023-09-01 21:39:24 +00:00
if (argc > 2)
secondArg = argv[2];
else
secondArg = "./";
2023-08-30 20:54:59 +00:00
2023-09-27 23:30:57 +00:00
std::shared_ptr<Logger> logger = std::make_shared<Logger>(Logger::Severity::debug);
std::shared_ptr<TaskManager> taskManager = std::make_shared<TaskManager>(logger);
2023-09-27 23:30:57 +00:00
std::shared_ptr<Collection> collection = std::make_shared<Collection>(secondArg, "", logger, taskManager);
2023-08-30 20:54:59 +00:00
2023-09-27 23:30:57 +00:00
taskManager->start();
collection->addSource(firstArg);
2023-08-30 20:54:59 +00:00
2023-09-27 23:30:57 +00:00
taskManager->wait();
taskManager->stop();
2023-09-01 21:39:24 +00:00
2023-09-27 23:30:57 +00:00
// 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();
2023-08-30 20:54:59 +00:00
2023-09-27 23:30:57 +00:00
return 0;
2023-08-27 17:55:04 +00:00
}