From c3dff0469668eb1589203ca1275aac86268f21ad Mon Sep 17 00:00:00 2001
From: zxstty <zhaojiaqi18@huawei.com>
Date: Wed, 8 Nov 2023 18:22:52 +0800
Subject: [PATCH] 0019

---
 .../device_manager/BUILD.gn                   | 17 ++++
 .../device_manager/bundle.json                | 80 +++++++++++++++++++
 .../interfaces/inner_kits/native_cpp/BUILD.gn | 39 +++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn
 create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json
 create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn

diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn
new file mode 100644
index 0000000..df46546
--- /dev/null
+++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn
@@ -0,0 +1,17 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# 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.
+group("device_manager_fwk") {
+  deps = [
+    "interfaces/inner_kits/native_cpp:devicemanagersdk",
+  ]
+}
diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json
new file mode 100644
index 0000000..51c3d9a
--- /dev/null
+++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json
@@ -0,0 +1,80 @@
+{
+    "name": "@ohos/device_manager",
+    "description": "device manager service",
+    "version": "3.1",
+    "license": "Apache License 2.0",
+    "repository": "https://gitee.com/openharmony/device_manager",
+    "publishAs": "code-segment",
+    "segment": {
+        "destPath": "foundation/distributedhardware/device_manager"
+    },
+    "dirs": {},
+    "scripts": {},
+    "component": {
+        "name": "device_manager",
+        "subsystem": "distributedhardware",
+        "syscap":[ "SystemCapability.DistributedHardware.DeviceManager" ],
+        "features":["device_manager_no_interaction_auth"],
+        "adapted_system_type": [ "standard", "small" ],
+        "rom": "2M",
+        "ram": "16M",
+        "hisysevent_config": [
+            "//foundation/distributedhardware/device_manager/hisysevent.yaml"
+          ],
+        "deps": {
+            "components": [
+                "ability_base",
+                "ability_runtime",
+                "access_token",
+                "appexecfwk_standard",
+                "bundle_framework",
+                "c_utils",
+                "common_event_service",
+                "device_auth",
+                "dsoftbus",
+                "hisysevent_native",
+                "hitrace_native",
+                "hiviewdfx_hilog_native",
+                "init",
+                "ipc",
+                "napi",
+                "os_account",
+                "safwk",
+                "samgr",
+                "startup_l2"
+            ],
+            "third_party": [
+                "json",
+                "node",
+                "googletest",
+                "mbedtls"
+            ]
+        },
+        "build": {
+            "group_type": {
+                "base_group": [],
+                "fwk_group": [
+                    "//foundation/distributedhardware/device_manager:device_manager_fwk"
+                ],
+                "service_group": []
+            },
+            "inner_kits": [
+                {
+                "type": "so",
+                "name": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk",
+                "header": {
+                    "header_files": [
+                        "device_manager.h",
+                        "device_manager_callback.h",
+                        "dm_device_info.h",
+                        "dm_publish_info.h",
+                        "dm_subscribe_info.h"
+                    ],
+                    "header_base": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include"
+                }
+                }
+            ],
+            "test": []
+        }
+    }
+}
diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn
new file mode 100644
index 0000000..78c60d7
--- /dev/null
+++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn
@@ -0,0 +1,39 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# 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.
+import("//build/ohos.gni")
+
+exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/device_manager", "--dest_target", 
+            rebase_path("//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include") ], "string")
+
+config("devicemanagersdk_config") {
+    include_dirs = [
+      "include",
+      "include/ipc",
+      "include/ipc/standard",
+      "include/notify",
+      "include/common/include",
+      "include/common/include/ipc",
+      "include/common/include/ipc/model",
+      "include/common/include/ipc/standard",
+      "include/common/include/dfx",
+      "include/common/include/dfx/standard",
+    ]
+}
+
+ohos_prebuilt_shared_library("devicemanagersdk") {
+    source = "/usr/lib64/libdevicemanagersdk.z.so"
+    public_configs = [ ":devicemanagersdk_config" ]
+
+    subsystem_name = "distributedhardware"
+    part_name = "device_manager"
+}
-- 
2.33.0

