1 2# Copyright 2021 Google LLC 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# Top-level test configuration. 17# Converted from the following makefile 18### PRODUCT_PACKAGES += dev 19### PRODUCT_HOST_PACKAGES += host 20### $(call inherit-product, $(LOCAL_PATH)/part1.mk) 21### PRODUCT_COPY_FILES += device_from:device_to 22### include $(LOCAL_PATH)/include1.mk 23### PRODUCT_PACKAGES += dev_after 24### PRODUCT_COPY_FILES += $(call find-copy-subdir-files,audio_platform_info*.xml,device/google/redfin/audio,$(TARGET_COPY_OUT_VENDOR)/etc) xyz:/etc/xyz 25### PRODUCT_COPY_FILES += $(call copy-files,x.xml y.xml,/etc) 26### $(call add_soong_config_namespace,NS1) 27### $(call soong_config_append,NS1,v1,abc) 28### $(call soong_config_append,NS1,v2,def) 29### $(call add_soong_config_var_value,NS2,v3,abc) 30### $(call soong_config_set,NS2,v3,xyz) 31 32load("//build/make/core:product_config.rbc", "rblf") 33load(":part1.rbc", _part1_init = "init") 34load(":include1.rbc", _include1_init = "init") 35 36def init(g, handle): 37 cfg = rblf.cfg(handle) 38 rblf.setdefault(handle, "PRODUCT_PACKAGES") 39 cfg["PRODUCT_PACKAGES"] += ["dev"] 40 rblf.setdefault(handle, "PRODUCT_HOST_PACKAGES") 41 cfg["PRODUCT_HOST_PACKAGES"] += ["host"] 42 rblf.inherit(handle, "test/part1", _part1_init) 43 rblf.setdefault(handle, "PRODUCT_COPY_FILES") 44 cfg["PRODUCT_COPY_FILES"] += ["device_from:device_to"] 45 _include1_init(g, handle) 46 cfg["PRODUCT_PACKAGES"] += ["dev_after"] 47 cfg["PRODUCT_COPY_FILES"] += (rblf.find_and_copy("audio_platform_info*.xml", "device/google/redfin", "||VENDOR-PATH-PH||/etc") + 48 ["xyz:/etc/xyz"]) 49 cfg["PRODUCT_COPY_FILES"] += rblf.copy_files("x.xml y.xml", "/etc") 50 cfg["PRODUCT_COPY_FILES"] += rblf.copy_files(["from/sub/x", "from/sub/y"], "to") 51 52 rblf.soong_config_namespace(g, "NS1") 53 rblf.soong_config_append(g, "NS1", "v1", "abc") 54 rblf.soong_config_append(g, "NS1", "v2", "def") 55 rblf.soong_config_set(g, "NS2", "v3", "abc") 56 rblf.soong_config_set(g, "NS2", "v3", "xyz") 57 rblf.soong_config_set(g, "NS2", "v4", "xyz ") 58 59 rblf.mkdist_for_goals(g, "goal", "dir1/file1:out1 dir1/file2:out2") 60 rblf.mkdist_for_goals(g, "goal", "dir2/file2:") 61 62 if rblf.board_platform_in(g, "board1 board2"): 63 cfg["PRODUCT_PACKAGES"] += ["bad_package"] 64 g["TARGET_BOARD_PLATFORM"] = "board1" 65 if rblf.board_platform_in(g, "board1 board2"): 66 cfg["PRODUCT_PACKAGES"] += ["board1_in"] 67 if rblf.board_platform_in(g, ["board3","board2"]): 68 cfg["PRODUCT_PACKAGES"] += ["bad_board_in"] 69 if rblf.board_platform_is(g, "board1"): 70 cfg["PRODUCT_PACKAGES"] += ["board1_is"] 71 if rblf.board_platform_is(g, "board2"): 72 cfg["PRODUCT_PACKAGES"] += ["bad_board1_is"] 73