summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuntao Xu <yuntaoxu@google.com>2022-02-14 00:45:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-14 00:45:38 +0000
commit3ac7a06462a6e5a838f41dd9268fe1e08090cb8a (patch)
treed660fc5eb0e1a6a1e1405614e5e6451a79155dd3
parentf0515e4a1697df2a4d7b893c75ec8c6a2afb0249 (diff)
parent70f01e220b1694265af45d5004382b0aa34ccbb1 (diff)
downloadrs-3ac7a06462a6e5a838f41dd9268fe1e08090cb8a.tar.gz
Merge "Convert RSTest*/Android.mk to Android.bp" am: 70f01e220b
Original change: https://android-review.googlesource.com/c/platform/frameworks/rs/+/1973762 Change-Id: I623ea71f6e28e911f4223504f446d1d69be01814
-rw-r--r--tests/java_api/RSTestBackward/Android.bp38
-rw-r--r--tests/java_api/RSTestBackward/Android.mk38
-rw-r--r--tests/java_api/RSTest_CompatLib/Android.bp66
-rw-r--r--tests/java_api/RSTest_CompatLib/Android.mk43
-rw-r--r--tests/java_api/RSUnitTests/Android.bp50
-rw-r--r--tests/java_api/RsTest/Android.bp62
-rw-r--r--tests/java_api/RsTest/Android.mk37
7 files changed, 216 insertions, 118 deletions
diff --git a/tests/java_api/RSTestBackward/Android.bp b/tests/java_api/RSTestBackward/Android.bp
new file mode 100644
index 00000000..c962be7b
--- /dev/null
+++ b/tests/java_api/RSTestBackward/Android.bp
@@ -0,0 +1,38 @@
+//
+// Copyright (C) 2017 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: "RSTestBackward",
+ sdk_version: "current",
+ srcs: [
+ "src/**/*.java",
+ ":RSUnitTests_java_srcs",
+ ":RSTest-rscript{RSTest.srcjar}",
+ ],
+ resource_zips: [
+ ":RSTest-rscript{RSTest.res.zip}",
+ ],
+ static_libs: ["androidx.test.rules"],
+ test_suites: ["device-tests"],
+ min_sdk_version: "21",
+}
diff --git a/tests/java_api/RSTestBackward/Android.mk b/tests/java_api/RSTestBackward/Android.mk
deleted file mode 100644
index b3111a65..00000000
--- a/tests/java_api/RSTestBackward/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Copyright (C) 2017 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_PACKAGE_NAME := RSTestBackward
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_SDK_VERSION := current
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- $(call all-java-files-under, src)\
- $(call all-java-files-under, ../RSUnitTests/src)\
- $(call all-renderscript-files-under, ../RSUnitTests/src)\
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-LOCAL_COMPATIBILITY_SUITE := device-tests
-
-LOCAL_RENDERSCRIPT_TARGET_API := current
-LOCAL_MIN_SDK_VERSION := 21
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/tests/java_api/RSTest_CompatLib/Android.bp b/tests/java_api/RSTest_CompatLib/Android.bp
new file mode 100644
index 00000000..74dc9660
--- /dev/null
+++ b/tests/java_api/RSTest_CompatLib/Android.bp
@@ -0,0 +1,66 @@
+//
+// Copyright (C) 2017 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: "RSTest_Compat",
+ sdk_version: "current",
+ srcs: [
+ "src/**/*.java",
+ ":RSUnitTests_java_gui",
+ ":RSUnitTests_java_supportlibsrc_gen",
+ ":RSTest_Compat-rscript{RSTest_Compat.srcjar}",
+ ],
+ resource_zips: [
+ ":RSTest_Compat-rscript{RSTest_Compat.res.zip}",
+ ],
+ static_libs: [
+ "androidx.test.rules",
+ "android-support-v8-renderscript",
+ ],
+ min_sdk_version: "8",
+}
+
+genrule {
+ name: "RSTest_Compat-rscript",
+ srcs: [
+ ":RSUnitTests_rscript_supportlibsrc_gen",
+ ":rs_script_api",
+ ":rs_clang_headers",
+ ],
+ tools: [
+ "llvm-rs-cc",
+ "soong_zip",
+ ],
+ out: [
+ "RSTest_Compat.srcjar",
+ "RSTest_Compat.res.zip",
+ ],
+ cmd: "for f in $(locations :RSUnitTests_rscript_supportlibsrc_gen); do " +
+ " $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
+ " -rs-package-name=androidx.renderscript " +
+ " -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
+ " -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
+ "done && " +
+ "$(location soong_zip) -srcjar -o $(location RSTest_Compat.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
+ "$(location soong_zip) -o $(location RSTest_Compat.res.zip) -C $(genDir)/res -D $(genDir)/res",
+}
diff --git a/tests/java_api/RSTest_CompatLib/Android.mk b/tests/java_api/RSTest_CompatLib/Android.mk
deleted file mode 100644
index 2df8904f..00000000
--- a/tests/java_api/RSTest_CompatLib/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2017 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_PACKAGE_NAME := RSTest_Compat
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_SDK_VERSION := current
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- $(call all-java-files-under,src) \
- $(call all-java-files-under,../RSUnitTests/gui) \
- $(call all-java-files-under,../RSUnitTests/supportlibsrc_gen) \
- $(call all-renderscript-files-under,../RSUnitTests/supportlibsrc_gen) \
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- androidx.test.rules \
- android-support-v8-renderscript \
-
-LOCAL_RENDERSCRIPT_TARGET_API := current
-LOCAL_RENDERSCRIPT_COMPATIBILITY := true
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 8
-
-LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=androidx.renderscript
-
-include $(BUILD_PACKAGE)
diff --git a/tests/java_api/RSUnitTests/Android.bp b/tests/java_api/RSUnitTests/Android.bp
new file mode 100644
index 00000000..a661df10
--- /dev/null
+++ b/tests/java_api/RSUnitTests/Android.bp
@@ -0,0 +1,50 @@
+//
+// Copyright (C) 2008 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.
+//
+
+filegroup {
+ name: "RSUnitTests_java_srcs",
+ srcs: [
+ "src/**/*.java",
+ ],
+}
+
+filegroup {
+ name: "RSUnitTests_rscript_srcs",
+ srcs: [
+ "src/**/*.rscript",
+ ],
+}
+
+filegroup {
+ name: "RSUnitTests_java_gui",
+ srcs: [
+ "gui/**/*.java",
+ ],
+}
+
+filegroup {
+ name: "RSUnitTests_java_supportlibsrc_gen",
+ srcs: [
+ "supportlibsrc_gen/**/*.java",
+ ],
+}
+
+filegroup {
+ name: "RSUnitTests_rscript_supportlibsrc_gen",
+ srcs: [
+ "supportlibsrc_gen/**/*.rscript",
+ ],
+}
diff --git a/tests/java_api/RsTest/Android.bp b/tests/java_api/RsTest/Android.bp
new file mode 100644
index 00000000..36952348
--- /dev/null
+++ b/tests/java_api/RsTest/Android.bp
@@ -0,0 +1,62 @@
+//
+// Copyright (C) 2008 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: "RSTest",
+ static_libs: ["androidx.test.rules"],
+ srcs: [
+ "src/**/*.java",
+ ":RSUnitTests_java_srcs",
+ ":RSUnitTests_java_gui",
+ ":RSTest-rscript{RSTest.srcjar}",
+ ],
+ resource_zips: [
+ ":RSTest-rscript{RSTest.res.zip}",
+ ],
+ sdk_version: "current",
+ test_suites: ["device-tests"],
+}
+
+genrule {
+ name: "RSTest-rscript",
+ srcs: [
+ ":RSUnitTests_rscript_srcs",
+ ":rs_script_api",
+ ":rs_clang_headers",
+ ],
+ tools: [
+ "llvm-rs-cc",
+ "soong_zip",
+ ],
+ out: [
+ "RSTest.srcjar",
+ "RSTest.res.zip",
+ ],
+ cmd: "for f in $(locations :RSUnitTests_rscript_srcs); do " +
+ " $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
+ " -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
+ " -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
+ "done && " +
+ "$(location soong_zip) -srcjar -o $(location RSTest.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
+ "$(location soong_zip) -o $(location RSTest.res.zip) -C $(genDir)/res -D $(genDir)/res",
+}
diff --git a/tests/java_api/RsTest/Android.mk b/tests/java_api/RsTest/Android.mk
deleted file mode 100644
index 4f231b5f..00000000
--- a/tests/java_api/RsTest/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Copyright (C) 2008 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_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_SRC_FILES := \
- $(call all-java-files-under,src) \
- $(call all-java-files-under,../RSUnitTests/gui) \
- $(call all-java-files-under,../RSUnitTests/src) \
- $(call all-renderscript-files-under,../RSUnitTests/src) \
-
-LOCAL_RENDERSCRIPT_TARGET_API := current
-
-LOCAL_PACKAGE_NAME := RSTest
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_SDK_VERSION := current
-LOCAL_COMPATIBILITY_SUITE := device-tests
-
-include $(BUILD_PACKAGE)