• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2018 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# Build all sub-directories
16LOCAL_PATH:= $(call my-dir)
17include $(CLEAR_VARS)
18
19gamecore_dist_host_jar := GameQualificationHelperHost GameQualificationHostTestCases GameQualificationPerformanceTest truth-prebuilt
20gamecore_dist_test_exe := GameQualificationNativeTestCases
21gamecore_dist_test_apk := GameQualificationDevice GameQualificationSampleApp GameQualificationJavaTestCases GameQualificationAllocstress
22
23tradefed_jars := tradefed tools-common-prebuilt
24tradefed_files := \
25    tools/tradefederation/core/tradefed.sh \
26    tools/tradefederation/core/tradefed_win.bat  \
27    tools/tradefederation/core/script_help.sh \
28
29config_files := \
30    $(LOCAL_PATH)/AndroidTest.xml \
31    $(LOCAL_PATH)/dist/certification-tests.xml \
32    $(LOCAL_PATH)/dist/run_gamecore.sh \
33    $(LOCAL_PATH)/dist/README
34
35bit_suffix := $(if $(TARGET_IS_64_BIT),64,32)
36
37gamecore_dist_copy_pairs := $(foreach m, $(gamecore_dist_host_jar) $(tradefed_jars), \
38    $(call intermediates-dir-for,JAVA_LIBRARIES,$(m),HOST,COMMON)/javalib.jar:gamecore/bin/$(m).jar)
39gamecore_dist_copy_pairs += $(foreach m, $(gamecore_dist_test_exe), \
40    $(call intermediates-dir-for,NATIVE_TESTS,$(m))/$(m)$(bit_suffix):gamecore/testcases/$(TARGET_ARCH)/$(m)$(bit_suffix))
41gamecore_dist_copy_pairs += $(foreach m, $(gamecore_dist_test_apk), \
42    $(call intermediates-dir-for,APPS,$(m))/package.apk:gamecore/testcases/$(m).apk)
43gamecore_dist_copy_pairs += $(foreach f, $(tradefed_files),$(f):gamecore/bin/$(notdir $(f)))
44gamecore_dist_copy_pairs += $(foreach f, $(config_files),$(f):gamecore/$(notdir $(f)))
45
46gamecore_dist_host_jar :=
47gamecore_dist_test_exe :=
48gamecore_dist_test_apk :=
49tradefed_jars :=
50tradefed_files :=
51config_files :=
52bit_suffix :=
53
54gamecore_dist_intermediates := $(call intermediates-dir-for,PACKAGING,gamecore_dist,HOST,COMMON)
55gamecore_dist_zip := $(gamecore_dist_intermediates)/gamecore.zip
56$(gamecore_dist_zip) : PRIVATE_COPY_PAIRS := $(gamecore_dist_copy_pairs)
57$(gamecore_dist_zip) : $(SOONG_ZIP) $(foreach p,$(gamecore_dist_copy_pairs),$(call word-colon,1,$(p)))
58	rm -rf $(dir $@) && mkdir -p $(dir $@)/gamecore
59	mkdir -p $(dir $@)/gamecore/bin
60	mkdir -p $(dir $@)/gamecore/testcases/$(TARGET_ARCH)
61	$(foreach p,$(PRIVATE_COPY_PAIRS), \
62	  cp -f $(call word-colon,1,$(p)) $(dir $@)/$(call word-colon,2,$(p)) &&) true
63	echo $(BUILD_NUMBER_FROM_FILE) > $(dir $@)/gamecore/version.txt
64	$(SOONG_ZIP) -o $@ -C $(dir $@) -f $(dir $@)/gamecore/version.txt \
65	  $(foreach p,$(PRIVATE_COPY_PAIRS),-f $(dir $@)/$(call word-colon,2,$(p)))
66
67.PHONY: gamecore
68gamecore: $(gamecore_dist_host_jar) $(gamecore_dist_test_apk)
69
70.PHONY: gamecore-test
71gamecore-test: GameQualificationPerformanceTestTest GameQualificationHelperTest
72
73.PHONY: gamecore-all
74gamecore-all: gamecore gamecore-test
75
76$(call dist-for-goals, gamecore, $(gamecore_dist_zip))
77
78gamecore_dist_copy_pairs :=
79gamecore_dist_intermediates :=
80gamecore_dist_zip :=
81
82include $(call all-makefiles-under,$(LOCAL_PATH))
83