Convert build system to soong using Android.bp

* Convert top level Android.mk into build templates in build/Android.bp
  and build/fluoride.go
* Initial conversion is done by "androidmk Android.mk > Android.bp"
* Android.bp does not allow source inclusion from external directories
  and therefore they have to be made in to cc_library_static in their
  respective sub-directories and linked using whole_static_libs in the
  modules where they are used
* As Android.bp does not allow multiple modules of the same name,
  same-name mudules for different target are merged into one definition
  with target specific setup
* Generated proto header path has to be changed in osi/src/metrics.cc as
  Android.bp only generate header path relative to the Android.bp file
  instead of top-level directory such as system/bt
* Android.bp does not support resource copying yet and hence conf files
  are left un-touched.
* Android.bp does support conditional module declaration and therefore
  test-vendor libs are left untouched except for unit tests
* The goal of this CL is to direct (almost) translate Android.mk to
  Android.bp first with Android.bp specific optimizations coming later

Bug: 32958753
Test: Code compilation, manual testing by test team

Change-Id: I5249e1f2135c4121205619b1d735ce448feb7499
diff --git a/btcore/Android.bp b/btcore/Android.bp
new file mode 100644
index 0000000..6e058d2
--- /dev/null
+++ b/btcore/Android.bp
@@ -0,0 +1,60 @@
+// libbtcore static library for target and host
+// ========================================================
+cc_library_static {
+    name: "libbtcore",
+    defaults: ["fluoride_defaults"],
+    local_include_dirs: ["include"],
+    include_dirs: ["system/bt"],
+    srcs: [
+        "src/bdaddr.cc",
+        "src/device_class.cc",
+        "src/hal_util.cc",
+        "src/module.cc",
+        "src/osi_module.cc",
+        "src/property.cc",
+        "src/uuid.cc",
+    ],
+    shared_libs: [
+        "liblog",
+    ],
+    host_supported: true,
+    target: {
+        darwin: {
+            enabled: false,
+        },
+        linux: {
+            cflags: ["-D_GNU_SOURCE"],
+        },
+    },
+}
+
+// Note: It's good to get the tests compiled both for the host and the target so
+// we get to test with both Bionic libc and glibc
+// libbtcore unit tests for target and host
+// ========================================================
+cc_test {
+    name: "net_test_btcore",
+    defaults: ["fluoride_defaults"],
+    local_include_dirs: ["include"],
+    include_dirs: ["system/bt"],
+    srcs: [
+        "test/bdaddr_test.cc",
+        "test/device_class_test.cc",
+        "test/property_test.cc",
+        "test/uuid_test.cc",
+    ],
+    shared_libs: [
+        "liblog",
+    ],
+    static_libs: [
+        "libbtcore",
+        "libosi-AllocationTestHarness",
+        "libosi",
+    ],
+    host_supported: true,
+    target: {
+        darwin: {
+            enabled: false,
+        }
+    }
+}