-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
343 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <Frate/Command.hpp> | ||
|
||
namespace Frate { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <string> | ||
#include <vector> | ||
namespace Frate::Command::Toolchain { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <Frate/Command.hpp> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <Frate/Command.hpp> | ||
|
||
namespace Frate::Command::Packages { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <Frate/Command.hpp> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include "../Command.hpp" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <string> | ||
#include <vector> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <memory> | ||
#include <vector> | ||
#include "./Command.hpp" | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
#include <Frate/Package.hpp> | ||
namespace Frate::Command { | ||
class Mode{ | ||
public: | ||
std::string name; | ||
std::vector<std::string> flags; | ||
std::vector<Package> dependencies{}; | ||
friend void from_json(const json &j, Mode& mode); | ||
friend void to_json(json &j, const Mode& mode); | ||
Mode( | ||
std::string name = "", | ||
std::vector<std::string> flags = {}, | ||
std::vector<Package> dependencies = {} | ||
); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
#include <string> | ||
#include <vector> | ||
#include <nlohmann/json.hpp> | ||
#include <sol/sol.hpp> | ||
|
||
namespace Frate::Command{ | ||
using nlohmann::json; | ||
class Package { | ||
public: | ||
std::string name; | ||
std::string git; | ||
std::string git_short; | ||
std::string git_prefixed; | ||
std::vector<std::string> versions; | ||
std::string target_link; | ||
std::string description; | ||
std::string selected_version; | ||
std::string git_description; | ||
std::string language; | ||
std::string license; | ||
std::string owner; | ||
std::string owner_type; | ||
int stars; | ||
int forks; | ||
int open_issues; | ||
int watchers; | ||
int score; | ||
bool addCallback(sol::state &lua); | ||
friend void from_json(const json &j, Package& package); | ||
friend void to_json(json &j, const Package& package); | ||
Package(){}; | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#pragma once | ||
#include <Frate/RemoteServer.hpp> | ||
#include <Frate/Mode.hpp> | ||
#include <string> | ||
#include <filesystem> | ||
#include <vector> | ||
#include <unordered_map> | ||
#include <nlohmann/json.hpp> | ||
#include <Frate/Package.hpp> | ||
#include <Frate/Template.hpp> | ||
#include <Frate/ProjectPrompt.hpp> | ||
|
||
|
||
|
||
namespace Frate::Command { | ||
// class Template; | ||
// class RemoteServer; | ||
// class Mode; | ||
// class ProjectPrompt; | ||
using nlohmann::json; | ||
class Project { | ||
public: | ||
Project(); | ||
std::string name; | ||
std::string description; | ||
std::string type{""}; | ||
RemoteServer build_server; | ||
std::filesystem::path path; | ||
std::string git{"null"}; | ||
std::string homepage{"null"}; | ||
std::string bugs{"null"}; | ||
std::string lang{"cpp"}; | ||
std::string cmake_version{"3.28"}; | ||
std::string lang_version{"20"}; | ||
std::string compiler{"g++"}; | ||
std::string license{""}; | ||
std::string default_mode{"Release"}; | ||
std::string build_command{"cmake --build ."}; | ||
std::vector<Mode> modes{ | ||
Mode("Release",{"-O2"}), | ||
Mode("Debug",{"-g"}), | ||
Mode("Test",{"-g"}) | ||
}; | ||
std::vector<std::string> authors{}; | ||
std::vector<std::string> keywords{}; | ||
std::string src_dir{"src"}; | ||
std::string include_dir{"include"}; | ||
std::vector<RemoteServer> build_servers{}; | ||
std::vector<Package> dependencies{}; | ||
std::string build_dir{"build"}; | ||
Package testing_lib; | ||
std::string version{"0.0.1"}; | ||
std::vector<std::string> flags{}; | ||
std::vector<std::string> toolchains {}; | ||
std::vector<std::string> libs{}; | ||
bool load(); | ||
bool save(); | ||
void checkKeys(json j); | ||
std::string getPath(){ | ||
return path.string(); | ||
}; | ||
std::unordered_map<std::string,ProjectPrompt> prompts{}; | ||
std::unordered_map<std::string,json> variables{}; | ||
friend void from_json(const json &j, Project& pro); | ||
friend void to_json(json &j, const Project& pro); | ||
void fromTemplate(Template &t); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#pragma once | ||
#include <string> | ||
#include <vector> | ||
#include <nlohmann/json.hpp> | ||
|
||
|
||
namespace Frate::Command { | ||
using nlohmann::json; | ||
class ProjectPrompt{ | ||
public: | ||
ProjectPrompt(){}; | ||
std::string value{""}; | ||
std::string text{""}; | ||
std::string type{"string"}; | ||
std::string default_value{""}; | ||
bool required{false}; | ||
std::vector<std::string> options{}; | ||
friend void from_json(const json &j, ProjectPrompt& prompt); | ||
friend void to_json(json &j, const ProjectPrompt& prompt); | ||
std::function<bool(std::string)> validator{ | ||
[this](std::string s) -> bool { | ||
if(options.size() == 0) { | ||
return true; | ||
}else{ | ||
for (std::string option: options){ | ||
if (s == option){ | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} | ||
}; | ||
template<typename T> | ||
T get(); | ||
}; | ||
} |
Oops, something went wrong.