blob: b4c6d45ced6df453e6cf5996ffb30a856b3f6599 [file] [log] [blame]
Sasha Smundak5c8b09b2020-11-03 23:44:14 -08001
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 Smundaka93e3d92021-07-28 14:34:33 -070024### 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 Smundakdc154162021-09-17 15:27:37 -070026### $(call add_soong_config_namespace,NS1)
27### $(call soong_config_append,NS1,v1,abc)
28### $(call soong_config_append,NS1,v2,def)
Sasha Smundakc1061382021-07-28 12:29:00 -070029### $(call add_soong_config_var_value,NS2,v3,abc)
Sasha Smundakdc154162021-09-17 15:27:37 -070030### $(call soong_config_set,NS2,v3,xyz)
Sasha Smundak5c8b09b2020-11-03 23:44:14 -080031
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"]
Sasha Smundak6b795dc2021-08-18 16:32:19 -070047 cfg["PRODUCT_COPY_FILES"] += (rblf.find_and_copy("audio_platform_info*.xml", "device/google/redfin", "||VENDOR-PATH-PH||/etc") +
Sasha Smundaka93e3d92021-07-28 14:34:33 -070048 ["xyz:/etc/xyz"])
49 cfg["PRODUCT_COPY_FILES"] += rblf.copy_files("x.xml y.xml", "/etc")
Sasha Smundak6797bfa2021-08-19 09:49:49 -070050 cfg["PRODUCT_COPY_FILES"] += rblf.copy_files(["from/sub/x", "from/sub/y"], "to")
51
Sasha Smundakdc154162021-09-17 15:27:37 -070052 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 Faust37363742023-05-02 10:11:02 -070057 rblf.soong_config_set(g, "NS2", "v4", "xyz ")
Sasha Smundakc1061382021-07-28 12:29:00 -070058
Sasha Smundak91fc7342021-11-18 11:20:34 -080059 rblf.mkdist_for_goals(g, "goal", "dir1/file1:out1 dir1/file2:out2")
60 rblf.mkdist_for_goals(g, "goal", "dir2/file2:")
61
Sasha Smundak3370ad52021-08-26 16:59:55 -070062 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"]