blob: 353ae07a50fcc79f40db9bc2d064aed443e69ed3 [file] [log] [blame]
Brian Muramatsu5df641c2011-12-28 15:46:57 -08001# Copyright (C) 2011 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#
16# Builds a package and defines a rule to generate the associated test
17# package XML needed by CTS.
18#
19# Replace "include $(BUILD_PACKAGE)" with "include $(BUILD_CTS_PACKAGE)"
20#
21
Brian Carlstromcb711272012-06-16 23:32:47 -070022# Disable by default so "m cts" will work in emulator builds
23LOCAL_DEX_PREOPT := false
Ying Wang815d87d2013-08-23 13:54:26 -070024LOCAL_PROGUARD_ENABLED := disabled
Brian Carlstromcb711272012-06-16 23:32:47 -070025
Brian Muramatsu5df641c2011-12-28 15:46:57 -080026include $(BUILD_PACKAGE)
27
28cts_package_apk := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).apk
29cts_package_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).xml
30
31$(cts_package_apk): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
32$(cts_package_apk): $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/package.apk | $(ACP)
33 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
34 $(hide) $(ACP) -fp $(call intermediates-dir-for,APPS,$(PRIVATE_PACKAGE))/package.apk $@
35
36$(cts_package_xml): PRIVATE_PATH := $(LOCAL_PATH)
37$(cts_package_xml): PRIVATE_INSTRUMENTATION := $(LOCAL_INSTRUMENTATION_FOR)
38$(cts_package_xml): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
Stuart Scottd35f8eb2014-01-13 17:41:01 -080039ifneq ($(filter cts/suite/cts/%, $(LOCAL_PATH)),)
40PRIVATE_CTS_TEST_PACKAGE_NAME_ := com.android.cts.$(notdir $(LOCAL_PATH))
41else
42PRIVATE_CTS_TEST_PACKAGE_NAME_ := android.$(notdir $(LOCAL_PATH))
43endif
44$(cts_package_xml): PRIVATE_TEST_PACKAGE := $(PRIVATE_CTS_TEST_PACKAGE_NAME_)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080045$(cts_package_xml): PRIVATE_MANIFEST := $(LOCAL_PATH)/AndroidManifest.xml
Svetoslav Ganovb803f802012-03-07 19:13:05 -080046$(cts_package_xml): PRIVATE_TEST_TYPE := $(if $(LOCAL_CTS_TEST_RUNNER),$(LOCAL_CTS_TEST_RUNNER),'')
Stuart Scott34c8fc82014-09-08 13:25:16 -070047$(cts_package_xml): $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/package.apk $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080048 $(hide) echo Generating test description for java package $(PRIVATE_PACKAGE)
49 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Svetoslav Ganovb803f802012-03-07 19:13:05 -080050 $(hide) $(CTS_JAVA_TEST_SCANNER) \
51 -s $(PRIVATE_PATH) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080052 -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
Svetoslav Ganovb803f802012-03-07 19:13:05 -080053 $(CTS_XML_GENERATOR) \
54 -t $(PRIVATE_TEST_TYPE) \
55 -m $(PRIVATE_MANIFEST) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080056 -i "$(PRIVATE_INSTRUMENTATION)" \
57 -n $(PRIVATE_PACKAGE) \
58 -p $(PRIVATE_TEST_PACKAGE) \
59 -e $(CTS_EXPECTATIONS) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070060 -b $(CTS_UNSUPPORTED_ABIS) \
Stuart Scottccdc00b2014-09-29 20:42:08 +000061 -a $(CTS_TARGET_ARCH) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080062 -o $@