Android.mk revision e254526f0fe5d22681555bd4a00b7ee96fee1dc1
1e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin#
2e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Copyright (C) 2008 The Android Open Source Project
3e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin#
4e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Licensed under the Apache License, Version 2.0 (the "License");
5e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# you may not use this file except in compliance with the License.
6e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# You may obtain a copy of the License at
7e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin#
8e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin#      http://www.apache.org/licenses/LICENSE-2.0
9e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin#
10e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Unless required by applicable law or agreed to in writing, software
11e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# distributed under the License is distributed on an "AS IS" BASIS,
12e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# See the License for the specific language governing permissions and
14e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# limitations under the License.
15e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin#
16e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
17e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_PATH:= $(call my-dir)
18e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
19e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinandroid_test_mock_source_files := $(call all-java-files-under, src/android/test/mock)
20e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
21e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Build the repackaged.android.test.mock library
22e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# ==============================================
23e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(CLEAR_VARS)
24e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
25e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_SRC_FILES := $(call all-java-files-under, src)
26e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
27e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_JAVA_LIBRARIES := core-oj core-libart framework legacy-test
28e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
29e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_JARJAR_RULES := $(LOCAL_PATH)/../legacy-test/jarjar-rules.txt
30e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
31e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_MODULE:= repackaged.android.test.mock
32e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
33e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(BUILD_STATIC_JAVA_LIBRARY)
34e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
35e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Build the android.test.mock library
36e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# ===================================
37e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(CLEAR_VARS)
38e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
39e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_SRC_FILES := $(call all-java-files-under, src)
40e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
41e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_JAVA_LIBRARIES := core-oj core-libart framework
42e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
43e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_MODULE:= android.test.mock
44e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
45e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(BUILD_JAVA_LIBRARY)
46e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
47e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# For unbundled build we'll use the prebuilt jar from prebuilts/sdk.
48e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))
49e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
50e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Generate the stub source files for android.test.mock.stubs
51e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# ==========================================================
52e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(CLEAR_VARS)
53e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_SRC_FILES := $(android_test_mock_source_files)
54e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
55e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_JAVA_LIBRARIES := core-oj core-libart framework
56e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_MODULE_CLASS := JAVA_LIBRARIES
57e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src/android/test/mock
58e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
59e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinANDROID_TEST_MOCK_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/api.txt
60e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/removed.txt
61e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
62e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinANDROID_TEST_MOCK_API_FILE := $(LOCAL_PATH)/api/android-test-mock-current.txt
63e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinANDROID_TEST_MOCK_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-mock-removed.txt
64e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
65e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_DROIDDOC_OPTIONS:= \
66e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -stubpackages android.test.mock \
67e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/src \
68e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -nodocs \
69e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -api $(ANDROID_TEST_MOCK_OUTPUT_API_FILE) \
70e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -removedApi $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE) \
71e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
72e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_UNINSTALLABLE_MODULE := true
73e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_MODULE := android-test-mock-api-stubs-gen
74e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
75e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(BUILD_DROIDDOC)
76e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
77e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Remember the target that will trigger the code generation.
78e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinandroid_test_mock_gen_stamp := $(full_target)
79e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
80e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Add some additional dependencies
81e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin$(ANDROID_TEST_MOCK_OUTPUT_API_FILE): $(full_target)
82e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin$(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE): $(full_target)
83e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
84e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Build the android.test.mock.stubs library
85e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# =========================================
86e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(CLEAR_VARS)
87e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
88e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_MODULE := android.test.mock.stubs
89e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
90e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_SOURCE_FILES_ALL_GENERATED := true
91e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
92e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Make sure to run droiddoc first to generate the stub source files.
93e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_mock_gen_stamp)
94e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinandroid_test_mock_gen_stamp :=
95e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
96e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(BUILD_STATIC_JAVA_LIBRARY)
97e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
98e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Archive a copy of the classes.jar in SDK build.
99e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.mock.stubs.jar)
100e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
101e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Check that the android.test.mock.stubs library has not changed
102e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# ==============================================================
103e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
104e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Check that the API we're building hasn't changed from the not-yet-released
105e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# SDK version.
106e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin$(eval $(call check-api, \
107e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    check-android-test-mock-api-current, \
108e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    $(ANDROID_TEST_MOCK_API_FILE), \
109e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    $(ANDROID_TEST_MOCK_OUTPUT_API_FILE), \
110e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    $(ANDROID_TEST_MOCK_REMOVED_API_FILE), \
111e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE), \
112e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -error 2 -error 3 -error 4 -error 5 -error 6 \
113e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
114e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
115e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    -error 25 -error 26 -error 27, \
116e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    cat $(LOCAL_PATH)/api/apicheck_msg_android_test_mock.txt, \
117e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    check-android-test-mock-api, \
118e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    $(call doc-timestamp-for,android-test-mock-api-stubs-gen) \
119e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin    ))
120e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
121e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin.PHONY: check-android-test-mock-api
122e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffincheckapi: check-android-test-mock-api
123e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
124e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin.PHONY: update-android-test-mock-api
125e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinupdate-api: update-android-test-mock-api
126e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
127e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinupdate-android-test-mock-api: $(ANDROID_TEST_MOCK_OUTPUT_API_FILE) | $(ACP)
128e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin	@echo Copying current.txt
129e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin	$(hide) $(ACP) $(ANDROID_TEST_MOCK_OUTPUT_API_FILE) $(ANDROID_TEST_MOCK_API_FILE)
130e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin	@echo Copying removed.txt
131e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin	$(hide) $(ACP) $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_MOCK_REMOVED_API_FILE)
132e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
133e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# Build the android.test.mock.sdk library
134e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin# =======================================
135e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(CLEAR_VARS)
136e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
137e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_MODULE := android.test.mock.sdk
138e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_SDK_VERSION := current
139e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
140e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul DuffinLOCAL_STATIC_JAVA_LIBRARIES := android.test.mock.stubs
141e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
142e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffininclude $(BUILD_STATIC_JAVA_LIBRARY)
143e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffin
144e254526f0fe5d22681555bd4a00b7ee96fee1dc1Paul Duffinendif  # not TARGET_BUILD_APPS not TARGET_BUILD_PDK=true
145