skia2/infra/bots/recipe_modules/build/util.py
Ben Wagner 2b3808eda2 Add hello-opencl to BUILD_PRODUCTS_ISOLATE_WHITELIST
Split from https://skia-review.googlesource.com/c/skia/+/136594 for
easier review.

hello-opencl was added in
https://skia-review.googlesource.com/c/skia/+/136223

Bug: skia:8081
Change-Id: I6535be8b51e95f0f481d48648c5327dc92a02d3b
Reviewed-on: https://skia-review.googlesource.com/138266
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2018-06-28 20:34:27 +00:00

66 lines
1.4 KiB
Python

# 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."""
BUILD_PRODUCTS_ISOLATE_WHITELIST = [
'bookmaker',
'dm',
'dm.exe',
'dm.app',
'nanobench.app',
'get_images_from_skps',
'get_images_from_skps.exe',
'hello-opencl',
'hello-opencl.exe',
'nanobench',
'nanobench.exe',
'skpbench',
'skpbench.exe',
'*.so',
'*.dll',
'*.dylib',
'skia_launcher',
'skiaserve',
'lib/*.so',
'run_testlab',
'skqp-universal-debug.apk',
'whitelist_devices.json',
]
def copy_whitelisted_build_products(api, src, dst):
"""Copy whitelisted build products from src to dst."""
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]
build_products_whitelist = %s
try:
os.makedirs(dst)
except OSError as e:
if e.errno != errno.EEXIST:
raise
for pattern in build_products_whitelist:
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)
''' % str(BUILD_PRODUCTS_ISOLATE_WHITELIST),
args=[src, dst],
infra_step=True)