Depend on asm in m2 directory

That version is updated to 6.0, which is required by jacoco 0.8.0.
Also update Robolectric makefiles to include inclnolocationclasses
parameter when using Jacoco's agent as that's required for
Robolectric.

Test: make -j RunCarSetupWizardLibRoboTests-jacoco dist
Bug: 71705927
Change-Id: Ifc1417e1627aa0ac90fe02a98a2ab88a15a7fcb7
diff --git a/common/jacoco/Android.mk b/common/jacoco/Android.mk
index a39886d..d94ead3 100644
--- a/common/jacoco/Android.mk
+++ b/common/jacoco/Android.mk
@@ -8,9 +8,13 @@
     $(call all-java-files-under, src/main/java) \
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
+        asm-analysis-prebuilt-host-jar \
+        asm-commons-prebuilt-host-jar \
+        asm-prebuilt-host-jar \
+        asm-tree-prebuilt-host-jar \
+        asm-util-prebuilt-host-jar \
         jvm-jacoco-core \
         jvm-jacoco-report \
-        jvm-jacoco-asm \
         commons-cli-1.2
 
 LOCAL_MODULE := jvm-jacoco-reporter
@@ -21,7 +25,6 @@
 
 LOCAL_PREBUILT_JAVA_LIBRARIES := \
         jvm-jacoco-agent:lib/jacocoagent.jar \
-        jvm-jacoco-asm:lib/asm-debug-all-5.0.1.jar \
         jvm-jacoco-core:lib/org.jacoco.core-$(my_jacoco_version).jar \
         jvm-jacoco-report:lib/org.jacoco.report-$(my_jacoco_version).jar
 
diff --git a/common/jacoco/lib/asm-debug-all-5.0.1.jar b/common/jacoco/lib/asm-debug-all-5.0.1.jar
deleted file mode 100644
index 76d4b6a..0000000
--- a/common/jacoco/lib/asm-debug-all-5.0.1.jar
+++ /dev/null
Binary files differ
diff --git a/common/robolectric/3.5.1/run_robotests.mk b/common/robolectric/3.5.1/run_robotests.mk
index df81a30..8076f6f 100644
--- a/common/robolectric/3.5.1/run_robotests.mk
+++ b/common/robolectric/3.5.1/run_robotests.mk
@@ -160,15 +160,28 @@
 
 # List of packages to exclude jacoco from running
 my_jacoco_excludes := \
-    org.robolectric.*:org.mockito.*:org.junit.*:org.objectweb.*:com.thoughtworks.xstream.*
+    org.robolectric.* \
+    org.mockito.* \
+    org.junit.* \
+    org.objectweb.* \
+    com.thoughtworks.xstream.*
 # The Jacoco agent JAR.
 my_jacoco_agent_jar := $(call java-lib-files,jvm-jacoco-agent,true)
+# Using Jacoco with Robolectric is broken in 0.7.3 <= version < 0.7.6.
+# In 0.7.6 or above, the parameter "inclnolocationclasses" is needed.
+# See https://github.com/jacoco/jacoco/pull/288 for more
+my_jacoco_agent_args = \
+    destfile=$(my_coverage_file) \
+    excludes=$(call normalize-path-list, $(my_jacoco_excludes)) \
+    inclnolocationclasses=true \
+    append=false
 my_java_args := \
-    -javaagent:$(my_jacoco_agent_jar)=destfile=$(my_coverage_file),excludes=$(my_jacoco_excludes)
+    -javaagent:$(my_jacoco_agent_jar)=$(call normalize-comma-list, $(my_jacoco_agent_args))
 include $(my_robolectric_script_path)/robotest-internal.mk
 # Clear temporary variables
 my_failure_fatal :=
 my_jacoco_agent_jar :=
+my_jacoco_agent_args :=
 my_jacoco_excludes :=
 my_java_args :=
 my_robolectric_jars :=
diff --git a/common/robolectric/3.6.1/run_robotests.mk b/common/robolectric/3.6.1/run_robotests.mk
index df81a30..8076f6f 100644
--- a/common/robolectric/3.6.1/run_robotests.mk
+++ b/common/robolectric/3.6.1/run_robotests.mk
@@ -160,15 +160,28 @@
 
 # List of packages to exclude jacoco from running
 my_jacoco_excludes := \
-    org.robolectric.*:org.mockito.*:org.junit.*:org.objectweb.*:com.thoughtworks.xstream.*
+    org.robolectric.* \
+    org.mockito.* \
+    org.junit.* \
+    org.objectweb.* \
+    com.thoughtworks.xstream.*
 # The Jacoco agent JAR.
 my_jacoco_agent_jar := $(call java-lib-files,jvm-jacoco-agent,true)
+# Using Jacoco with Robolectric is broken in 0.7.3 <= version < 0.7.6.
+# In 0.7.6 or above, the parameter "inclnolocationclasses" is needed.
+# See https://github.com/jacoco/jacoco/pull/288 for more
+my_jacoco_agent_args = \
+    destfile=$(my_coverage_file) \
+    excludes=$(call normalize-path-list, $(my_jacoco_excludes)) \
+    inclnolocationclasses=true \
+    append=false
 my_java_args := \
-    -javaagent:$(my_jacoco_agent_jar)=destfile=$(my_coverage_file),excludes=$(my_jacoco_excludes)
+    -javaagent:$(my_jacoco_agent_jar)=$(call normalize-comma-list, $(my_jacoco_agent_args))
 include $(my_robolectric_script_path)/robotest-internal.mk
 # Clear temporary variables
 my_failure_fatal :=
 my_jacoco_agent_jar :=
+my_jacoco_agent_args :=
 my_jacoco_excludes :=
 my_java_args :=
 my_robolectric_jars :=