Migrate HelloComputeNDK and libhellocomputendk

To Soong

Fixes: 202519818
Test: Treehugger; result image, command log from the build before
      and after the conversion, and APK comparison
Change-Id: Ied78905cb569fbc5d9f5e1e0b4df80302b1abf9b
diff --git a/tests/java_api/HelloComputeNDK/Android.bp b/tests/java_api/HelloComputeNDK/Android.bp
new file mode 100644
index 0000000..7dd25d6
--- /dev/null
+++ b/tests/java_api/HelloComputeNDK/Android.bp
@@ -0,0 +1,35 @@
+//
+// 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.
+//
+
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: [
+        "Android-Apache-2.0",
+    ],
+}
+
+android_test {
+    name: "HelloComputeNDK",
+
+    srcs: [
+        "src/**/*.java",
+    ],
+
+    sdk_version: "current",
+
+    jni_libs: ["libhellocomputendk"],
+
+}
diff --git a/tests/java_api/HelloComputeNDK/Android.mk b/tests/java_api/HelloComputeNDK/Android.mk
deleted file mode 100644
index 5fe2ffd..0000000
--- a/tests/java_api/HelloComputeNDK/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# 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)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-                   $(call all-renderscript-files-under, src)
-
-LOCAL_CFLAGS := -Werror -Wall -Wextra
-
-LOCAL_PACKAGE_NAME := HelloComputeNDK
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_SDK_VERSION := current
-
-LOCAL_JNI_SHARED_LIBRARIES := libhellocomputendk
-
-include $(BUILD_PACKAGE)
-include $(LOCAL_PATH)/libhellocomputendk/Android.mk
diff --git a/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.bp b/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.bp
new file mode 100644
index 0000000..00679ff
--- /dev/null
+++ b/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.bp
@@ -0,0 +1,45 @@
+// 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.
+
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_test_library {
+   name: "libhellocomputendk",
+
+   srcs: [
+        "helloComputeNDK.cpp",
+        "mono.rscript",
+    ],
+    ldflags: ["-Wl,-Bsymbolic"],
+    header_libs: ["jni_headers"],
+    shared_libs: [
+        "libdl",
+        "liblog",
+        "libjnigraphics",
+    ],
+    static_libs: ["libRScpp_static"],
+
+    sdk_version: "current",
+
+    stl: "c++_static",
+
+}
diff --git a/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk b/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk
deleted file mode 100644
index d0a8d88..0000000
--- a/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_MODULE := libhellocomputendk
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := helloComputeNDK.cpp mono.rscript
-
-LOCAL_CFLAGS := -Wall -Werror
-LOCAL_LDFLAGS := -Wl,-Bsymbolic
-LOCAL_HEADER_LIBRARIES := jni_headers
-LOCAL_SHARED_LIBRARIES := libdl liblog libjnigraphics
-LOCAL_STATIC_LIBRARIES := libRScpp_static
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_NDK_STL_VARIANT := c++_static
-
-include $(BUILD_SHARED_LIBRARY)