From 07ab59a93f9447d5489743e8d7e19b6adb5ebbf1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 9 Jul 2021 20:55:15 +0300 Subject: Add support for configuration type and bdep-config-link sub-command --- bdep/project.hxx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'bdep/project.hxx') diff --git a/bdep/project.hxx b/bdep/project.hxx index 86b833f..5c6be87 100644 --- a/bdep/project.hxx +++ b/bdep/project.hxx @@ -15,7 +15,11 @@ #include -#pragma db model version(1, 1, closed) +// Used by the data migration entries. +// +#define DB_SCHEMA_VERSION_BASE 1 + +#pragma db model version(DB_SCHEMA_VERSION_BASE, 2, closed) // Prevent assert() macro expansion in get/set expressions. This should appear // after all #include directives since the assert() macro is redefined in each @@ -85,6 +89,7 @@ namespace bdep // optional_uint64_t id; optional_string name; + string type; dir_path path; optional_dir_path relative_path; @@ -122,6 +127,7 @@ namespace bdep // configuration (optional_uint64_t i, optional_string n, + string t, dir_path p, optional_dir_path rp, bool d, @@ -130,6 +136,7 @@ namespace bdep vector ps) : id (i), name (move (n)), + type (move (t)), path (move (p)), relative_path (move (rp)), default_ (d), @@ -166,12 +173,15 @@ namespace bdep // Given the project directory, database, and options resolve all the // mentioned configurations or, unless fallback_default is false, find the - // default configuration if none were mentioned. Unless validate is false, + // default configurations if none were mentioned. Unless validate is false, // also validate that the configuration directories still exist. // + // Besides configurations, also return an indication if they are retrieved + // as a fallback to default configurations (true if that's the case). + // using configurations = vector>; - configurations + pair find_configurations (const project_options&, const dir_path& prj, transaction&, @@ -255,10 +265,14 @@ namespace bdep return find_project_packages (o, true /* ignore_packages */).project; } - // Verify all the packages are present in all the configurations. + // Verify that each package is present in at least one configuration. + // + // Note that the default configurations fallback indication (see above) is + // only used for diagnostics. // void - verify_project_packages (const project_packages&, const configurations&); + verify_project_packages (const project_packages&, + const pair&); // Determine the version of a package in the specified package (first // version) or configuration (second version) directory. -- cgit v1.1