Add Soong variable for optimizing system Java

Introduce a Soong variable to allow selective enabling of Java
optimizations for platform targets. This will be used initially
to control optimizations (and shrinking) for system server + sysui.

Opting in to optimizations can be achieved with either:
  * Env:
export SYSTEM_OPTIMIZE_JAVA=true
  * Make:
$(call add_soong_config_var_value,ANDROID,SYSTEM_OPTIMIZE_JAVA,true)

Note that the actual framework build rule changes to hook into this
variable will land separately.

Bug: 203088572
Test: `SYSTEM_OPTIMIZE_JAVA=true m` (observe env variable change log)
Change-Id: I959985bdff394c2445cb1632116846a8d2f5443d
This commit is contained in:
Jared Duke 2021-11-18 13:00:02 -08:00
parent 351cd2e489
commit 2819a5beed

View file

@ -99,3 +99,7 @@ endif
ifeq (true,$(MODULE_BUILD_FROM_SOURCE))
$(call add_soong_config_var_value,ANDROID,module_build_from_source,true)
endif
# TODO(b/196084106): Remove when Java optimizations enabled by default for
# system packages.
$(call add_soong_config_var,ANDROID,SYSTEM_OPTIMIZE_JAVA)