-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-dependencies.py
executable file
·55 lines (43 loc) · 1.43 KB
/
get-dependencies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
import argparse
import os
import sys
import shutil
import subprocess
import build_tools
def download_deps(source, artifact_dir, install_dir):
"""
Get the dependencies from the source's metadata and download them.
Mirrors what jenkins_boostrapper does.
"""
deps = build_tools.artifactory_utils.get_dependencies(
source.platform,
dependencies_dir=source.dir,
dependency_overrides={})
build_tools.artifactory_utils.download_and_extract_artifacts(
deps,
install_dir,
artifact_dir)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Downloads artifacts required for building.")
parser.add_argument(
'--artifact-dir',
dest='artifact_dir',
help="Directory in which to place the artifacts.",
default="./_artifacts")
parser.add_argument(
'--install-dir',
dest='install_dir',
help="Directory to install the artifacts.",
default="./Install")
args = parser.parse_args(sys.argv[1:])
class MockParsedArgs:
def __init__(self):
self.this_dir = True
self.platform = None
self.version = None
self.build_settings = None
for source in build_tools.get_toolchain(MockParsedArgs()):
if isinstance(source, build_tools.source.Repo):
download_deps(source, args.artifact_dir, args.install_dir)