Flutter Engine
The Flutter Engine
copy_build_products_no_delete.py
Go to the documentation of this file.
1# Copyright 2024 Google LLC
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import errno
7import glob
8import os
9import shutil
10import sys
11
12src = sys.argv[1]
13dst = sys.argv[2]
14build_products = sys.argv[3].split(',')
15
16try:
17 os.makedirs(dst)
18except OSError as e:
19 if e.errno != errno.EEXIST:
20 raise
21
22for pattern in build_products:
23 path = os.path.join(src, pattern)
24 for f in glob.glob(path):
25 dst_path = os.path.join(dst, os.path.relpath(f, src))
26 if not os.path.isdir(os.path.dirname(dst_path)):
27 os.makedirs(os.path.dirname(dst_path))
28 print('Copying build product %s to %s' % (f, dst_path))
29 # Because Docker usually has some strange permissions (like root
30 # ownership), we'd rather not keep those around. copyfile doesn't
31 # keep the metadata around, so that helps us.
32 shutil.copyfile(f, dst_path)
def print(*args, **kwargs)
Definition: run_tests.py:49