got rid of --local
This commit is contained in:
parent
909a9b46d2
commit
162d98cf5b
1 changed files with 12 additions and 28 deletions
40
project.cpp
40
project.cpp
|
|
@ -6,34 +6,18 @@ using namespace Crafter;
|
|||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
||||
std::vector<std::string> depArgs(args.begin(), args.end());
|
||||
|
||||
// --local resolves Crafter.* deps from sibling working trees instead of
|
||||
// fetching them from forgejo. Use during cross-repo development so edits
|
||||
// in ../Crafter.Asset are picked up without commit-and-pull. Add to
|
||||
// depArgs too so transitive deps inherit the same mode.
|
||||
bool useLocal = false;
|
||||
for (std::string_view a : args) {
|
||||
if (a == "--local") { useLocal = true; break; }
|
||||
}
|
||||
if (useLocal && std::find(depArgs.begin(), depArgs.end(), std::string("--local")) == depArgs.end()) {
|
||||
depArgs.push_back("--local");
|
||||
}
|
||||
|
||||
auto resolveDep = [&](std::string_view name, std::string_view gitUrl) -> Configuration* {
|
||||
if (useLocal) {
|
||||
return LocalProject({
|
||||
.projectFile = fs::path("../") / name / "project.cpp",
|
||||
.args = depArgs,
|
||||
});
|
||||
}
|
||||
return GitProject({
|
||||
.source = { .url = std::string(gitUrl) },
|
||||
.args = depArgs,
|
||||
});
|
||||
};
|
||||
|
||||
Configuration* event = resolveDep("Crafter.Event", "https://forgejo.catcrafts.net/Catcrafts/Crafter.Event.git");
|
||||
Configuration* math = resolveDep("Crafter.Math", "https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git");
|
||||
Configuration* asset = resolveDep("Crafter.Asset", "https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git");
|
||||
Configuration* event = GitProject({
|
||||
.source = { .url = "https://forgejo.catcrafts.net/Catcrafts/Crafter.Event.git" },
|
||||
.args = depArgs,
|
||||
});
|
||||
Configuration* math = GitProject({
|
||||
.source = { "https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git" },
|
||||
.args = depArgs,
|
||||
});
|
||||
Configuration* asset = GitProject({
|
||||
.source = { "https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git" },
|
||||
.args = depArgs,
|
||||
});
|
||||
|
||||
Configuration cfg;
|
||||
cfg.path = "./";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue