aboutsummaryrefslogtreecommitdiff
path: root/bdep/project.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-07-17 14:49:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-07-17 14:49:04 +0200
commit1580b9fe0ab2b242227cdd7601766bdfce5493e2 (patch)
treee06a0c32d76865fb232a82cf390f8728ddfe8b1a /bdep/project.hxx
parentc70cc15b6ebe49150661e025855dc22ceb235905 (diff)
Diagnose improper project/package arrangements in new command
Diffstat (limited to 'bdep/project.hxx')
-rw-r--r--bdep/project.hxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/bdep/project.hxx b/bdep/project.hxx
index 9e1ae8e..76d9522 100644
--- a/bdep/project.hxx
+++ b/bdep/project.hxx
@@ -156,6 +156,24 @@ namespace bdep
bool fallback_default = true,
bool validate = true);
+ // Given a directory which can be a project root, a package root, or one of
+ // their subdirectories, return the absolute project (first) and relative
+ // package (second) directories. The package directory may be absent if the
+ // given directory is not within a package root or empty if the project and
+ // package roots are the same.
+ //
+ // If ignore_not_found is true then insteading of issuing diagnostics and
+ // failing return empty project directory if no project is found.
+ //
+ struct project_package
+ {
+ dir_path project;
+ optional<dir_path> package;
+ };
+
+ project_package
+ find_project_package (const dir_path&, bool ignore_not_found = false);
+
// Given the project options (and CWD) locate the packages and their
// project. The result is an absolute and normalized project directory and a
// vector of relative (to the project directory) package locations.