From 11d2d8155b2b70dd99db790d4585e0fe8a45e79e Mon Sep 17 00:00:00 2001 From: huangminzhong Date: Tue, 20 Sep 2022 18:41:22 -0700 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=BA=93=E6=A8=A1=E6=9D=BF=E5=8F=8A=E6=9B=B4=E6=96=B0=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangminzhong --- README_zh.md | 30 ++++++++++------- thirdparty_template/BUILD.gn | 12 +++++++ thirdparty_template/CMakeLists.txt | 13 ++++++++ thirdparty_template/README.OpenSource | 0 thirdparty_template/README_zh.md | 21 ++++++++++++ thirdparty_template/adapted/config.h | 13 ++++++++ thirdparty_template/docs/rom_integrate.md | 39 +++++++++++++++++++++++ thirdparty_template/ohos.build | 9 ++++++ 8 files changed, 125 insertions(+), 12 deletions(-) create mode 100755 thirdparty_template/BUILD.gn create mode 100755 thirdparty_template/CMakeLists.txt create mode 100755 thirdparty_template/README.OpenSource create mode 100755 thirdparty_template/README_zh.md create mode 100755 thirdparty_template/adapted/config.h create mode 100755 thirdparty_template/docs/rom_integrate.md create mode 100755 thirdparty_template/ohos.build diff --git a/README_zh.md b/README_zh.md index 19029ab5..192da1ee 100755 --- a/README_zh.md +++ b/README_zh.md @@ -9,18 +9,23 @@ ``` tpc_c_cplusplus -├── README_zh.md -├── common #通用说明文档的文件夹 -├── 三方库1 -│ ├──gn #gn构建脚本、适配指导的文件夹 -│ ├──cmake #cmake构建脚本、适配指导的文件夹 -│ ├──README_zh.md -│ ├──README.OpenSource #文件中包含了三方库源码的下载地址,版本,license等信息 -├── 三方库2 -│ ├──gn #gn构建脚本、适配指导的文件夹 -│ ├──cmake #cmake构建脚本、适配指导的文件夹 -│ ├──README_zh.md -│ ├──README.OpenSource #文件中包含了三方库源码的下载地址,版本,license等信息 +├── README_zh.md #仓库主页 +├── common #仓库通用说明文档的文件夹 +├── thirdparty_template #三方库模板文件夹 +│ ├──README_zh.md #三方库简介 +│ ├──README.OpenSource #说明三方库源码的下载地址,版本,license等信息 +│ ├──ohos.build #三方库组件定义文件 +│ ├──CMakeLists.txt #构建脚本,支持hap包集成 +│ ├──BUILD.gn #构建脚本,支持rom包集成 +│ ├──adapted #该目录存放三方库适配需要的代码文件 +│ │ ├──config.h #例如配置文件 +│ │ ├──... #其他适配文件 +│ ├──docs #存放三方库相关文档的文件夹 +│ │ ├──rom_integrate.md #rom集成说明文档 +│ │ ├──hap_integrate.md #hap集成说明文档 +│ │ ├── ... #其他说明文档 +├── thirdparty1 #三方库文件夹,内容和thirdparty_template模板的格式一样 +├── thirdparty2 #三方库文件夹,内容和thirdparty_template模板的格式一样 ...... ``` @@ -30,6 +35,7 @@ tpc_c_cplusplus - [遵守仓库目录结构](#本仓库目录) - [遵守OpenHarmony编码贡献规范](https://gitee.com/openharmony-sig/knowledge_demo_smart_home/blob/master/dev/docs/contribute/README.md) +- [三方库模板目录](thirdparty_template) diff --git a/thirdparty_template/BUILD.gn b/thirdparty_template/BUILD.gn new file mode 100755 index 00000000..e4f7cd10 --- /dev/null +++ b/thirdparty_template/BUILD.gn @@ -0,0 +1,12 @@ +# 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. \ No newline at end of file diff --git a/thirdparty_template/CMakeLists.txt b/thirdparty_template/CMakeLists.txt new file mode 100755 index 00000000..7ce9dbce --- /dev/null +++ b/thirdparty_template/CMakeLists.txt @@ -0,0 +1,13 @@ +# 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. + diff --git a/thirdparty_template/README.OpenSource b/thirdparty_template/README.OpenSource new file mode 100755 index 00000000..e69de29b diff --git a/thirdparty_template/README_zh.md b/thirdparty_template/README_zh.md new file mode 100755 index 00000000..1c4bcf56 --- /dev/null +++ b/thirdparty_template/README_zh.md @@ -0,0 +1,21 @@ +# xxx 三方库说明 +## 功能简介 +这个是xxx, 主要功能是xxx,简单的一句话介绍 +## 使用约束 + +- IDE版本: + +- ROM版本: + +- API版本: + +- 三方库版本: + +- 当前适配的功能:完成了xxx功能的适配 + +- [License:xxx]()(链接指向源三方库中的license) + +## 集成方式 + ++ [系统Rom包集成](docs/rom_integrate.md) ++ [应用Hap包集成](docs/hap_integrate.md) diff --git a/thirdparty_template/adapted/config.h b/thirdparty_template/adapted/config.h new file mode 100755 index 00000000..7ce9dbce --- /dev/null +++ b/thirdparty_template/adapted/config.h @@ -0,0 +1,13 @@ +# 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. + diff --git a/thirdparty_template/docs/rom_integrate.md b/thirdparty_template/docs/rom_integrate.md new file mode 100755 index 00000000..9f157fdb --- /dev/null +++ b/thirdparty_template/docs/rom_integrate.md @@ -0,0 +1,39 @@ +# xxx如何集成到系统Rom + +## 准备源码工程 + +简要说明系统源码版本和运行平台 + +### 准备系统Rom源码 + +介绍系统源码的获取 + +### 增加构建脚本及配置文件 + +介绍如何增加构建脚本及配置文件 + +### 准备三方库源码 + +介绍三方库源码的获取 + +## 系统Rom中引入三方库 + +介绍如何将三方库加入OpenHarmony中构建 + +## 系统Rom中引入三方库测试程序 + +介绍如何将三方库的测试程序加入OpenHarmony中构建 + +## 编译工程 + +介绍编译流程与结果 + +## 运行效果 + +展示三方库在设备上运行的效果,可以贴效果图 + +## 参考资料 + +- [本文档涉及的技术补充说明](rom_integrate.md) +- [本文档引用的相关参考](rom_integrate.md) +- [相关案例参考](rom_integrate.md) diff --git a/thirdparty_template/ohos.build b/thirdparty_template/ohos.build new file mode 100755 index 00000000..e955101a --- /dev/null +++ b/thirdparty_template/ohos.build @@ -0,0 +1,9 @@ +{ + "subsystem": "thirdparty", + "parts":{ + "xxx": { + "module_list": [ + ] + } + } +} \ No newline at end of file -- Gitee From 1db2f0d3482d767c483aa2af3dab838c8988e2ab Mon Sep 17 00:00:00 2001 From: huangminzhong Date: Tue, 20 Sep 2022 19:09:24 -0700 Subject: [PATCH 2/3] add define for config.h Signed-off-by: huangminzhong --- thirdparty_template/adapted/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thirdparty_template/adapted/config.h b/thirdparty_template/adapted/config.h index 7ce9dbce..2acc4bcc 100755 --- a/thirdparty_template/adapted/config.h +++ b/thirdparty_template/adapted/config.h @@ -11,3 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + + +#endif \ No newline at end of file -- Gitee From 9301aafafdec17944bf6e057e23fd607e4a273a7 Mon Sep 17 00:00:00 2001 From: huangminzhong Date: Tue, 20 Sep 2022 19:13:47 -0700 Subject: [PATCH 3/3] add define for config.h Signed-off-by: huangminzhong --- thirdparty_template/adapted/config.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thirdparty_template/adapted/config.h b/thirdparty_template/adapted/config.h index 2acc4bcc..0b61b0d7 100755 --- a/thirdparty_template/adapted/config.h +++ b/thirdparty_template/adapted/config.h @@ -1,3 +1,4 @@ +/* # 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. @@ -10,7 +11,7 @@ # 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. - +*/ #ifndef _CONFIG_H_ #define _CONFIG_H_ -- Gitee