2018-05-14 16:50:38 +00:00
|
|
|
# Copyright 2018 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
|
|
"""Shared utilities for the build recipe module."""
|
|
|
|
|
|
|
|
|
2019-10-04 14:13:42 +00:00
|
|
|
# This lists the products we want to isolate as outputs for future steps.
|
|
|
|
DEFAULT_BUILD_PRODUCTS = [
|
2018-05-14 16:50:38 +00:00
|
|
|
'dm',
|
|
|
|
'dm.exe',
|
|
|
|
'dm.app',
|
|
|
|
'nanobench.app',
|
|
|
|
'get_images_from_skps',
|
|
|
|
'get_images_from_skps.exe',
|
2018-06-28 18:48:18 +00:00
|
|
|
'hello-opencl',
|
|
|
|
'hello-opencl.exe',
|
2018-05-14 16:50:38 +00:00
|
|
|
'nanobench',
|
|
|
|
'nanobench.exe',
|
|
|
|
'skpbench',
|
2018-05-23 12:43:04 +00:00
|
|
|
'skpbench.exe',
|
2018-05-14 16:50:38 +00:00
|
|
|
'*.so',
|
|
|
|
'*.dll',
|
|
|
|
'*.dylib',
|
|
|
|
'skia_launcher',
|
2019-02-12 13:28:12 +00:00
|
|
|
'skottie_tool',
|
2018-05-14 16:50:38 +00:00
|
|
|
'lib/*.so',
|
|
|
|
'run_testlab',
|
|
|
|
'skqp-universal-debug.apk',
|
|
|
|
'whitelist_devices.json',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2019-10-04 14:13:42 +00:00
|
|
|
def copy_listed_files(api, src, dst, product_list):
|
|
|
|
"""Copy listed files src to dst."""
|
2018-05-14 16:50:38 +00:00
|
|
|
api.python.inline(
|
|
|
|
name='copy build products',
|
|
|
|
program='''import errno
|
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
|
|
|
|
src = sys.argv[1]
|
|
|
|
dst = sys.argv[2]
|
2019-10-04 14:13:42 +00:00
|
|
|
build_products = %s
|
2018-05-14 16:50:38 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
os.makedirs(dst)
|
|
|
|
except OSError as e:
|
|
|
|
if e.errno != errno.EEXIST:
|
|
|
|
raise
|
|
|
|
|
2019-10-04 14:13:42 +00:00
|
|
|
for pattern in build_products:
|
2018-05-14 16:50:38 +00:00
|
|
|
path = os.path.join(src, pattern)
|
|
|
|
for f in glob.glob(path):
|
|
|
|
dst_path = os.path.join(dst, os.path.relpath(f, src))
|
|
|
|
if not os.path.isdir(os.path.dirname(dst_path)):
|
|
|
|
os.makedirs(os.path.dirname(dst_path))
|
|
|
|
print 'Copying build product %%s to %%s' %% (f, dst_path)
|
|
|
|
shutil.move(f, dst_path)
|
2019-10-04 14:13:42 +00:00
|
|
|
''' % str(product_list),
|
2018-05-14 16:50:38 +00:00
|
|
|
args=[src, dst],
|
|
|
|
infra_step=True)
|