summaryrefslogtreecommitdiff
path: root/build/Android.mk
blob: 82b18833748dc2c2b20f1b6fc2bd7025a8b62760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)
VTF_MK := $(LOCAL_PATH)/vtf.mk
VTF_PACKAGE_MK := test/vts/tools/build/tasks/framework/vtf_package.mk

include $(CLEAR_VARS)
include $(LOCAL_PATH)/tasks/list/vtslab_apk_package_list.mk
include $(LOCAL_PATH)/tasks/list/vtslab_bin_package_list.mk
include $(LOCAL_PATH)/tasks/list/vtslab_lib_package_list.mk

VTSLAB_OUT_ROOT := $(HOST_OUT)/vtslab
VTSLAB_TESTCASES_OUT := $(VTSLAB_OUT_ROOT)/android-vtslab/testcases
VTSLAB_TOOLS_OUT := $(VTSLAB_OUT_ROOT)/android-vtslab/tools
VTSLAB_BIN_LIB_OUT := $(VTSLAB_OUT_ROOT)/android-vtslab/
VTSLAB_TIMESTAMP := $(shell git -C $(LOCAL_PATH) log -s -n 1 --format="%cd" \
  --date=format:"%Y%m%d_%H%M%S" 2>/dev/null)
VTSLAB_SHORTHASH := $(shell git -C $(LOCAL_PATH) rev-parse --short HEAD 2>/dev/null)
VTSLAB_VERSION := $(VTSLAB_TIMESTAMP):$(VTSLAB_SHORTHASH)

# Packaging rule for android-vtslab.zip
test_suite_name := vtslab
test_suite_readme := test/framework/README.md

include $(LOCAL_PATH)/package.mk
include $(LOCAL_PATH)/utils/vtslab_package_utils.mk

# TODO: instead of an alias, deprecate vtslab build target
.PHONY: lab
lab: vtslab
.PHONY: vtslab
vtslab: $(compatibility_zip)
$(call dist-for-goals, vtslab, $(compatibility_zip))

# Packaging rule for android-vtslab.zip's testcases dir (DATA subdir).
vtslab_apk_modules := \
  $(vtslab_apk_packages) \

vtslab_apk_modules_copy_pairs := \
  $(call target-native-copy-pairs,$(vtslab_apk_modules),$(VTSLAB_TESTCASES_OUT))

# host controller files.
host_hc_files := \
  $(call find-files-in-subdirs,test/framework/harnesses/host_controller,"*.py" -and -type f,.) \

host_hc_copy_pairs := \
  $(foreach f,$(host_hc_files),\
      test/framework/harnesses/host_controller/$(f):$(VTSLAB_TESTCASES_OUT)/host_controller/$(f))

# gsi security patch scripts.
host_hc_gsispl_files := \
  $(call find-files-in-subdirs,test/framework/harnesses/host_controller/gsi,"*.sh" -and -type f,.) \

host_hc_gsispl_copy_pairs := \
  $(foreach f,$(host_hc_gsispl_files),\
    test/framework/harnesses/host_controller/gsi/$(f):$(VTSLAB_BIN_LIB_OUT)/bin/$(f))

# host controller scripts.
host_hc_extra_copy_pairs := \
  test/framework/tools/host_controller/run:$(VTSLAB_TOOLS_OUT)/run \
  test/framework/tools/host_controller/make_screen:$(VTSLAB_TOOLS_OUT)/make_screen \
  test/vts/script/diagnose.py:$(VTSLAB_BIN_LIB_OUT)/bin/diagnose.py \
  test/vts/script/pip_requirements.txt:$(VTSLAB_BIN_LIB_OUT)/bin/pip_requirements.txt \
  test/vts/script/setup.sh:$(VTSLAB_BIN_LIB_OUT)/bin/setup.sh \

host_acloud_files := \
  $(call find-files-in-subdirs,tools/acloud,"*.py" -and -type f,.) \
  $(call find-files-in-subdirs,tools/acloud,"*.config" -and -type f,.)

host_acloud_copy_pairs := \
  $(foreach f,$(host_acloud_files),\
    tools/acloud/$(f):$(VTSLAB_TESTCASES_OUT)/acloud/$(f))

host_vti_dashboard_proto_files := \
  $(call find-files-in-subdirs,test/vti/dashboard/proto,"*.py" -and -type f,.)

host_vti_test_serving_proto_files := \
  $(call find-files-in-subdirs,test/vti/test_serving/proto,"*.py" -and -type f,.)

host_vti_copy_pairs := \
  $(foreach f,$(host_vti_test_serving_proto_files),\
    test/vti/test_serving/proto/$(f):$(VTSLAB_TESTCASES_OUT)/vti/test_serving/proto/$(f)) \
  $(foreach f,$(host_vti_dashboard_proto_files),\
    test/vti/dashboard/proto/$(f):$(VTSLAB_TESTCASES_OUT)/vti/dashboard/proto/$(f)) \
  test/vti/dashboard/__init__.py:$(VTSLAB_TESTCASES_OUT)/vti/dashboard/__init__.py \
  test/vti/test_serving/__init__.py:$(VTSLAB_TESTCASES_OUT)/vti/test_serving/__init__.py \

$(VTSLAB_TESTCASES_OUT)/vti/__init__.py:
	@mkdir -p $(VTSLAB_TESTCASES_OUT)/vti
	@touch $(VTSLAB_TESTCASES_OUT)/vti/__init__.py

host_vti_extra_copy_pairs := \
  $(VTSLAB_TESTCASES_OUT)/vti/__init__.py \

vts_host_python_files := \
  $(call find-files-in-subdirs,test/vts,"*.py" -and -type f,.)

vts_host_python_copy_pairs := \
  $(foreach f,$(vts_host_python_files),\
    test/vts/$(f):$(VTSLAB_TESTCASES_OUT)/vts/$(f))

# Packaging rule for host-controller's dependencies
host_hc_bin_lib := \
  $(vtslab_bin_packages) \
  $(vtslab_lib_packages) \

host_hc_bin_lib_copy_pairs := \
  $(call host-native-copy-pairs,$(host_hc_bin_lib),$(VTSLAB_BIN_LIB_OUT))

vtslab_copy_pairs := \
  $(call copy-many-files,$(vtslab_apk_modules_copy_pairs)) \
  $(call copy-many-files,$(host_hc_copy_pairs)) \
  $(call copy-many-files,$(host_hc_gsispl_copy_pairs)) \
  $(call copy-many-files,$(host_hc_extra_copy_pairs)) \
  $(call copy-many-files,$(host_acloud_copy_pairs)) \
  $(call copy-many-files,$(host_vti_copy_pairs)) \
  $(call copy-many-files,$(vts_host_python_copy_pairs)) \
  $(call copy-many-files,$(host_hc_bin_lib_copy_pairs)) \
  $(host_vti_extra_copy_pairs) \

$(compatibility_zip): $(vtslab_copy_pairs) $(VTSLAB_TESTCASES_OUT)/version.txt

$(VTSLAB_TESTCASES_OUT)/version.txt:
	@rm -f $@
	@echo $(VTSLAB_VERSION) > $@

# for VTF (Vendor Test Framework)
VTF_OUT_ROOT := $(HOST_OUT)/vtf
VTF_TESTCASES_OUT := $(VTF_OUT_ROOT)/android-vtf/testcases
VTF_TOOLS_OUT := $(VTF_OUT_ROOT)/android-vtf/tools
VTF_EXTRA_SCRIPTS := vtf

include $(VTF_PACKAGE_MK)
include $(VTF_MK)

# clears local vars
VTF_MK :=
VTF_PACKAGE_MK :=