移植speexdsp到OpenHarmony标准系统⑥

news/2024/9/24 21:17:29/

OpenHarmony_0">九、准备好上传speexdsp至OpenHarmony仓库。

移植完成后,先将代码上传至sig仓中的contest仓

sig仓库是TPC仓库的孵化仓。代码先上sig仓,到时会直接平移到tpc仓。

上传的内容包括:

  • 原生库代码
    • (除了涉及需要修改原生库代码的部分,其他都不能上传,例如编译途中生成的中间文件)
  • BUILD.gn
  • README.Opensource
  • 库对外导出的所有api接口export_api.txt
  • 测试过的api接口tested_api.txt
  • 功能测试文档: 三方库_test_function.md
    • 内容至少包含罗列出库所有的功能,已测试过的功能,原生库测试逻辑的分析
  • 原生库分析文档: 三方库_analyse.md

文档命名不要用中文,如果涉及到编码问题的话,到时候会出现乱码,一般建议不用中文命名!!!

提供OAT.xml文件

OAT开源扫描

  • OAT(OSS Audit Tool)是OpenHarmony社区的自动化开源审视工具,用于帮助开发人员基于自定义的规则自动扫描开源仓代码,识别不符合预定规则的代码并输出扫描报告。
  • OAT下载地址:https://gitee.com/openharmony-sig/tools_oat

工具使用

编译构建:

  • 在linux上安装好javaMaven后,下载OAT工具源码,执行mvn package完成构建。

  • 编译构建成功

在父目录下添加OAT.xml,内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<!-- 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.--><configuration><oatconfig><licensefile>COPYING</licensefile><policylist><policy name="projectPolicy" desc=""><!--policyitem type="compatibility" name="GPL-2.0+" path="abc/.*" desc="Process that runs independently, invoked by the X process."/--><policyitem type="license" name="*" path=".*" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter" desc=""/></policy></policylist><filefilterlist><filefilter name="defaultFilter" desc="Files not to check"><filteritem type="filepath" name=".*" desc="原生库文件"/></filefilter><filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies"><!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--><filteritem type="filepath" name=".*" desc="原生库代码"/></filefilter><filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies"><!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--><filteritem type="filepath" name=".*" desc="原生库代码"/></filefilter><filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies"><!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--></filefilter><filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies"><!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--></filefilter><filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies"><!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--></filefilter><filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies"><!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--><!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--></filefilter></filefilterlist><licensematcherlist><!--licensematcher name="uvwxyz License" desc="If the scanning result is InvalidLicense, you can define matching rules here. Note that quotation marks must be escaped."><licensetext name="uvwxyz license textA xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" desc=""/><licensetext name="uvwxyz license textB xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" desc=""/></licensematcher--></licensematcherlist></oatconfig>
</configuration>

在speexdsp根目录下新建空白的OAT_report.text文件,执行命令:

Java –jar ohos_ossaudittool-1.0.jar –s src_dir –r report_file –n selfcheck
  • ohos_ossaudittool-1.0.jar 工具包名,需要带实际路径

  • -s 指定需要检查的代码目录,src_dir 改成要检查的项目路径

  • -r 指定报告输出文件的路径,检查完成后可查看此文件中列出的问题,按指导文档修复

  • report_file

  • -n 检查任务的名称,任意指定,本地检查使用不上。

例如笔者执行的语句为:

sudo java -Dfile.encoding=UTF-8 -jar /home/jiajiahao/Desktop/tools_oat-master/target/ohos_ossaudittool-1.0.jar -s /home/jiajiahao/Desktop/gitee_speexdsp -r /home/jiajiahao/Desktop/gitee_speexdsp/OAT_report.text -n nameOfRepo

扫描结果

执行完上述命令后,OAT_report.text生成内容如下:

同时在speexdsp父目录下生成log文件夹

  • LicenseFile.txt位于OAT工具运行目录的log目录下,此文件记录扫描目录下所有疑似许可证的文件

原生库通过make或者cmake时生成的一些配置文件。如比较通用的config.h配置文件,config.h文件为原生库生成文件,原则上也不做修改,为了避免文件上仓进行代码扫码,可以将文件文件修改后缀名(config.h.in)。相关文档中需要将配置文件使用方法说明。

提供README.OpenSource文件

README.Opensource的格式如下:

[{"Name": "",				## 库名"License": "",			## 开源协议"License File": ",		## 开源文件,一般开源项目都会自带该文件"Version Number": "",		## 库的版本"Owner": "",				## 作者"Upstream URL": "",		## 开源库的地址"Description": ""			## 库的描述}
]

speexdsp的README.OpenSource文件如下:

[{"Name": "speexdsp","License": "BSD-3-Clause","License File": "COPYING","Version Number": "1.2.1","Owner": "2692032597@qq.com","Upstream URL": "https://speex.org/","Description": "Speexdsp is a speech processing library that goes along with the Speex codec"}
]

提供库的分析文档

三方库分析文档如下:

一、确定库实现方式
例如:C/C++/JS/JAVA二.依赖分析
例如:当前库依赖其他三方库,如下1)库名1,库仓库地址2)库名2,库仓库地址三、license以及版权
例如:一般在license文件或者COPYING中,Apache License V2.0四、最新一次版本
xx年xx月xx日,版本号xxx五、功能点分析
(罗列出该库所支持的功能)六、代码规模
(统计库代码总行数,包括.h/.hpp/.c/.cpp/.cc 等代码相关文件)

提供功能测试文档

文档中需罗列出

  • 库所有的功能
  • 已测试过的功能
  • 原生库测试逻辑的分析

提供导出的api接口列表

1、 导出库对外暴露的所有api接口的列表
2、导出库对外暴露的已测试api接口的列表

OpenHarmony_236">十、上传speexdsp至OpenHarmony仓库

配置个人信息

打开git bash,依次输入以下命令:

git config --global user.name "xxxx"   (配置用户名,xxxx为账号用户名,即个人空间地址)
git config --global user.email "xxxxxx@xxx"  (gitee 账号邮箱与签署DCO 的邮箱保持一致即可) 
git config --list         (查看配置情况)
git config --global credential.helper store (解决每次git pull都要输入账号信息的问题)

克隆仓库内容到本地

到个人账号点击并进入contest仓库, fork该仓库:

进入到clone界面,复制clone的链接地址。

执行如下语句:

git clone https://gitee.com/xxxxx/contest.git --depth=1
  • –depth=1意思是只clone当前仓库最新版本,省去一些历史log,避免仓库历史记录过于庞大花费太多clone时间。

  • clone完毕之后,即可在本地目录下看到这个clone的仓库。本地目录所在位置是根据git bash的位置决定的,比如在桌面启动git bash,则clone的仓库会出现在桌面。

利用git lfs机制添加特殊文件

提交三方库时候,文档中有PDF文件时就需要使用利用git lfs机制

git lfs track xxx/xxx.pdf  // 声明该特殊文件到git lfs机制

git add .gitattributes // 添加配置文件

git add xxx/xxx.pdf // 添加具体特殊文件到暂存区中

git lfs ls-files  // 确认相关test_lfs.a 文件是否已经添加到lfs 机制中。

git  add *   //将变更文件加入到暂存区

git commit -s -m  "add xxxxxxxx"  //将暂存区内容签名并提交到本地
  • -s是签名表明这次提交者签名(signoff)
  • -m是对此次提交行为进行备注.
git commit --amend

推送本地修改到账号仓库

现在需要将本地仓库的修改内容推送到gitee上fork后的个人仓库,使用git push命令来完成这个动作。

git push origin master
  • origin指的是自己的仓库对应的原始远程服务器地址;
  • master标识的是想要提交的分支。
  • 可以使用 git remote -v查看配置的远程服务器;
  • git branch -a查看所有的分支。

为了能让大家更好的学习鸿蒙(HarmonyOS NEXT)开发技术,这边特意整理了《鸿蒙开发学习手册》(共计890页),希望对大家有所帮助:https://qr21.cn/FV7h05

鸿蒙开发学习手册》:

如何快速入门:https://qr21.cn/FV7h05

  1. 基本概念
  2. 构建第一个ArkTS应用
  3. ……

开发基础知识:https://qr21.cn/FV7h05

  1. 应用基础知识
  2. 配置文件
  3. 应用数据管理
  4. 应用安全管理
  5. 应用隐私保护
  6. 三方应用调用管控机制
  7. 资源分类与访问
  8. 学习ArkTS语言
  9. ……

基于ArkTS 开发:https://qr21.cn/FV7h05

  1. Ability开发
  2. UI开发
  3. 公共事件与通知
  4. 窗口管理
  5. 媒体
  6. 安全
  7. 网络与链接
  8. 电话服务
  9. 数据管理
  10. 后台任务(Background Task)管理
  11. 设备管理
  12. 设备使用信息统计
  13. DFX
  14. 国际化开发
  15. 折叠屏系列
  16. ……

鸿蒙开发面试真题(含参考答案):https://qr18.cn/F781PH

鸿蒙开发面试大盘集篇(共计319页):https://qr18.cn/F781PH

1.项目开发必备面试题
2.性能优化方向
3.架构方向
4.
鸿蒙开发系统底层方向
5.鸿蒙音视频开发方向
6.鸿蒙车载开发方向
7.鸿蒙南向开发方向


http://www.ppmy.cn/news/1426322.html

相关文章

std::deque/std::vector/std::list

效率 STL容器—deque使用技巧_std::deque 高级用法-CSDN博客

Docker搭建Emby

Emby是一款媒体服务器应用程序&#xff0c;与Plex和Kodi等服务类似&#xff0c;它允许用户整理个人媒体库&#xff08;包括视频、音频和图片&#xff09;&#xff0c;并通过网络流式传输到各种设备上。用户可以在家庭网络内或通过互联网远程访问媒体库&#xff0c;Emby还能自动…

组件安全(Solr、Shiro、Log4j、Jackson、FastJson、XStream)

Solr 主要基于HTTP和 Apache Lucene 实现的全文搜索服务器。 特征&#xff1a;图标识别 端口&#xff1a;8393 CVE-2019-0193&#xff08;远程命令执行漏洞&#xff09; 漏洞版本&#xff1a;Apache Solr < 8.2.0 利用条件&#xff1a; Apache Solr 的 DataImportHandler 启…

自动化_Ansible学习笔记

文章目录 Ansible 介绍配置文件主配置文件优先级 常用命令ansible-playbook ad-hocinventory 主机清单Playbook 剧本YAML格式 ansible 模块介绍模块对应功能Commands modules(命令模块)command (命令)shell (外壳) 官方帮助文档 模块索引playbook 开头示例系统类setup (收集远程…

无风扇嵌入式车载电脑在矿山车辆行业应用

矿山车辆行业应用 背景介绍 现代的采矿业面临许多的挑战&#xff0c;其中最重要的就是安全性的问题&#xff0c;无论在矿井下或地面上的工作&#xff0c;都必须确保员工的安全保障。因此&#xff0c;先进的矿车必须整合专用的车载电脑&#xff0c;在极其恶劣的采矿环境中稳定运…

CSS基础之伪元素选择器(如果想知道CSS的伪元素选择器知识点,那么只看这一篇就足够了!)

前言&#xff1a;我们已经知道了在CSS中&#xff0c;选择器有基本选择器、复合选择器、伪类选择器、那么选择器学习完了吗&#xff1f;显然是没有的&#xff0c;这篇文章讲解最后一种选择器——伪元素选择器。 ✨✨✨这里是秋刀鱼不做梦的BLOG ✨✨✨想要了解更多内容可以访问我…

09篇 docker命令详解

1. docker run -d --name my_container -p 8080:80 my_image 这条命令会创建并启动一个后台运行的容器&#xff0c;其中-d代表以守护进程方式运行&#xff0c;--name用于指定容器名称&#xff0c;-p用于端口映射&#xff0c;将宿主机的8080端口映射到容器的80端口&#xff0c…

基于SpringBoot的“商务安全邮箱”的设计与实现(源码+数据库+文档+PPT)

基于SpringBoot的“商务安全邮箱”的设计与实现&#xff08;源码数据库文档PPT) 开发语言&#xff1a;Java 数据库&#xff1a;MySQL 技术&#xff1a;SpringBoot 工具&#xff1a;IDEA/Ecilpse、Navicat、Maven 系统展示 系统功能结构 收件箱效果图 草稿箱效果图 已发送…