1# Copyright {year}, The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# WARNING: This BUILD file was generated by a tool. 16# It should not be manually modified. 17 18# SOONG_TARGET:hello_world_test 19 20package(default_visibility=["//visibility:public"]) 21 22load("//build/bazel/rules:cc_test.bzl", "cc_test") 23 24_LIB_SRCS = glob([ 25 "{prebuilts_dir_name}/host/lib/**/*", 26 "{prebuilts_dir_name}/host/lib64/**/*" 27]) 28_TESTCASE_HOST_SRCS = glob( 29 ["{prebuilts_dir_name}/host/testcases/hello_world_test/**/*"]) 30_TESTCASE_DEVICE_SRCS = glob(["{prebuilts_dir_name}/target_testcases/hello_world_test/**/*"]) 31 32_LIB_OUTS = [f.replace("{prebuilts_dir_name}/host/", "") for f in _LIB_SRCS] 33_TESTCASE_HOST_OUTS = [ 34 f.replace("{prebuilts_dir_name}/host/testcases/hello_world_test/", "host/") 35 for f in _TESTCASE_HOST_SRCS 36] 37_TESTCASE_DEVICE_OUTS = [ 38 f.replace("{prebuilts_dir_name}/target_testcases/hello_world_test/", "device/") 39 for f in _TESTCASE_DEVICE_SRCS 40] 41 42 43genrule(name="hello_world_test_prebuilt", 44 srcs=_LIB_SRCS + _TESTCASE_HOST_SRCS + _TESTCASE_DEVICE_SRCS, 45 outs=_LIB_OUTS + _TESTCASE_HOST_OUTS + _TESTCASE_DEVICE_OUTS, 46 cmd=""" 47 src_files=($(SRCS)) 48 out_files=($(OUTS)) 49 for i in "$${{!src_files[@]}}" 50 do 51 src_file=$${{src_files[$$i]}} 52 out_file=$${{out_files[$$i]}} 53 mkdir -p $$(dirname $$src_file) 54 cp $$src_file $$out_file 55 done 56 """) 57 58cc_test(name="hello_world_test", deps=[":hello_world_test_prebuilt"]) 59