diff options
author | David Brazdil <dbrazdil@google.com> | 2018-05-11 15:11:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-05-11 15:11:23 +0000 |
commit | f36144f575098d2ff1be8343827fb92d10b9db9b (patch) | |
tree | cc74d03a49226e958818f9e0321bf595289b5727 /Android.mk | |
parent | accef3e1f58a256aa7a35f490801931f9c1dc139 (diff) | |
parent | 4c3c03129ba95dccab30ba7579dc91b97843271f (diff) |
Merge "Include in hidden API dark greylist based on package name" into pi-dev
Diffstat (limited to 'Android.mk')
-rw-r--r-- | Android.mk | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Android.mk b/Android.mk index ccf3894a3d02..66c9529317f2 100644 --- a/Android.mk +++ b/Android.mk @@ -945,21 +945,21 @@ $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL) $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST)) -# Generate dark greylist as remaining members of classes on the light greylist, -# as well as the members of their inner classes. +# Generate dark greylist as remaining classes and class members in the same +# package as classes listed in the light greylist. # The algorithm is as follows: # (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST -# (2) strip the final semicolon and anything after (and including) a dollar sign, -# e.g. 'Lpackage/class$inner;' turns into 'Lpackage/class' -# (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the stripped -# descriptor followed by a semi-colon or a dollar sign, e.g. matching a regex -# '^Lpackage/class[;$]' +# (2) strip everything after the last forward-slash, +# e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/' +# (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package +# name but do not contain another forward-slash in the class name, e.g. +# matching '^Lpackage/subpackage/[^/;]*;' # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \ - <(sed 's/;\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/$$.*//' | sort | uniq | \ - while read CLASS_DESC; do \ - grep -E "^$${CLASS_DESC}[;$$]" $(LOCAL_SRC_PRIVATE_API); \ + <(sed 's/\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/\(.*\/\).*/\1/' | sort | uniq | \ + while read PKG_NAME; do \ + grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \ done | sort | uniq) \ > $@ $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) @@ -988,4 +988,3 @@ include $(call first-makefiles-under,$(LOCAL_PATH)) endif endif # ANDROID_BUILD_EMBEDDED - |