1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-08 18:02:05 +03:00

getdeps: allow overriding project source, build, and install directories

Summary:
Add arguments to getdeps.py to allow overriding the source, build, and install
directories a per-project basis.  The arguments take the form `[PROJECT:]PATH`
If the `PROJECT` portion is omitted, it defaults to the current project being
built.

In particular this makes it possible to specify `--src-dir .` to tell
getdeps.py to find the project sources from the current directory rather than
downloading them.

Reviewed By: wez

Differential Revision: D16778011

fbshipit-source-id: f33b87213ace04abb66334f588babdf59df91964
This commit is contained in:
Adam Simpkins
2019-08-15 17:53:32 -07:00
committed by Facebook Github Bot
parent fb5f217226
commit a412d9a8a0
3 changed files with 104 additions and 0 deletions

View File

@@ -130,6 +130,26 @@ class Fetcher(object):
pass
class LocalDirFetcher(object):
""" This class exists to override the normal fetching behavior, and
use an explicit user-specified directory for the project sources.
This fetcher cannot update or track changes. It always reports that the
project has changed, forcing it to always be built. """
def __init__(self, path):
self.path = os.path.realpath(path)
def update(self):
return ChangeStatus(all_changed=True)
def hash(self):
return "0" * 40
def get_src_dir(self):
return self.path
class GitFetcher(Fetcher):
DEFAULT_DEPTH = 100