Merge "Convert frameworks/ex/camera2 to Android.bp"
diff --git a/camera2/Android.mk b/camera2/Android.mk
deleted file mode 100644
index 3719578..0000000
--- a/camera2/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 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.
-
-# Build all subprojects
-include $(call all-subdir-makefiles)
diff --git a/camera2/portability/Android.bp b/camera2/portability/Android.bp
new file mode 100644
index 0000000..fa7bc05
--- /dev/null
+++ b/camera2/portability/Android.bp
@@ -0,0 +1,20 @@
+// Copyright 2014 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_library {
+    name: "android-ex-camera2-portability",
+    sdk_version: "current",
+    srcs: ["src/**/*.java"],
+    static_libs: ["android-ex-camera2-utils"],
+}
diff --git a/camera2/portability/Android.mk b/camera2/portability/Android.mk
deleted file mode 100644
index 95b6448..0000000
--- a/camera2/portability/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2014 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 $(LOCAL_PATH)/portability.mk \
-        $(call all-subdir-makefiles)
diff --git a/camera2/portability/portability.mk b/camera2/portability/portability.mk
deleted file mode 100644
index 2ecc1df..0000000
--- a/camera2/portability/portability.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 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 := android-ex-camera2-portability
-LOCAL_MODULE_TAGS := optional
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2-utils
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/camera2/portability/tests/Android.bp b/camera2/portability/tests/Android.bp
new file mode 100644
index 0000000..66bebb4
--- /dev/null
+++ b/camera2/portability/tests/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "android-ex-camera2-portability-tests",
+    sdk_version: "current",
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "android-ex-camera2-portability",
+        "android-ex-camera2-utils",
+        "android-ex-camera2-utils-tests",
+        "android-support-test",
+        "mockito-target-minus-junit4",
+    ],
+}
diff --git a/camera2/portability/tests/Android.mk b/camera2/portability/tests/Android.mk
deleted file mode 100644
index 23f39e6..0000000
--- a/camera2/portability/tests/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2014 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 := android-ex-camera2-portability-tests
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := $(call all-java-files-under,src) $(call all-java-files-under,../../utils/tests)
-LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2-portability android-ex-camera2-utils \
-                               android-support-test mockito-target-minus-junit4
-
-include $(BUILD_PACKAGE)
diff --git a/camera2/public/Android.bp b/camera2/public/Android.bp
new file mode 100644
index 0000000..80d723b
--- /dev/null
+++ b/camera2/public/Android.bp
@@ -0,0 +1,19 @@
+// Copyright 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.
+
+java_library {
+    name: "android-ex-camera2",
+    sdk_version: "current",
+    srcs: ["src/**/*.java"],
+}
diff --git a/camera2/public/Android.mk b/camera2/public/Android.mk
deleted file mode 100644
index a0d1489..0000000
--- a/camera2/public/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 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 := optional
-LOCAL_MODULE := android-ex-camera2
-LOCAL_SDK_VERSION := current
-
-LOCAL_SRC_FILES := \
-     $(call all-java-files-under, src)
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/camera2/utils/Android.bp b/camera2/utils/Android.bp
new file mode 100644
index 0000000..85ef75c
--- /dev/null
+++ b/camera2/utils/Android.bp
@@ -0,0 +1,19 @@
+// Copyright 2014 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_library {
+    name: "android-ex-camera2-utils",
+    sdk_version: "current",
+    srcs: ["src/**/*.java"],
+}
diff --git a/camera2/utils/Android.mk b/camera2/utils/Android.mk
deleted file mode 100644
index 36595e1..0000000
--- a/camera2/utils/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2014 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 $(LOCAL_PATH)/utils.mk \
-        $(call all-subdir-makefiles)
diff --git a/camera2/utils/tests/Android.bp b/camera2/utils/tests/Android.bp
new file mode 100644
index 0000000..ab72781
--- /dev/null
+++ b/camera2/utils/tests/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "android-ex-camera2-utils-tests",
+    sdk_version: "current",
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "android-ex-camera2-utils",
+        "android-support-test",
+        "mockito-target-minus-junit4",
+    ],
+}
diff --git a/camera2/utils/tests/Android.mk b/camera2/utils/tests/Android.mk
deleted file mode 100644
index 6e81ec3..0000000
--- a/camera2/utils/tests/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2014 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 := android-ex-camera2-utils-tests
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2-utils android-support-test mockito-target-minus-junit4
-
-include $(BUILD_PACKAGE)
diff --git a/camera2/utils/utils.mk b/camera2/utils/utils.mk
deleted file mode 100644
index a193582..0000000
--- a/camera2/utils/utils.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2014 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 := android-ex-camera2-utils
-LOCAL_MODULE_TAGS := optional
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-include $(BUILD_STATIC_JAVA_LIBRARY)