成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

啃論文俱樂部—移植Speexdsp到OpenHarmony標準系統(六)

系統 OpenHarmony
OAT(OSS Audit Tool)是OpenHarmony社區的自動化開源審視工具,用于幫助開發人員基于自定義的規則自動掃描開源倉代碼,識別不符合預定規則的代碼并輸出掃描報告。

??想了解更多關于開源的內容,請訪問:??

??51CTO 開源基礎軟件社區??

??https://ost.51cto.com??

  • 大家好!我來自南京,在OpenHarmony成長計劃啃論文俱樂部,與華為、軟通動力、潤和軟件、拓維信息、深開鴻?等公司一起,學習和研究?操作系統技術從今年1月11日加入OpenHarmony俱樂部已經有接近8個月時間了。筆者一直在思考啃論文給我帶來了些什么,通過啃論文能為OpenHarmony做些什么。筆者利用大二升大三暑假兩個月時間移植了Speexdsp這個三方庫到OpenHarmony標準系統,而關于前面的問題我似乎找到了答案,現將啃論文和三方庫移植分享經驗如下:

九、準備好上傳speexdsp至OpenHarmony倉庫。

移植完成后,先將代碼上傳至??sig倉中的contest倉??。

sig倉庫是TPC倉庫的孵化倉。代碼先上sig倉,到時會直接平移到tpc倉。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

上傳的內容包括:

  • 原生庫代碼。
  • (除了涉及需要修改原生庫代碼的部分,其他都不能上傳,例如編譯途中生成的中間文件)。
  • 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完成構建。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

  • 編譯構建成功

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

在父目錄下添加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 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.
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到OpenHarmony標準系統⑥-開源基礎軟件社區

同時在speexdsp父目錄下生成log文件夾。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

  • 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接口的列表。

十、上傳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該倉庫:

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

進入到clone界面,復制clone的鏈接地址。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

執行如下語句:

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:知識體系7_10 日心得"  //將暫存區內容簽名并提交到本地
  • -s是簽名表明這次提交者簽名(signoff)。
  • -m是對此次提交行為進行備注。

推送本地修改到賬號倉庫

現在需要將本地倉庫的修改內容推送到gitee上fork后的個人倉庫,使用git push命令來完成這個動作。

git push origin master
  • origin指的是自己的倉庫對應的原始遠程服務器地址。
  • master標識的是想要提交的分支。
  • 可以使用 git remote -v查看配置的遠程服務器。
  • git branch -a查看所有的分支。

進入自己的賬號下面,查看這個倉庫,發現已經發生了變化。從個人賬號倉庫下向官方倉庫下提交PR。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

進入個人賬號的該倉庫下,點擊增加PR即可開始提交PR。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

提交pr時,push的文件超過100個文件,在pr頁面只顯示100個。

啃論文俱樂部——移植speexdsp到OpenHarmony標準系統⑥-開源基礎軟件社區

??想了解更多關于開源的內容,請訪問:??

??51CTO 開源基礎軟件社區??

??https://ost.51cto.com??。

責任編輯:jianghua 來源: ??51CTO開源基礎軟件社區
相關推薦

2022-09-07 15:08:58

操作系統鴻蒙

2022-09-06 15:46:52

speexdsp鴻蒙

2022-09-13 16:10:15

鴻蒙操作系統

2022-09-14 15:28:19

操作系統鴻蒙

2022-09-15 15:21:22

操作系統鴻蒙

2023-06-27 15:12:46

C++三方庫移植

2022-05-13 23:03:25

大數據Big Data巨量資料

2022-08-22 17:36:13

啃論文方法啃論文俱樂部

2022-04-20 20:37:58

鴻蒙操作系統

2023-12-29 08:45:40

Python3.8鴻蒙解釋器

2022-04-07 15:03:07

Harmony計算機鴻蒙

2022-05-13 22:44:35

物聯網算法鴻蒙

2022-05-12 15:05:32

云計算數據壓縮

2022-06-08 16:29:45

無損壓縮方案分布式

2022-06-08 11:46:29

字符串鴻蒙

2022-03-28 15:09:17

無線傳感器網絡Harmony鴻蒙

2022-05-11 14:54:02

輸入法框架鴻蒙

2022-06-15 15:56:22

壓縮算法神經網絡

2022-06-15 16:06:29

LZ4 算法硬件加速

2022-09-19 14:25:35

JSON壓縮算法
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 成年网站在线观看 | 精久久 | 亚洲成av | 国产xxxx岁13xxxxhd | 国产自产c区 | 操视频网站 | 国产1区2区3区 | 亚洲国产高清在线观看 | 国产重口老太伦 | 久久久久久国产精品免费免费男同 | 精品国产乱码久久久久久中文 | 国产91av视频 | 黄网站免费在线看 | 欧美综合视频在线 | 欧美日韩亚洲一区 | av毛片在线播放 | 国产激情综合五月久久 | 毛片a区| 国产成人在线视频 | 成人免费视频在线观看 | 国产精品久久久久久久久久三级 | 久久综合久久综合久久 | 男女网站免费观看 | 国产视频福利一区 | 色爽女| 盗摄精品av一区二区三区 | 天天干天天爱天天爽 | 成人国产在线视频 | 特黄特色大片免费视频观看 | 久久精品网 | 国产精品视频一区二区三区不卡 | 免费亚洲网站 | 天天色天天色 | 亚洲一区二区在线电影 | 夜夜爽99久久国产综合精品女不卡 | 一本一道久久a久久精品蜜桃 | 亚洲成人精品 | 日韩一区二区在线视频 | 久久精品欧美一区二区三区不卡 | 国产成人精品一区二三区在线观看 | 欧美福利久久 |