Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a4d751c authored by Jiakai Zhang's avatar Jiakai Zhang
Browse files

Filter out boot jars from CLC in Make.

This changes extends https://r.android.com/3506112 to filter out all
boot jars and do it in the right place.

Bug: 412490019
Bug: 413330617
Test: Build cf_gwear_x86-trunk_staging-userdebug and verify that
  package.invocation of PrebuiltWearsky does not contain wear-sdk in the
  CLC.
Flag: EXEMPT bugfix
Change-Id: Ica02b4f37955ff7853c8cedd079638855b016287
parent 34ee9717
Loading
Loading
Loading
Loading
+12 −4
Original line number Original line Diff line number Diff line
@@ -138,9 +138,17 @@ else
  my_dexpreopt_libs_compat :=
  my_dexpreopt_libs_compat :=
endif
endif


my_dexpreopt_libs := \
# Bootclasspath jars are accessible by all apps, so they don't have to and
  $(LOCAL_USES_LIBRARIES) \
# should not be in the CLC.
  $(my_filtered_optional_uses_libraries)
# For framework.jar, the name in `PRODUCT_BOOT_JARS` is `framework-minus-apex`,
# so we need to use `FRAMEWORK_LIBRARIES`, which contains `framework`, to be
# used for filtering.
my_all_boot_jars := \
  $(foreach jar,$(PRODUCT_BOOT_JARS) $(PRODUCT_APEX_BOOT_JARS),$(call word-colon,2,$(jar))) \
  $(FRAMEWORK_LIBRARIES)

my_dexpreopt_libs := $(filter-out $(my_all_boot_jars), \
  $(LOCAL_USES_LIBRARIES) $(my_filtered_optional_uses_libraries))


# The order needs to be deterministic.
# The order needs to be deterministic.
my_dexpreopt_libs_all := $(sort $(my_dexpreopt_libs) $(my_dexpreopt_libs_compat))
my_dexpreopt_libs_all := $(sort $(my_dexpreopt_libs) $(my_dexpreopt_libs_compat))
@@ -152,7 +160,7 @@ my_dexpreopt_libs_all := $(sort $(my_dexpreopt_libs) $(my_dexpreopt_libs_compat)
# this dexpreopt.config is generated. So it's necessary to add file-level
# this dexpreopt.config is generated. So it's necessary to add file-level
# dependencies between dexpreopt.config files.
# dependencies between dexpreopt.config files.
my_dexpreopt_dep_configs := $(foreach lib, \
my_dexpreopt_dep_configs := $(foreach lib, \
  $(filter-out $(my_dexpreopt_libs_compat) $(FRAMEWORK_LIBRARIES),$(LOCAL_USES_LIBRARIES) $(my_filtered_optional_uses_libraries)), \
  $(filter-out $(my_dexpreopt_libs_compat),$(my_dexpreopt_libs)), \
  $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,)/dexpreopt.config)
  $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,)/dexpreopt.config)


# 1: SDK version
# 1: SDK version