Merge branch 'claude/forward-project-args': sibling projects inherit the args, lint with the lite rules
PR #40. GitProject and LocalProject default their args to the loading project's own (ProjectArgs()), this tree lints with LintRules' lite set, and the fixes from the branch's review: a project file gets its args only for the CrafterBuildProject call, host tooling gets project cache entries of its own, and `--` ends crafter-build's options. The conflicts with claude/dependency-notes are all places both sides added to: - Platform.cppm and Platform.cpp: PragmaDependencies() beside ProjectArgs() and LoadingHostTooling(), all three kept. - LoadProject: the record PragmaDependencies() reads moves up with the frame's dependencies, which this branch sets before dlopen. Left where it was, it would have copied preDeps.configs after the vector was moved into the frame, and recorded nothing. - README: the pragma section's new last sentence goes before the new "Dependency notes for agents" section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
75142276ab
23 changed files with 599 additions and 62 deletions
27
project.cpp
27
project.cpp
|
|
@ -137,15 +137,8 @@ Remove it (do this before `crafter-build clean`, which deletes the repo the remo
|
|||
}
|
||||
|
||||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
||||
std::vector<std::string> depArgs(args.begin(), args.end());
|
||||
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* math = GitProject({ .source = { "https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git" } });
|
||||
Configuration* asset = GitProject({ .source = { "https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git" } });
|
||||
|
||||
static auto CrafterBuildLib = std::make_unique<Configuration>();
|
||||
CrafterBuildLib->path = "./";
|
||||
|
|
@ -289,6 +282,10 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
|
|||
.LinkFlag("-Wl,--export-dynamic").LinkFlag("-ldl");
|
||||
cfg.AddTest("ProjectDependency").Dependencies({ CrafterBuildLib.get() })
|
||||
.LinkFlag("-Wl,--export-dynamic").LinkFlag("-ldl");
|
||||
cfg.AddTest("ProjectArgs").Dependencies({ CrafterBuildLib.get() })
|
||||
.LinkFlag("-Wl,--export-dynamic").LinkFlag("-ldl");
|
||||
cfg.AddTest("HostToolingSibling").Dependencies({ CrafterBuildLib.get() })
|
||||
.LinkFlag("-Wl,--export-dynamic").LinkFlag("-ldl");
|
||||
cfg.AddTest("Script").Dependencies({ CrafterBuildLib.get() })
|
||||
.LinkFlag("-Wl,--export-dynamic").LinkFlag("-ldl");
|
||||
cfg.AddTest("DependencyNotes").Dependencies({ CrafterBuildLib.get() })
|
||||
|
|
@ -297,10 +294,14 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
|
|||
cfg.AddTest("Lint").Dependencies({ CrafterBuildLib.get() });
|
||||
}
|
||||
|
||||
// Dogfood: the house-style rules, imported from their own repo through
|
||||
// the pragma above. Report rules gate `crafter-build lint`; transform
|
||||
// rules also auto-fix under `crafter-build format`.
|
||||
LintRules::AddRules(cfg);
|
||||
// Dogfood: the lite house rules, imported from their own repo through
|
||||
// the pragma above. Lite is the house rules without the ones that only
|
||||
// decide layout, whitespace and naming, which this tree keeps by hand:
|
||||
// the full set's naming rule, for one, wants camelCase where this tree
|
||||
// spells its statics and constants PascalCase. Report rules gate
|
||||
// `crafter-build lint`; the two transforms also auto-fix under
|
||||
// `crafter-build format`.
|
||||
LintRules::AddLiteRules(cfg);
|
||||
|
||||
// See the top of this file.
|
||||
cfg.scripts.push_back({"flatpak", BuildFlatpak});
|
||||
|
|
|
|||
Loading…
Reference in a new issue