This commit is contained in:
parent
94db4f2780
commit
0819baf6d3
8 changed files with 170 additions and 117 deletions
|
|
@ -33,28 +33,21 @@ namespace Crafter {
|
|||
Define(std::string&& name, std::string&& value): name(std::move(name)), value(std::move(value)) { }
|
||||
};
|
||||
|
||||
export class Dependency {
|
||||
public:
|
||||
std::string path;
|
||||
std::string configuration;
|
||||
std::string commit;
|
||||
std::string branch;
|
||||
Dependency(std::string&& path, std::string&& configuration, std::string&& commit, std::string&& branch): path(std::move(path)), configuration(std::move(configuration)), commit(std::move(commit)), branch(std::move(branch)) { }
|
||||
};;
|
||||
|
||||
export enum ConfigurationType {
|
||||
CRAFTER_CONFIGURATION_TYPE_EXECUTABLE,
|
||||
CRAFTER_CONFIGURATION_TYPE_LIBRARY,
|
||||
CRAFTER_CONFIGURATION_TYPE_SHARED_LIBRARY,
|
||||
};
|
||||
|
||||
export class Project;
|
||||
export class Configuration {
|
||||
public:
|
||||
std::string name;
|
||||
std::string standard;
|
||||
std::vector<std::unique_ptr<Module>> interfaces;
|
||||
std::vector<Implementation> implementations;
|
||||
std::vector<Dependency> dependencies;
|
||||
std::vector<fs::path> c_files;
|
||||
std::vector<std::tuple<std::shared_ptr<Project>, Configuration&>> dependencies;
|
||||
std::vector<Shader> shaders;
|
||||
std::vector<fs::path> additionalFiles;
|
||||
std::vector<Define> defines;
|
||||
|
|
@ -64,7 +57,7 @@ namespace Crafter {
|
|||
bool debug;
|
||||
std::vector<std::string> libs;
|
||||
Configuration(std::string&& name);
|
||||
Configuration(const nlohmann::json& configs, const nlohmann::json& config, fs::path workingDir);
|
||||
void SetDataFromJson(const nlohmann::json& configs, const nlohmann::json& config, fs::path workingDir);
|
||||
Configuration(const nlohmann::json& configs, const nlohmann::json& config, fs::path workingDir, const Project& project);
|
||||
void SetDataFromJson(const nlohmann::json& configs, const nlohmann::json& config, fs::path workingDir, const Project& project);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@ namespace Crafter {
|
|||
fs::path path;
|
||||
std::vector<Configuration> configurations;
|
||||
std::vector<Test> tests;
|
||||
Project(fs::path&& path);
|
||||
Project(fs::path&& path, const std::string_view config);
|
||||
Project(std::string&& name, fs::path&& path, std::vector<Configuration>&& configurations);
|
||||
Project(std::string&& name, fs::path&& path, std::vector<Configuration>&& configurations, fs::path&& buildDir, fs::path&& binDir);
|
||||
static Project LoadFromJSON(const fs::path& path);
|
||||
std::tuple<Configuration&, BuildResult> Build(std::string_view configuration);
|
||||
std::tuple<Configuration&, BuildResult> Build(std::string_view configuration, const fs::path& binDir, const fs::path& outputDir, const fs::path& buildDir, std::string outputName);
|
||||
BuildResult Build(Configuration& configuration) const;
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@ namespace Crafter {
|
|||
std::string message;
|
||||
};
|
||||
|
||||
export class Project;
|
||||
export class Test {
|
||||
public:
|
||||
Configuration config;
|
||||
Test(Configuration&& name);
|
||||
Test(const nlohmann::json& configs, const nlohmann::json& config, const fs::path& workingDir);
|
||||
Test(const nlohmann::json& configs, const nlohmann::json& config, const fs::path& workingDir, const Project& project);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue