From afbc2e282694a20e383974cc3b67698a1c8496ff Mon Sep 17 00:00:00 2001 From: s_c_c Date: Thu, 14 Mar 2024 19:26:59 +0800 Subject: [PATCH] Copy bundle.json from hilog instead of distributed-build --- hilog.bundle.json | 38 +++++++++++++++ hilog.spec | 20 +++++++- hilog_native.bundle.json | 75 ++++++++++++++++++++++++++++++ hiviewdfx_hilog_native.bundle.json | 37 +++++++++++++++ libhilog.BUILD.gn | 35 ++++++++++++++ 5 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 hilog.bundle.json create mode 100644 hilog_native.bundle.json create mode 100644 hiviewdfx_hilog_native.bundle.json create mode 100644 libhilog.BUILD.gn diff --git a/hilog.bundle.json b/hilog.bundle.json new file mode 100644 index 0000000..79f638a --- /dev/null +++ b/hilog.bundle.json @@ -0,0 +1,38 @@ +{ + "name": "@ohos/hilog", + "description": "Native log interface provided for system", + "version": "3.1", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "base/hiviewdfx/hilog" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "hilog", + "subsystem": "hiviewdfx", + "syscap": [ + "SystemCapability.HiviewDFX.HiLog" + ], + "adapted_system_type": [ + "standard" + ], + "rom": "188KB", + "ram": "2000KB", + "deps": { + "components": [ + "init", + "utils_base" + ], + "third_party": [ + "bounds_checking_function", + "zlib" + ] + }, + "build": { + "sub_component": [] + } + } + } + \ No newline at end of file diff --git a/hilog.spec b/hilog.spec index 5d70774..f5732be 100644 --- a/hilog.spec +++ b/hilog.spec @@ -2,14 +2,20 @@ %global openHarmony_source_release OpenHarmony-v3.2-Release %global hilog_dir %{_builddir}/base/hiviewdfx %global build_opt /opt/distributed-middleware-build +%global bundle_dir %{build_opt}/openeuler/compiler_gn/base/hiviewdfx/hilog Name: hilog Version: 1.0.0 -Release: 2 +Release: 3 Summary: OpenEuler supports hilog for distributed softbus capability License: Apache License 2.0 Url: https://gitee.com/openharmony/hiviewdfx_hilog Source0: https://gitee.com/openharmony/hiviewdfx_hilog/repository/archive/%{openHarmony_source_release}.tar.gz #/hiviewdfx_hilog-%{openHarmony_source_release}.tar.gz +Source1: libhilog.BUILD.gn +Source2: hiviewdfx_hilog_native.bundle.json +Source3: hilog_native.bundle.json +Source4: hilog.bundle.json + Patch0000: 0001-init-and-adapt-to-openeuler.patch Patch0001: 0002-fix-build-gn-files-config.patch Patch0002: 0003-feat-set-priv-false.patch @@ -58,6 +64,7 @@ install -d %{buildroot}/%{_includedir}/hilog install -d %{buildroot}/%{_includedir}/hilog/hilog install -d %{buildroot}/%{_includedir}/hilog/hilog_base install -d %{buildroot}/%{_libdir} +install -d %{buildroot}/%{bundle_dir}/interfaces/native/innerkits # prepare so install -m 0755 %{_builddir}/out/openeuler/packages/phone/system/lib64/libhilog*.so %{buildroot}/%{_libdir} @@ -75,16 +82,25 @@ install -m 554 %{hilog_dir}/hilog/interfaces/native/innerkits/include/*.h %{bui install -m 554 %{hilog_dir}/hilog/interfaces/native/innerkits/include/hilog/*.h %{buildroot}/%{_includedir}/hilog/hilog install -m 554 %{hilog_dir}/hilog/interfaces/native/innerkits/include/hilog_base/*.h %{buildroot}/%{_includedir}/hilog/hilog_base +# copy bundle.json and BUILD.gn +install -m 554 %{SOURCE1} %{buildroot}/%{bundle_dir}/interfaces/native/innerkits/BUILD.gn +install -m 554 %{SOURCE2} %{buildroot}/%{bundle_dir}/interfaces/native/bundle.json +install -m 554 %{SOURCE3} %{buildroot}/%{bundle_dir}/interfaces/bundle.json +install -m 554 %{SOURCE4} %{buildroot}/%{bundle_dir}/bundle.json + %files %{_includedir}/hilog/* %{_libdir}/*.so %{_libdir}/*.a +%{build_opt}/* %changelog +* Thu Mar 14 2024 s_c_c - 1.0.0-3 +- Copy bundle.json from hilog instead of distributed-build + * Mon Jul 31 2023 Peng He - 1.0.0-2 - Close private print in hilog.cpp file. * Thu Jun 15 2023 tianhang - 1.0.0-1 - Init and adapt to openeuler - diff --git a/hilog_native.bundle.json b/hilog_native.bundle.json new file mode 100644 index 0000000..02bea3f --- /dev/null +++ b/hilog_native.bundle.json @@ -0,0 +1,75 @@ +{ + "name": "@ohos/hilog_native", + "description": "Native log interface provided for system", + "version": "3.1", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "base/hiviewdfx/hilog" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "hilog_native", + "subsystem": "hiviewdfx", + "syscap": [ + "SystemCapability.HiviewDFX.HiLog" + ], + "adapted_system_type": [ + "standard" + ], + "rom": "188KB", + "ram": "2000KB", + "deps": { + "components": [ + "c_utils", + "init", + "napi" + ], + "third_party": [ + "bounds_checking_function", + "zlib" + ] + }, + "features": [ + "hilog_native_feature_ohcore" + ], + "build": { + "group_type": { + "base_group": [ + + ], + "fwk_group": [], + "service_group": [ + "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_base", + "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog" + ] + }, + "inner_kits": [ + { + "name": "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", + "header": { + "header_files": [ + "hilog/log.h", + "hilog/log_c.h", + "hilog/log_cpp.h", + "hilog_trace.h" + ], + "header_base": "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" + } + }, + { + "name": "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_base", + "header": { + "header_files": [ + "hilog_base/log_base.h" + ], + "header_base": "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" + } + } + ], + "test": [] + } + } + } + \ No newline at end of file diff --git a/hiviewdfx_hilog_native.bundle.json b/hiviewdfx_hilog_native.bundle.json new file mode 100644 index 0000000..0ac2412 --- /dev/null +++ b/hiviewdfx_hilog_native.bundle.json @@ -0,0 +1,37 @@ +{ + "name": "@ohos/hiviewdfx_hilog_native", + "description": "Native log interface provided for system", + "version": "3.1", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "base/hiviewdfx/hilog" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "hiviewdfx_hilog_native", + "subsystem": "hiviewdfx", + "syscap": [ + "SystemCapability.HiviewDFX.HiLog" + ], + "adapted_system_type": [ + "standard" + ], + "rom": "188KB", + "ram": "2000KB", + "deps": { + "components": [ + "init", + "utils_base" + ], + "third_party": [ + "bounds_checking_function", + "zlib" + ] + }, + "build": { + "sub_component": [] + } + } + } \ No newline at end of file diff --git a/libhilog.BUILD.gn b/libhilog.BUILD.gn new file mode 100644 index 0000000..776e60a --- /dev/null +++ b/libhilog.BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2021 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") +import("//build/config/sysroot.gni") + +config("libhilog_pub_config") { + include_dirs = [ "${sysroot}/usr/include/hilog" ] + libs = ["hilog.z"] +} + +group("libhilog") { + public_configs = [ ":libhilog_pub_config" ] +} + +config("libhilog_base_pub_cfg") { + include_dirs = [ "${sysroot}/usr/include/hilog" ] +} + +ohos_prebuilt_static_library("libhilog_base") { + source = "${sysroot}/usr/lib64/libhilog_base.a" + public_configs = [ ":libhilog_base_pub_cfg" ] + + part_name = "hilog_native" + subsystem_name = "hiviewdfx" +} -- Gitee