From f9ffe50a8b5f7403a10f79aa340e092435d8f906 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Wed, 17 Feb 2021 20:13:34 -0800 Subject: [PATCH] getdeps show-build-dir Summary: A show-build-dir subcommand. Possibly useful for building a project and then running only one test or benchmark binary directly. Reviewed By: wez Differential Revision: D26502869 fbshipit-source-id: 0d8f6c42a2bbeb2440503a39c7fc770e3b3e4fff --- build/fbcode_builder/getdeps.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 6ee7fa7ac..5dae195e3 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -401,6 +401,27 @@ class CleanCmd(SubCmd): clean_dirs(opts) +@cmd("show-build-dir", "print the build dir for a given project") +class ShowBuildDirCmd(ProjectCmdBase): + def run_project_cmd(self, args, loader, manifest): + if args.recursive: + manifests = loader.manifests_in_dependency_order() + else: + manifests = [manifest] + + for m in manifests: + inst_dir = loader.get_project_build_dir(m) + print(inst_dir) + + def setup_project_cmd_parser(self, parser): + parser.add_argument( + "--recursive", + help="print the transitive deps also", + action="store_true", + default=False, + ) + + @cmd("show-inst-dir", "print the installation dir for a given project") class ShowInstDirCmd(ProjectCmdBase): def run_project_cmd(self, args, loader, manifest):