Crafter.Build/Crafter.Build-Project.cppm

47 lines
1.9 KiB
Text
Raw Normal View History

2024-12-29 01:04:33 +01:00
/*
Crafter.Build
2025-04-29 00:15:14 +02:00
Copyright (C) 2025 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
2025-04-29 00:15:14 +02:00
This library is distributed in the hope that it will be useful,
2024-12-29 01:04:33 +01:00
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>
2025-09-09 23:04:05 +02:00
#include <tuple>
2024-12-28 21:00:12 +01:00
export module Crafter.Build:Project;
import :Configuration;
2025-09-09 23:04:05 +02:00
import :Bounce;
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);
2025-09-09 23:04:05 +02:00
std::tuple<Configuration&, std::vector<ClangError>> Build(std::string configuration);
std::tuple<Configuration&, std::vector<ClangError>> Build(std::string configuration, fs::path outputDir);
std::tuple<Configuration&, std::vector<ClangError>> Build(std::string configuration, fs::path outputDir, fs::path binDir);
std::vector<ClangError> Build(Configuration& configuration);
std::vector<ClangError> Build(Configuration& configuration, fs::path outputDir);
std::vector<ClangError> Build(Configuration& configuration, fs::path outputDir, fs::path binDir);
2025-05-15 15:25:06 +02:00
void SaveToJSON(fs::path path);
2024-12-29 17:53:46 +01:00
static Project LoadFromJSON(fs::path path);
2024-12-28 21:00:12 +01:00
};
}