7""" Gather all the fuchsia artifacts to a destination directory.
19_ARTIFACT_PATH_TO_DST = {
20 'flutter_jit_runner':
'flutter_jit_runner',
'icudtl.dat':
'data/icudtl.dat',
21 'dart_runner':
'dart_runner',
'flutter_patched_sdk':
'flutter_patched_sdk'
26 dir_name, _ = os.path.split(path)
27 if not os.path.exists(dir_name):
34 shutil.copytree(src, dst)
35 except OSError
as exc:
36 if exc.errno == errno.ENOTDIR:
43 meta = os.path.join(dst_root,
'meta')
44 if not os.path.isdir(meta):
47 content[
'name'] = far_name
48 content[
'version'] =
'0'
49 package = os.path.join(meta,
'package')
50 with open(package,
'w')
as out_file:
51 json.dump(content, out_file)
55 if not os.path.exists(dst_root):
58 shutil.rmtree(dst_root)
60 for src_rel, dst_rel
in _ARTIFACT_PATH_TO_DST.items():
61 src_full = os.path.join(src_root, src_rel)
62 dst_full = os.path.join(dst_root, dst_rel)
63 if not os.path.exists(src_full):
64 print(
'Unable to find artifact: ', str(src_full))
68 if create_meta_package:
73 parser = argparse.ArgumentParser()
75 parser.add_argument(
'--artifacts-root', dest=
'artifacts_root', action=
'store', required=
True)
76 parser.add_argument(
'--dest-dir', dest=
'dst_dir', action=
'store', required=
True)
78 args = parser.parse_args()
80 assert os.path.exists(args.artifacts_root)
81 dst_parent = os.path.abspath(os.path.join(args.dst_dir, os.pardir))
82 assert os.path.exists(dst_parent)
88if __name__ ==
'__main__':
def CreateMetaPackage(dst_root, far_name)
def GatherArtifacts(src_root, dst_root, create_meta_package=True)
def EnsureParentExists(path)
def print(*args, **kwargs)