OSDN Git Service

Convert to Android.bp
authorDan Willemsen <dwillemsen@google.com>
Thu, 22 Sep 2016 23:05:13 +0000 (16:05 -0700)
committerDan Willemsen <dwillemsen@google.com>
Mon, 3 Oct 2016 23:52:54 +0000 (16:52 -0700)
See build/soong/README.md for more information.

Test: mma -j
Test: camera_metadata_test on flounder
Change-Id: I0f699a2a0d120783a5f543cf6d454109a5fc624b

12 files changed:
alsa_utils/Android.bp [new file with mode: 0644]
alsa_utils/Android.mk [deleted file]
audio_route/Android.bp [new file with mode: 0644]
audio_route/Android.mk [deleted file]
camera/Android.bp [new file with mode: 0644]
camera/src/Android.mk [deleted file]
camera/tests/Android.bp [new file with mode: 0644]
camera/tests/Android.mk [deleted file]
radio/Android.bp [new file with mode: 0644]
radio/src/Android.mk [deleted file]
radio/src/radio_metadata.c
radio/src/radio_metadata_hidden.h [moved from private/radio/include/radio_metadata_hidden.h with 100% similarity]

diff --git a/alsa_utils/Android.bp b/alsa_utils/Android.bp
new file mode 100644 (file)
index 0000000..4746af6
--- /dev/null
@@ -0,0 +1,35 @@
+// 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.
+
+cc_library_shared {
+    name: "libalsautils",
+    srcs: [
+        "alsa_device_profile.c",
+        "alsa_device_proxy.c",
+        "alsa_logging.c",
+        "alsa_format.c",
+    ],
+    export_include_dirs: ["include"],
+    shared_libs: [
+        "liblog",
+        "libcutils",
+        "libtinyalsa",
+        "libaudioutils",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-Wno-unused-parameter",
+    ],
+}
diff --git a/alsa_utils/Android.mk b/alsa_utils/Android.mk
deleted file mode 100644 (file)
index 9b7f5dd..0000000
+++ /dev/null
@@ -1,34 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libalsautils
-LOCAL_SRC_FILES := \
-       alsa_device_profile.c \
-       alsa_device_proxy.c \
-       alsa_logging.c \
-       alsa_format.c
-LOCAL_C_INCLUDES += \
-       external/tinyalsa/include
-LOCAL_EXPORT_C_INCLUDE_DIRS := system/media/alsa_utils/include
-LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libaudioutils
-LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -Wno-unused-parameter
-
-include $(BUILD_SHARED_LIBRARY)
-
diff --git a/audio_route/Android.bp b/audio_route/Android.bp
new file mode 100644 (file)
index 0000000..a3f19e4
--- /dev/null
@@ -0,0 +1,15 @@
+cc_library_shared {
+    name: "libaudioroute",
+    srcs: ["audio_route.c"],
+    shared_libs: [
+        "liblog",
+        "libcutils",
+        "libutils",
+        "libexpat",
+        "libtinyalsa",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wall",
+    ],
+}
diff --git a/audio_route/Android.mk b/audio_route/Android.mk
deleted file mode 100644 (file)
index c32b88d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_C_INCLUDES += \
-       external/tinyalsa/include \
-       external/expat/lib
-LOCAL_SRC_FILES:= audio_route.c
-LOCAL_MODULE := libaudioroute
-LOCAL_SHARED_LIBRARIES:= liblog libcutils libutils libexpat libtinyalsa
-LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := -Werror -Wall
-include $(BUILD_SHARED_LIBRARY)
diff --git a/camera/Android.bp b/camera/Android.bp
new file mode 100644 (file)
index 0000000..c020b2e
--- /dev/null
@@ -0,0 +1,33 @@
+subdirs = ["tests"]
+
+cc_library_shared {
+    name: "libcamera_metadata",
+    srcs: ["src/camera_metadata.c"],
+
+    include_dirs: ["system/media/private/camera/include"],
+    local_include_dirs: ["include"],
+    export_include_dirs: ["include"],
+
+    shared_libs: [
+        "libcutils",
+        "liblog",
+    ],
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-std=c99",
+    ],
+
+    product_variables: {
+        debuggable: {
+            // Enable assert()
+            cflags: [
+                "-UNDEBUG",
+                "-DLOG_NDEBUG=1",
+            ],
+        },
+    },
+}
diff --git a/camera/src/Android.mk b/camera/src/Android.mk
deleted file mode 100644 (file)
index 395089a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-       camera_metadata.c
-
-LOCAL_C_INCLUDES:= \
-       system/media/camera/include \
-       system/media/private/camera/include
-
-LOCAL_SHARED_LIBRARIES := \
-       libcutils \
-       liblog
-
-LOCAL_MODULE := libcamera_metadata
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS += \
-       -Wall \
-       -Wextra \
-       -Werror \
-       -fvisibility=hidden \
-       -std=c99
-
-ifneq ($(filter userdebug eng,$(TARGET_BUILD_VARIANT)),)
-    # Enable assert()
-    LOCAL_CFLAGS += -UNDEBUG -DLOG_NDEBUG=1
-endif
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/camera/tests/Android.bp b/camera/tests/Android.bp
new file mode 100644 (file)
index 0000000..e4d78c1
--- /dev/null
@@ -0,0 +1,27 @@
+// Build the unit tests.
+cc_test {
+    name: "camera_metadata_tests",
+    srcs: ["camera_metadata_tests.cpp"],
+
+    shared_libs: [
+        "libutils",
+        "libcamera_metadata",
+    ],
+
+    include_dirs: ["system/media/private/camera/include"],
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+
+    multilib: {
+        lib32: {
+            stem: "camera_metadata_tests",
+        },
+        lib64: {
+            stem: "camera_metadata_tests64",
+        },
+    },
+}
diff --git a/camera/tests/Android.mk b/camera/tests/Android.mk
deleted file mode 100644 (file)
index c50d89a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_SHARED_LIBRARIES := \
-       libutils \
-       libcamera_metadata
-
-LOCAL_C_INCLUDES := \
-       system/media/camera/include \
-       system/media/private/camera/include
-
-LOCAL_SRC_FILES := \
-       camera_metadata_tests.cpp
-
-LOCAL_CFLAGS += -Wall -Wextra -Werror
-
-LOCAL_MODULE := camera_metadata_tests
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_STEM_32 := camera_metadata_tests
-LOCAL_MODULE_STEM_64 := camera_metadata_tests64
-LOCAL_MULTILIB := both
-
-include $(BUILD_NATIVE_TEST)
diff --git a/radio/Android.bp b/radio/Android.bp
new file mode 100644 (file)
index 0000000..2b7a053
--- /dev/null
@@ -0,0 +1,19 @@
+cc_library_shared {
+    name: "libradio_metadata",
+
+    srcs: ["src/radio_metadata.c"],
+
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-fvisibility=hidden",
+    ],
+
+    local_include_dirs: ["include"],
+    export_include_dirs: ["include"],
+
+    shared_libs: [
+        "libcutils",
+        "liblog",
+    ],
+}
diff --git a/radio/src/Android.mk b/radio/src/Android.mk
deleted file mode 100644 (file)
index 01787ec..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-       radio_metadata.c
-
-LOCAL_C_INCLUDES:= \
-       system/media/radio/include \
-       system/media/private/radio/include
-
-LOCAL_SHARED_LIBRARIES := \
-       libcutils \
-       liblog
-
-LOCAL_MODULE := libradio_metadata
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -fvisibility=hidden
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include
-
-include $(BUILD_SHARED_LIBRARY)
index 4cf03e8..4f4dee0 100644 (file)
 #include <limits.h>
 #include <system/radio.h>
 #include <system/radio_metadata.h>
-#include <radio_metadata_hidden.h>
 #include <cutils/log.h>
 
+#include "radio_metadata_hidden.h"
+
 const radio_metadata_type_t metadata_key_type_table[] =
 {
     RADIO_METADATA_TYPE_TEXT,