Move the logic to add jacocoagent in instrumentation builds to make.

This to allow operating on the complete ART_APEX_JARS list from make in
a follow-up CL.

Test: m nothing
Test: m nothing EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true
Bug: 180325915
Change-Id: Ic08148edf25738f6f4769e5359a573237a38b0e9
diff --git a/core/envsetup.mk b/core/envsetup.mk
index a5571ae..33f4f25 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -301,6 +301,10 @@
     com.android.art:okhttp \
     com.android.art:bouncycastle \
     com.android.art:apache-xml
+# With EMMA_INSTRUMENT_FRAMEWORK=true the Core libraries depend on jacoco.
+ifeq (true,$(EMMA_INSTRUMENT_FRAMEWORK))
+  ART_APEX_JARS += com.android.art:jacocoagent
+endif
 #################################################################
 
 # Read the product specs so we can get TARGET_DEVICE and other