summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2017-12-15 17:30:33 -0800
committer Colin Cross <ccross@android.com> 2017-12-16 20:43:50 -0800
commit77ebd08d17f75912de984eae88fadba357d41f7f (patch)
tree8d49f03ca2ed21bba57d628f68b3cddf14952a70
parent149008d892ce76e83f6d95db09cdbb787293337b (diff)
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
-rw-r--r--Android.mk33
1 files changed, 19 insertions, 14 deletions
diff --git a/Android.mk b/Android.mk
index 83cdd739ab6b..5438bfab2d5e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -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