Use sdkparcelables to generate framework.aidl

Use sdkparcelables to extract public parcelables from the
public, test, and system stubs jars, and combine them into
framework.aidl.

Bug: 70046217
Test: m checkbuild
Change-Id: I9de0ffe9dffbd80c8cb785b0624959c52c3200a1
This commit is contained in:
Colin Cross
2017-12-15 17:30:33 -08:00
parent 149008d892
commit 77ebd08d17

View File

@@ -244,12 +244,26 @@ aidl_files := \
system/netd/server/binder/android/net/UidRange.aidl \
frameworks/base/telephony/java/android/telephony/PcoData.aidl \
aidl_parcelables :=
define stubs-to-aidl-parcelables
gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl
aidl_parcelables += $$(gen)
$$(gen): $(call java-lib-header-files,$1) | $(HOST_OUT_EXECUTABLES)/sdkparcelables
@echo Extract SDK parcelables: $$@
rm -f $$@
$(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
endef
$(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
$(eval $(call stubs-to-aidl-parcelables,$(stubs))))
gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
$(gen): PRIVATE_SRC_FILES := $(aidl_files)
ALL_SDK_FILES += $(gen)
$(gen): $(aidl_files) | $(AIDL)
@echo Aidl Preprocess: $@
$(hide) $(AIDL) --preprocess $@ $(PRIVATE_SRC_FILES)
.KATI_RESTAT: $(gen)
$(gen): $(aidl_parcelables)
@echo Combining SDK parcelables: $@
rm -f $@.tmp
cat $^ | sort -u > $@.tmp
$(call commit-change-for-toc,$@)
# the documentation
# ============================================================
@@ -487,8 +501,6 @@ LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_DROIDDOC)
# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
$(full_target): $(gen)
$(INTERNAL_PLATFORM_API_FILE): $(full_target)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
@@ -524,8 +536,6 @@ LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_DROIDDOC)
# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
$(full_target): $(gen)
$(INTERNAL_PLATFORM_SYSTEM_API_FILE): $(full_target)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
@@ -562,8 +572,6 @@ LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_DROIDDOC)
# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
$(full_target): $(gen)
$(INTERNAL_PLATFORM_TEST_API_FILE): $(full_target)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
@@ -593,9 +601,6 @@ LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_DROIDDOC)
# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
$(full_target): $(gen)
# Run this for checkbuild
checkbuild: doc-comment-check-docs
# Check comment when you are updating the API