Merge "Experimental feature: LOCAL_PATCH_MODULE option in .mk files."

This commit is contained in:
Tobias Thierer 2018-01-22 11:34:18 +00:00 committed by Gerrit Code Review
commit 4bb18a8a2e
4 changed files with 18 additions and 0 deletions

View File

@ -762,6 +762,19 @@ does this.</p>
Dialer, Contacts, etc. This will probably change or go away when we switch
to an ant-based build system for the apps.</p>
<h4>LOCAL_PATCH_MODULE (experimental option)</h4>
<p>As of January 2018, you almost certainly don't need this option, so please
ask and only use it if you understand what you're doing. This feature is
experimental and may go away in future.</p>
<p>
When compiling language level 9+ .java code in packages that are part of a
a system module, <code>LOCAL_PATCH_MODULE</code> names the module that your
sources and dependencies should be patched into. The Android runtime currently
(Jan 2018) doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in packages
that exist in libcore and which are inconvenient to move elsewhere.
</p>
<h4>LOCAL_PATH</h4>
<p>The directory your Android.mk file is in. You can set it by putting the
following as the first line in your Android.mk:</p>

View File

@ -182,6 +182,7 @@ LOCAL_OVERRIDES_MODULES:=
LOCAL_PACKAGE_NAME:=
LOCAL_PACKAGE_SPLITS:=
LOCAL_PACK_MODULE_RELOCATIONS:=
LOCAL_PATCH_MODULE:=
LOCAL_PICKUP_FILES:=
LOCAL_POST_INSTALL_CMD:=
LOCAL_POST_LINK_CMD:=

View File

@ -2245,6 +2245,9 @@ $(hide) if [ -s $(PRIVATE_JAVA_SOURCE_LIST) ] ; then \
$(addprefix -bootclasspath ,$(strip \
$(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH)) \
$(PRIVATE_EMPTY_BOOTCLASSPATH)))) \
$(if $(PRIVATE_USE_SYSTEM_MODULES), \
$(if $(PRIVATE_PATCH_MODULE), \
--patch-module=$(PRIVATE_PATCH_MODULE)=$(call normalize-path-list,. $(2)))) \
$(addprefix -classpath ,$(strip \
$(call normalize-path-list,$(2)))) \
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \

View File

@ -359,6 +359,7 @@ endif
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := $(full_java_bootclasspath_libs)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EMPTY_BOOTCLASSPATH := $(empty_bootclasspath)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SYSTEM_MODULES := $(my_system_modules_dir)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PATCH_MODULE := $(LOCAL_PATCH_MODULE)
ifndef LOCAL_IS_HOST_MODULE
# This is set by packages that are linking to other packages that export