some progress over building

This commit is contained in:
Blue 2023-09-30 17:13:44 -03:00
parent 0fa8ba6918
commit 4843fcc77f
Signed by: blue
GPG key ID: 9B203B252A63EE38
7 changed files with 228 additions and 27 deletions

View file

@ -38,7 +38,7 @@ public:
Component(
const std::filesystem::path& path,
const std::weak_ptr<Collection>& collection,
Collection* collection,
const std::shared_ptr<Logger>& logger
);
@ -47,6 +47,7 @@ public:
std::filesystem::path getLocation() const;
std::string getLibrariesPath() const;
bool successfullyRead() const;
bool successfullyBuilt() const;
void read();
void build(const std::filesystem::path& destination, const std::string& target);
@ -57,15 +58,24 @@ private:
bool errorScenario(const std::string& message);
void buildAsFile(const std::filesystem::path& destination);
void buildAsDiractory(const std::filesystem::path& destination);
void buildAsDirectory(const std::filesystem::path& destination);
void buildAsMason(const std::filesystem::path& destination, const std::string& target);
bool readMasonDependencies(const nlohmann::json& deps, const std::string& manifestPath);
void copyFile(const std::filesystem::path& from, const std::filesystem::path& to) const;
void masonFilesArray(const nlohmann::json& files, const std::filesystem::path& destination);
bool allowedForTarget(const nlohmann::json& object, const std::string& target) const;
std::optional<std::string> getFileSource(const nlohmann::json& object) const;
std::optional<std::string> getFileTarget(const nlohmann::json& object) const;
static std::optional<std::string> tryStringValue (const nlohmann::json& object, const std::string& key);
private:
State state;
Type type;
std::weak_ptr<Collection> collection;
Collection* collection;
std::filesystem::path location;
std::optional<nlohmann::json> manifest;
};