Sasha Smundak | 5c8b09b | 2020-11-03 23:44:14 -0800 | [diff] [blame] | 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 |
Sasha Smundak | a93e3d9 | 2021-07-28 14:34:33 -0700 | [diff] [blame] | 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) |
Sasha Smundak | dc15416 | 2021-09-17 15:27:37 -0700 | [diff] [blame] | 26 | ### $(call add_soong_config_namespace,NS1) |
| 27 | ### $(call soong_config_append,NS1,v1,abc) |
| 28 | ### $(call soong_config_append,NS1,v2,def) |
Sasha Smundak | c106138 | 2021-07-28 12:29:00 -0700 | [diff] [blame] | 29 | ### $(call add_soong_config_var_value,NS2,v3,abc) |
Sasha Smundak | dc15416 | 2021-09-17 15:27:37 -0700 | [diff] [blame] | 30 | ### $(call soong_config_set,NS2,v3,xyz) |
Sasha Smundak | 5c8b09b | 2020-11-03 23:44:14 -0800 | [diff] [blame] | 31 | |
| 32 | load("//build/make/core:product_config.rbc", "rblf") |
| 33 | load(":part1.rbc", _part1_init = "init") |
| 34 | load(":include1.rbc", _include1_init = "init") |
| 35 | |
| 36 | def 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"] |
Sasha Smundak | 6b795dc | 2021-08-18 16:32:19 -0700 | [diff] [blame] | 47 | cfg["PRODUCT_COPY_FILES"] += (rblf.find_and_copy("audio_platform_info*.xml", "device/google/redfin", "||VENDOR-PATH-PH||/etc") + |
Sasha Smundak | a93e3d9 | 2021-07-28 14:34:33 -0700 | [diff] [blame] | 48 | ["xyz:/etc/xyz"]) |
| 49 | cfg["PRODUCT_COPY_FILES"] += rblf.copy_files("x.xml y.xml", "/etc") |
Sasha Smundak | 6797bfa | 2021-08-19 09:49:49 -0700 | [diff] [blame] | 50 | cfg["PRODUCT_COPY_FILES"] += rblf.copy_files(["from/sub/x", "from/sub/y"], "to") |
| 51 | |
Sasha Smundak | dc15416 | 2021-09-17 15:27:37 -0700 | [diff] [blame] | 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") |
Cole Faust | 3736374 | 2023-05-02 10:11:02 -0700 | [diff] [blame] | 57 | rblf.soong_config_set(g, "NS2", "v4", "xyz ") |
Sasha Smundak | c106138 | 2021-07-28 12:29:00 -0700 | [diff] [blame] | 58 | |
Sasha Smundak | 91fc734 | 2021-11-18 11:20:34 -0800 | [diff] [blame] | 59 | rblf.mkdist_for_goals(g, "goal", "dir1/file1:out1 dir1/file2:out2") |
| 60 | rblf.mkdist_for_goals(g, "goal", "dir2/file2:") |
| 61 | |
Sasha Smundak | 3370ad5 | 2021-08-26 16:59:55 -0700 | [diff] [blame] | 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"] |