Crafter.Build/Crafter.Build-Project.cppm

43 lines
1.5 KiB
Text
Raw Normal View History

2024-12-29 01:04:33 +01:00
/*
Crafter.Build
2024-12-30 17:21:04 +01:00
Copyright (C) 2024 Catcrafts
2024-12-31 20:32:00 +01:00
Catcrafts.net
2024-12-29 01:04:33 +01:00
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
2024-12-31 20:32:00 +01:00
version 3.0 of the License, or (at your option) any later version.
2024-12-29 01:04:33 +01:00
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
2024-12-31 20:32:00 +01:00
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2024-12-29 01:04:33 +01:00
*/
2024-12-28 21:00:12 +01:00
module;
#include <vector>
#include <string>
2024-12-29 17:53:46 +01:00
#include <filesystem>
2024-12-28 21:00:12 +01:00
export module Crafter.Build:Project;
import :Configuration;
2024-12-29 17:53:46 +01:00
namespace fs = std::filesystem;
2024-12-28 21:00:12 +01:00
export namespace Crafter::Build {
class Project {
public:
std::string name;
2024-12-29 17:53:46 +01:00
fs::path path;
2024-12-28 21:00:12 +01:00
std::vector<Configuration> configurations;
2024-12-29 17:53:46 +01:00
Project(std::string name, fs::path path, std::vector<Configuration> configurations);
2024-12-29 20:14:49 +01:00
void Build(std::string configuration) const;
void Build(std::string configuration, fs::path outputDir) const;
void Build(Configuration configuration) const;
void Build(Configuration configuration, fs::path outputDir) const;
void SaveToJSON(fs::path path) const;
2024-12-29 17:53:46 +01:00
static Project LoadFromJSON(fs::path path);
2024-12-28 21:00:12 +01:00
};
}