Home | History | Annotate | Download | only in library
      1 #
      2 # Copyright (C) 2012 The Android Open Source Project
      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 #      http://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 
     17 LOCAL_PATH:= $(call my-dir)
     18 
     19 ###############################################
     20 # API check
     21 # Please refer to build/core/tasks/apicheck.mk.
     22 uiautomator_api_dir := frameworks/base/cmds/uiautomator/api
     23 last_released_sdk_version := $(lastword $(call numerically_sort, \
     24     $(filter-out current, \
     25         $(patsubst $(uiautomator_api_dir)/%.txt,%, $(wildcard $(uiautomator_api_dir)/*.txt)) \
     26     )))
     27 
     28 checkapi_last_error_level_flags := \
     29     -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 \
     30     -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
     31     -error 16 -error 17 -error 18
     32 
     33 # Check that the API we're building hasn't broken the last-released SDK version.
     34 $(eval $(call check-api, \
     35     uiautomator-checkapi-last, \
     36     $(uiautomator_api_dir)/$(last_released_sdk_version).txt, \
     37     $(INTERNAL_PLATFORM_UIAUTOMATOR_API_FILE), \
     38     $(uiautomator_api_dir)/removed.txt, \
     39     $(INTERNAL_PLATFORM_UIAUTOMATOR_REMOVED_API_FILE), \
     40     $(checkapi_last_error_level_flags), \
     41     cat $(LOCAL_PATH)/apicheck_msg_last.txt, \
     42     uiautomator.core, \
     43     $(OUT_DOCS)/uiautomator-stubs-docs-stubs.srcjar))
     44 
     45 checkapi_current_error_level_flags := \
     46     -error 2 -error 3 -error 4 -error 5 -error 6 \
     47     -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
     48     -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
     49     -error 25
     50 
     51 # Check that the API we're building hasn't changed from the not-yet-released
     52 # SDK version.
     53 $(eval $(call check-api, \
     54     uiautomator-checkapi-current, \
     55     $(uiautomator_api_dir)/current.txt, \
     56     $(INTERNAL_PLATFORM_UIAUTOMATOR_API_FILE), \
     57     $(uiautomator_api_dir)/removed.txt, \
     58     $(INTERNAL_PLATFORM_UIAUTOMATOR_REMOVED_API_FILE), \
     59     $(checkapi_current_error_level_flags), \
     60     cat $(LOCAL_PATH)/apicheck_msg_current.txt, \
     61     uiautomator.core, \
     62     $(OUT_DOCS)/uiautomator-stubs-docs-stubs.srcjar))
     63 
     64 .PHONY: update-uiautomator-api
     65 update-uiautomator-api: PRIVATE_API_DIR := $(uiautomator_api_dir)
     66 update-uiautomator-api: PRIVATE_REMOVED_API_FILE := $(INTERNAL_PLATFORM_UIAUTOMATOR_REMOVED_API_FILE)
     67 update-uiautomator-api: $(INTERNAL_PLATFORM_UIAUTOMATOR_API_FILE)
     68 	@echo Copying uiautomator current.txt
     69 	$(hide) cp $< $(PRIVATE_API_DIR)/current.txt
     70 	@echo Copying uiautomator removed.txt
     71 	$(hide) cp $(PRIVATE_REMOVED_API_FILE) $(PRIVATE_API_DIR)/removed.txt
     72 ###############################################
     73 # clean up temp vars
     74 uiautomator_api_dir :=
     75 checkapi_last_error_level_flags :=
     76 checkapi_current_error_level_flags :=
     77