Fix desugaring when LOCAL_SDK_VERSION is not set

When LOCAL_SDK_VERSION is not set, frameworks.jar is put
in the classpath for javac.  If it is also in the classpath
(as opposed to the bootclasspath) for desugar then desugar
tries to rewrite classes that implement interfaces with
default methods to contain calls to the generated companion
classes for those interfaces.  frameworks.jar will not
contain the companion classes, which causes proguard to
fail.

Move frameworks.jar to the bootclasspath, which matches more
closely with builds against the SDK stubs jars.

Also remove the static libraries from the classpath, they have
already been merged into the input jar.

Test: m checkbuild
Change-Id: If30943efcaea44b2db1b38a6c1d558113324757f
This commit is contained in:
Colin Cross
2017-10-25 17:33:38 -07:00
parent 4d85d55e09
commit 98caed6e7f
4 changed files with 21 additions and 34 deletions

View File

@@ -18,25 +18,6 @@ endif #PDK
LOCAL_NO_STANDARD_LIBRARIES:=$(strip $(LOCAL_NO_STANDARD_LIBRARIES))
LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
ifneq ($(LOCAL_MODULE),jacocoagent)
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
ifeq ($(EMMA_INSTRUMENT),true)
ifneq ($(EMMA_INSTRUMENT_STATIC),true)
# For instrumented build, if Jacoco is not being included statically
# in instrumented packages then include Jacoco classes into the
# bootclasspath.
LOCAL_JAVA_LIBRARIES := jacocoagent $(LOCAL_JAVA_LIBRARIES)
endif # EMMA_INSTRUMENT_STATIC
endif # EMMA_INSTRUMENT
endif # !LOCAL_NO_STANDARD_LIBRARIES
endif # LOCAL_MODULE == jacocoagent
ifndef LOCAL_SDK_VERSION
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
LOCAL_JAVA_LIBRARIES := $(TARGET_DEFAULT_JAVA_LIBRARIES) $(LOCAL_JAVA_LIBRARIES)
endif
endif
proto_sources := $(filter %.proto,$(LOCAL_SRC_FILES))
ifneq ($(proto_sources),)
ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),micro)