Remove recursive glob in javatests/.
Move the test definition to the correct subpackage.
Bug: 190818041
Test: presubmit
Change-Id: I61bba56a58c83e3ddce146c9cbf0ccce75750ad4
diff --git a/javatests/Android.bp b/javatests/Android.bp
index 5c1607f..9228f97 100644
--- a/javatests/Android.bp
+++ b/javatests/Android.bp
@@ -1,25 +1,19 @@
+//
+// Copyright (C) 2021 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 {
default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-android_test {
- name: "ModulesUtilsTests",
-
- sdk_version: "module_current",
- min_sdk_version: "29",
-
- srcs: ["**/*.java"],
-
- static_libs: [
- "modules-utils-backgroundthread",
- "modules-utils-bytesmatcher",
- "modules-utils-list-slice",
- "modules-utils-shell-command-handler",
- "androidx.test.runner",
- "androidx.test.rules",
- ],
-
- libs: ["android.test.runner"],
-
- test_suites: ["general-tests"],
+ default_visibility: [":__subpackages__"],
}
diff --git a/javatests/AndroidManifest.xml b/javatests/AndroidManifest.xml
deleted file mode 100644
index 8fdfba3..0000000
--- a/javatests/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2020 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.modules.utils.tests">
-
- <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
- android:targetPackage="com.android.modules.utils.tests"
- android:label="Modules-Utils Tests" />
-</manifest>
diff --git a/javatests/com/android/modules/utils/Android.bp b/javatests/com/android/modules/utils/Android.bp
new file mode 100644
index 0000000..d645c1e
--- /dev/null
+++ b/javatests/com/android/modules/utils/Android.bp
@@ -0,0 +1,40 @@
+//
+// Copyright (C) 2021 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 {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_test {
+ name: "ModulesUtilsTests",
+
+ sdk_version: "module_current",
+ min_sdk_version: "29",
+
+ srcs: ["*.java"],
+
+ static_libs: [
+ "modules-utils-backgroundthread",
+ "modules-utils-bytesmatcher",
+ "modules-utils-list-slice",
+ "modules-utils-shell-command-handler",
+ "androidx.test.runner",
+ "androidx.test.rules",
+ ],
+
+ libs: ["android.test.runner"],
+
+ test_suites: ["general-tests"],
+}
diff --git a/javatests/com/android/modules/utils/AndroidManifest.xml b/javatests/com/android/modules/utils/AndroidManifest.xml
new file mode 100644
index 0000000..3fde4fd
--- /dev/null
+++ b/javatests/com/android/modules/utils/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.modules.utils">
+
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.android.modules.utils"/>
+</manifest>