Merge "Revert "Convert external/deqp/android/cts to Android.bp""
diff --git a/Android.mk b/Android.mk
index 2afdfe9..67c1f4e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -65,4 +65,4 @@
 # Build the test APKs using their own makefiles
 # include $(call all-makefiles-under,$(LOCAL_PATH)/android)
 
-include $(LOCAL_PATH)/android/package/Android.mk
+include $(LOCAL_PATH)/android/package/Android.mk $(LOCAL_PATH)/android/cts/Android.mk
diff --git a/android/cts/Android.bp b/android/cts/Android.bp
deleted file mode 100644
index 9f68df4..0000000
--- a/android/cts/Android.bp
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2015 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: "deqp_master_caselists",
-    srcs: [
-        "master/*.txt",
-    ],
-    path: "master",
-}
-
-genrule {
-    name: "deqp_nyc_caselists",
-    srcs: [
-        "nyc/vk-master.txt",
-        "nyc/gles31-master.txt",
-        "nyc/egl-master.txt",
-    ],
-    out: [
-        "nyc-vk-master.txt",
-        "nyc-gles31-master.txt",
-        "nyc-egl-master.txt",
-    ],
-    cmd: "for i in $(in); do cp $$i $(genDir)/nyc-$$(basename $$i); done",
-}
-
-java_test_host {
-    name: "CtsDeqpTestCases",
-
-    // Tag this module as a cts test artifact
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
-
-    srcs: ["runner/src/**/*.java"],
-    libs: [
-        "cts-tradefed",
-        "compatibility-host-util",
-        "tradefed",
-    ],
-
-    data: [
-        ":deqp_master_caselists",
-        ":deqp_nyc_caselists",
-    ],
-}
diff --git a/android/cts/Android.mk b/android/cts/Android.mk
new file mode 100644
index 0000000..762eb2a
--- /dev/null
+++ b/android/cts/Android.mk
@@ -0,0 +1,42 @@
+# Copyright (C) 2015 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 := CtsDeqpTestCases
+
+LOCAL_MODULE_TAGS := optional
+
+# Tag this module as a cts test artifact
+LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+
+LOCAL_SDK_VERSION := 22
+
+LOCAL_SRC_FILES := $(call all-java-files-under, runner/src)
+LOCAL_JAVA_LIBRARIES := cts-tradefed compatibility-host-util tradefed
+
+DEQP_CASELISTS:=$(sort $(patsubst master/%,%, \
+  $(shell cd $(LOCAL_PATH) ; \
+          find -L master -maxdepth 1 -name "*.txt") \
+  ))
+LOCAL_COMPATIBILITY_SUPPORT_FILES := $(foreach file, $(DEQP_CASELISTS), $(LOCAL_PATH)/master/$(file):$(file))
+LOCAL_COMPATIBILITY_SUPPORT_FILES += $(LOCAL_PATH)/nyc/vk-master.txt:nyc-vk-master.txt
+LOCAL_COMPATIBILITY_SUPPORT_FILES += $(LOCAL_PATH)/nyc/gles31-master.txt:nyc-gles31-master.txt
+LOCAL_COMPATIBILITY_SUPPORT_FILES += $(LOCAL_PATH)/nyc/egl-master.txt:nyc-egl-master.txt
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/android/cts/runner/Android.mk b/android/cts/runner/Android.mk
new file mode 100644
index 0000000..cb61b2a
--- /dev/null
+++ b/android/cts/runner/Android.mk
@@ -0,0 +1,20 @@
+# Copyright (C) 2015 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)
+
+# Build all sub-directories
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/android/cts/runner/tests/Android.bp b/android/cts/runner/tests/Android.bp
deleted file mode 100644
index 987cea8..0000000
--- a/android/cts/runner/tests/Android.bp
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2010 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_host {
-    name: "CtsDeqpRunnerTests",
-
-    // Only compile source java files in this lib.
-    srcs: ["src/**/*.java"],
-
-    libs: [
-        "cts-tradefed",
-        "compatibility-host-util",
-        "tradefed",
-        "CtsDeqpTestCases",
-    ],
-    static_libs: ["easymock"],
-}
diff --git a/android/cts/runner/tests/Android.mk b/android/cts/runner/tests/Android.mk
new file mode 100644
index 0000000..81ba834
--- /dev/null
+++ b/android/cts/runner/tests/Android.mk
@@ -0,0 +1,27 @@
+# Copyright (C) 2010 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)
+
+# Only compile source java files in this lib.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE := CtsDeqpRunnerTests
+LOCAL_MODULE_TAGS := optional
+LOCAL_JAVA_LIBRARIES := cts-tradefed compatibility-host-util tradefed CtsDeqpTestCases
+LOCAL_STATIC_JAVA_LIBRARIES := easymock
+
+include $(BUILD_HOST_JAVA_LIBRARY)