Convert benchmarks/Android.mk to .bp

This could not be converted because it built the target into a specific
location (/data/caliperperf) that a test depended on and which soong
does not support. However, that test appears to be unowned and broken
and converting will not make the issue worse.

Also, removed the Android.mk file as that was only there to include the
benchmarks/Android.mk file.

Bug: 130204596
Bug: 122333008
Test: vogar --benchmark --classpath out/target/common/obj/JAVA_LIBRARIES/benchmarks_intermediates/classes.jar benchmarks.AdditionBenchmark
Change-Id: I8f4c6963c2f0cab6eb044083f75c887bfc796dfc
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 8581d33..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- mode: makefile -*-
-# Copyright (C) 2009 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-#
-# Subprojects with separate makefiles
-#
-
-subdirs := benchmarks
-subdir_makefiles := $(call all-named-subdir-makefiles,$(subdirs))
-
-#
-# Disable benchmarks module if LIBCORE_SKIP_TESTS environment variable is set.
-#
-
-ifneq ($(LIBCORE_SKIP_TESTS),)
-$(info ********************************************************************************)
-$(info * libcore tests are skipped because environment variable LIBCORE_SKIP_TESTS=$(LIBCORE_SKIP_TESTS))
-$(info ********************************************************************************)
-endif
-
-include $(subdir_makefiles)
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 5808d1d..e7e2d2d 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -202,6 +202,7 @@
     visibility: [
         "//art/build/apex",
         "//external/wycheproof",
+        "//libcore/benchmarks",
     ],
     defaults: ["libcore_java_defaults"],
     installable: true,
@@ -247,6 +248,7 @@
         "//art/build/apex",
         "//external/robolectric-shadows",
         "//external/wycheproof",
+        "//libcore/benchmarks",
     ],
     defaults: ["libcore_java_defaults"],
     installable: true,
diff --git a/benchmarks/Android.bp b/benchmarks/Android.bp
new file mode 100644
index 0000000..6ae41a4
--- /dev/null
+++ b/benchmarks/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_test {
+    name: "benchmarks",
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "mockwebserver",
+        "core-tests-support",
+    ],
+    no_standard_libs: true,
+    system_modules: "none",
+    libs: [
+        "caliper-api-target",
+        "core-oj",
+        "core-libart",
+        "android.test.base",
+    ],
+}
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
deleted file mode 100644
index 623ba9c..0000000
--- a/benchmarks/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- mode: makefile -*-
-# Copyright (C) 2013 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-
-ifeq ($(LIBCORE_SKIP_TESTS),)
-
-##################################################
-include $(CLEAR_VARS)
-LOCAL_MODULE := benchmarks
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := mockwebserver core-tests-support
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := \
-  caliper-api-target \
-  core-oj \
-  core-libart \
-  android.test.base
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/data/caliperperf
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-include $(BUILD_JAVA_LIBRARY)
-
-endif