Skip to content
Snippets Groups Projects
Commit 5b1e7c9e authored by Nan Zhang's avatar Nan Zhang
Browse files

Migrate android_uiautomator generation to Soong.

Bug: b/70351683
Test: m clean && m android_uiautomator
and compare the old and new stubs.jar using md5sum.

Change-Id: I01937352ae1a470745f2ab1a9acbb4ea9520e153
parent d1a3b737
No related branches found
No related tags found
No related merge requests found
// Copyright (C) 2012 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.
droiddoc {
name: "uiautomator-stubs-docs",
srcs: [
"core-src/**/*.java",
"testrunner-src/**/*.java",
],
libs: [
"android.test.runner",
"junit",
"android.test.base",
],
custom_template: "droiddoc-templates-sdk",
installable: false,
args: "-stubpackages com.android.uiautomator.core:" +
"com.android.uiautomator.testrunner",
api_tag_name: "UIAUTOMATOR",
api_filename: "uiautomator_api.txt",
removed_api_filename: "uiautomator_removed_api.txt",
}
java_library_static {
name: "android_uiautomator",
srcs: [
":uiautomator-stubs-docs",
],
libs: [
"android.test.runner",
"junit",
],
}
java_library_static {
name: "uiautomator.core",
srcs: [
"core-src/**/*.java",
"testrunner-src/**/*.java",
],
libs: [
"android.test.runner",
"android.test.base",
],
static_libs: [
"junit",
]
}
......@@ -16,58 +16,6 @@
LOCAL_PATH:= $(call my-dir)
uiautomator.core_src_files := $(call all-java-files-under, core-src) \
$(call all-java-files-under, testrunner-src)
uiautomator.core_java_libraries := android.test.runner junit
uiautomator_internal_api_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/uiautomator_api.txt
uiautomator_internal_removed_api_file := \
$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/uiautomator_removed_api.txt
###############################################
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(uiautomator.core_src_files)
LOCAL_MODULE := uiautomator.core
LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_STATIC_JAVA_LIBRARIES := junit
include $(BUILD_STATIC_JAVA_LIBRARY)
###############################################
# Generate the stub source files
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(uiautomator.core_src_files)
LOCAL_JAVA_LIBRARIES := $(uiautomator.core_java_libraries) android.test.base
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/core-src \
$(LOCAL_PATH)/testrunner-src
LOCAL_DROIDDOC_HTML_DIR :=
LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_uiautomator_intermediates/src
LOCAL_DROIDDOC_OPTIONS:= \
-stubpackages com.android.uiautomator.core:com.android.uiautomator.testrunner \
-api $(uiautomator_internal_api_file) \
-removedApi $(uiautomator_internal_removed_api_file)
LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := external/doclava/res/assets/templates-sdk
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE := uiautomator-stubs
include $(BUILD_DROIDDOC)
uiautomator_stubs_stamp := $(full_target)
$(uiautomator_internal_api_file) : $(full_target)
###############################################
# Build the stub source files into a jar.
include $(CLEAR_VARS)
LOCAL_MODULE := android_uiautomator
LOCAL_JAVA_LIBRARIES := $(uiautomator.core_java_libraries)
LOCAL_SOURCE_FILES_ALL_GENERATED := true
# Make sure to run droiddoc first to generate the stub source files.
LOCAL_ADDITIONAL_DEPENDENCIES := $(uiautomator_stubs_stamp)
include $(BUILD_STATIC_JAVA_LIBRARY)
###############################################
# API check
# Please refer to build/core/tasks/apicheck.mk.
......@@ -86,13 +34,13 @@ checkapi_last_error_level_flags := \
$(eval $(call check-api, \
uiautomator-checkapi-last, \
$(uiautomator_api_dir)/$(last_released_sdk_version).txt, \
$(uiautomator_internal_api_file), \
$(INTERNAL_PLATFORM_UIAUTOMATOR_API_FILE), \
$(uiautomator_api_dir)/removed.txt, \
$(uiautomator_internal_removed_api_file), \
$(INTERNAL_PLATFORM_UIAUTOMATOR_REMOVED_API_FILE), \
$(checkapi_last_error_level_flags), \
cat $(LOCAL_PATH)/apicheck_msg_last.txt, \
uiautomator.core, \
$(uiautomator_stubs_stamp)))
$(OUT_DOCS)/uiautomator-stubs-docs-stubs.srcjar))
checkapi_current_error_level_flags := \
-error 2 -error 3 -error 4 -error 5 -error 6 \
......@@ -105,28 +53,24 @@ checkapi_current_error_level_flags := \
$(eval $(call check-api, \
uiautomator-checkapi-current, \
$(uiautomator_api_dir)/current.txt, \
$(uiautomator_internal_api_file), \
$(INTERNAL_PLATFORM_UIAUTOMATOR_API_FILE), \
$(uiautomator_api_dir)/removed.txt, \
$(uiautomator_internal_removed_api_file), \
$(INTERNAL_PLATFORM_UIAUTOMATOR_REMOVED_API_FILE), \
$(checkapi_current_error_level_flags), \
cat $(LOCAL_PATH)/apicheck_msg_current.txt, \
uiautomator.core, \
$(uiautomator_stubs_stamp)))
$(OUT_DOCS)/uiautomator-stubs-docs-stubs.srcjar))
.PHONY: update-uiautomator-api
update-uiautomator-api: PRIVATE_API_DIR := $(uiautomator_api_dir)
update-uiautomator-api: PRIVATE_REMOVED_API_FILE := $(uiautomator_internal_removed_api_file)
update-uiautomator-api: $(uiautomator_internal_api_file)
update-uiautomator-api: PRIVATE_REMOVED_API_FILE := $(INTERNAL_PLATFORM_UIAUTOMATOR_REMOVED_API_FILE)
update-uiautomator-api: $(INTERNAL_PLATFORM_UIAUTOMATOR_API_FILE)
@echo Copying uiautomator current.txt
$(hide) cp $< $(PRIVATE_API_DIR)/current.txt
@echo Copying uiautomator removed.txt
$(hide) cp $(PRIVATE_REMOVED_API_FILE) $(PRIVATE_API_DIR)/removed.txt
###############################################
# clean up temp vars
uiautomator.core_src_files :=
uiautomator.core_java_libraries :=
uiautomator_stubs_stamp :=
uiautomator_internal_api_file :=
uiautomator_api_dir :=
checkapi_last_error_level_flags :=
checkapi_current_error_level_flags :=
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment