From 055e65a0f93ab873c8998cea900229f04beb0d98 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 9 Aug 2021 14:17:06 +0200 Subject: Generate smarter glue buildfile that reads packages.manifest --- bdep/new.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bdep/new.cxx') diff --git a/bdep/new.cxx b/bdep/new.cxx index 359d266..915e042 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -3081,6 +3081,14 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) // Only create the glue buildfile if we've also created packages.manifest. // + // Note that the first version of our glue buildfile pulled all the + // subdirectories with a wildcard (*/). This proved to have several + // drawbacks: adding a non-package subdirectory (e.g., upstream/) is + // error-prone since we need to remember to manually exclude it. Also, + // some users seem to prefer to create configurations as subdirectories of + // the project root. Forgetting to exclude them leads to all kinds of + // bizarre errors (see GitHub issue #159 for one example). + // if (!e) { path f (prj / buildfile_file); @@ -3092,7 +3100,8 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) fdopen_mode::exclusive)); os << "# Glue buildfile that \"pulls\" all the packages in the project." << '\n' << "#" << '\n' - << "import pkgs = */" << '\n' + << "import pkgs = [dir_paths] $process.run_regex(\\" << '\n' + << " cat $src_root/packages.manifest, '\\s*location\\s*:\\s*(\\S+)\\s*', '\\1')" << '\n' << '\n' << "./: $pkgs" << '\n'; os.close (); -- cgit v1.1