自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

啃論文俱樂部—移植Speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)(六)

系統(tǒng) OpenHarmony
OAT(OSS Audit Tool)是OpenHarmony社區(qū)的自動(dòng)化開源審視工具,用于幫助開發(fā)人員基于自定義的規(guī)則自動(dòng)掃描開源倉(cāng)代碼,識(shí)別不符合預(yù)定規(guī)則的代碼并輸出掃描報(bào)告。

??想了解更多關(guān)于開源的內(nèi)容,請(qǐng)?jiān)L問:??

??51CTO 開源基礎(chǔ)軟件社區(qū)??

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

  • 大家好!我來(lái)自南京,在OpenHarmony成長(zhǎng)計(jì)劃啃論文俱樂部,與華為、軟通動(dòng)力、潤(rùn)和軟件、拓維信息、深開鴻?等公司一起,學(xué)習(xí)和研究?操作系統(tǒng)技術(shù)從今年1月11日加入OpenHarmony俱樂部已經(jīng)有接近8個(gè)月時(shí)間了。筆者一直在思考啃論文給我?guī)?lái)了些什么,通過(guò)啃論文能為OpenHarmony做些什么。筆者利用大二升大三暑假兩個(gè)月時(shí)間移植了Speexdsp這個(gè)三方庫(kù)到OpenHarmony標(biāo)準(zhǔn)系統(tǒng),而關(guān)于前面的問題我似乎找到了答案,現(xiàn)將啃論文和三方庫(kù)移植分享經(jīng)驗(yàn)如下:

九、準(zhǔn)備好上傳speexdsp至OpenHarmony倉(cāng)庫(kù)。

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

sig倉(cāng)庫(kù)是TPC倉(cāng)庫(kù)的孵化倉(cāng)。代碼先上sig倉(cāng),到時(shí)會(huì)直接平移到tpc倉(cāng)。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

上傳的內(nèi)容包括:

  • 原生庫(kù)代碼。
  • (除了涉及需要修改原生庫(kù)代碼的部分,其他都不能上傳,例如編譯途中生成的中間文件)。
  • BUILD.gn。
  • README.Opensource。
  • 庫(kù)對(duì)外導(dǎo)出的所有api接口export_api.txt。
  • 測(cè)試過(guò)的api接口tested_api.txt。
  • 功能測(cè)試文檔: 三方庫(kù)_test_function.md。
  • 內(nèi)容至少包含羅列出庫(kù)所有的功能,已測(cè)試過(guò)的功能,原生庫(kù)測(cè)試邏輯的分析。
  • 原生庫(kù)分析文檔: 三方庫(kù)_analyse.md。

文檔命名不要用中文,如果涉及到編碼問題的話,到時(shí)候會(huì)出現(xiàn)亂碼,一般建議不用中文命名!

提供OAT.xml文件:

OAT開源掃描

  • OAT(OSS Audit Tool)是OpenHarmony社區(qū)的自動(dòng)化開源審視工具,用于幫助開發(fā)人員基于自定義的規(guī)則自動(dòng)掃描開源倉(cāng)代碼,識(shí)別不符合預(yù)定規(guī)則的代碼并輸出掃描報(bào)告。
  • OAT下載地址:https://gitee.com/openharmony-sig/tools_oat。

工具使用

編譯構(gòu)建:

  • 在linux上安裝好javaMaven后,下載OAT工具源碼,執(zhí)行mvn package完成構(gòu)建。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

  • 編譯構(gòu)建成功

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

在父目錄下添加OAT.xml,內(nèi)容如下:

<?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="原生庫(kù)文件"/>
</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="原生庫(kù)代碼"/>
</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="原生庫(kù)代碼"/>
</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文件,執(zhí)行命令:

Java –jar ohos_ossaudittool-1.0.jar –s src_dir –r report_file –n selfcheck
  • ohos_ossaudittool-1.0.jar 工具包名,需要帶實(shí)際路徑。
  • -s 指定需要檢查的代碼目錄,src_dir 改成要檢查的項(xiàng)目路徑。
  • -r 指定報(bào)告輸出文件的路徑,檢查完成后可查看此文件中列出的問題,按指導(dǎo)文檔修復(fù)。
  • report_file。
  • -n 檢查任務(wù)的名稱,任意指定,本地檢查使用不上。

例如筆者執(zhí)行的語(yǔ)句為:

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

掃描結(jié)果

執(zhí)行完上述命令后,OAT_report.text生成內(nèi)容如下:

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

同時(shí)在speexdsp父目錄下生成log文件夾。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

  • LicenseFile.txt位于OAT工具運(yùn)行目錄的log目錄下,此文件記錄掃描目錄下所有疑似許可證的文件。

原生庫(kù)通過(guò)make或者cmake時(shí)生成的一些配置文件。如比較通用的config.h配置文件,config.h文件為原生庫(kù)生成文件,原則上也不做修改,為了避免文件上倉(cāng)進(jìn)行代碼掃碼,可以將文件文件修改后綴名(config.h.in)。相關(guān)文檔中需要將配置文件使用方法說(shuō)明。

提供README.OpenSource文件

README.Opensource的格式如下:

[
{
"Name": "", ## 庫(kù)名
"License": "", ## 開源協(xié)議
"License File": ", ## 開源文件,一般開源項(xiàng)目都會(huì)自帶該文件
"Version Number": "", ## 庫(kù)的版本
"Owner": "", ## 作者
"Upstream URL": "", ## 開源庫(kù)的地址
"Description": "" ## 庫(kù)的描述
}
]

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"
}
]

提供庫(kù)的分析文檔

三方庫(kù)分析文檔如下:

一、確定庫(kù)實(shí)現(xiàn)方式
例如:C/C++/JS/JAVA
二.依賴分析
例如:當(dāng)前庫(kù)依賴其他三方庫(kù),如下
1)庫(kù)名1,庫(kù)倉(cāng)庫(kù)地址
2)庫(kù)名2,庫(kù)倉(cāng)庫(kù)地址
三、license以及版權(quán)
例如:一般在license文件或者COPYING中,Apache License V2.0
四、最新一次版本
xx年xx月xx日,版本號(hào)xxx
五、功能點(diǎn)分析
(羅列出該庫(kù)所支持的功能)
六、代碼規(guī)模
(統(tǒng)計(jì)庫(kù)代碼總行數(shù),包括.h/.hpp/.c/.cpp/.cc 等代碼相關(guān)文件)

提供功能測(cè)試文檔

文檔中需羅列出:

  • 庫(kù)所有的功能
  • 已測(cè)試過(guò)的功能
  • 原生庫(kù)測(cè)試邏輯的分析

提供導(dǎo)出的api接口列表

  1. 導(dǎo)出庫(kù)對(duì)外暴露的所有api接口的列表。
  2. 導(dǎo)出庫(kù)對(duì)外暴露的已測(cè)試api接口的列表。

十、上傳speexdsp至OpenHarmony倉(cāng)庫(kù)

配置個(gè)人信息

打開git bash,依次輸入以下命令:

git config --global user.name "xxxx"   (配置用戶名,xxxx為賬號(hào)用戶名,即個(gè)人空間地址)
git config --global user.email "xxxxxx@xxx" (gitee 賬號(hào)郵箱與簽署DCO 的郵箱保持一致即可)
git config --list (查看配置情況)
git config --global credential.helper store (解決每次git pull都要輸入賬號(hào)信息的問題)

克隆倉(cāng)庫(kù)內(nèi)容到本地

到個(gè)人賬號(hào)點(diǎn)擊并進(jìn)入??contest倉(cāng)庫(kù)??, fork該倉(cāng)庫(kù):

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

進(jìn)入到clone界面,復(fù)制clone的鏈接地址。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

執(zhí)行如下語(yǔ)句:

git clone https://gitee.com/xxxxx/contest.git --depth=1
  • –depth=1意思是只clone當(dāng)前倉(cāng)庫(kù)最新版本,省去一些歷史log,避免倉(cāng)庫(kù)歷史記錄過(guò)于龐大花費(fèi)太多clone時(shí)間。
  • clone完畢之后,即可在本地目錄下看到這個(gè)clone的倉(cāng)庫(kù)。本地目錄所在位置是根據(jù)git bash的位置決定的,比如在桌面啟動(dòng)git bash,則clone的倉(cāng)庫(kù)會(huì)出現(xiàn)在桌面。

利用git lfs機(jī)制添加特殊文件

提交三方庫(kù)時(shí)候,文檔中有PDF文件時(shí)就需要使用利用git lfs機(jī)制。

git lfs track xxx/xxx.pdf  // 聲明該特殊文件到git lfs機(jī)制
git add .gitattributes // 添加配置文件
git add xxx/xxx.pdf // 添加具體特殊文件到暫存區(qū)中
git lfs ls-files  // 確認(rèn)相關(guān)test_lfs.a 文件是否已經(jīng)添加到lfs 機(jī)制中。
git  add *   //將變更文件加入到暫存區(qū)
git commit -s -m  "add:知識(shí)體系7_10 日心得"  //將暫存區(qū)內(nèi)容簽名并提交到本地
  • -s是簽名表明這次提交者簽名(signoff)。
  • -m是對(duì)此次提交行為進(jìn)行備注。

推送本地修改到賬號(hào)倉(cāng)庫(kù)

現(xiàn)在需要將本地倉(cāng)庫(kù)的修改內(nèi)容推送到gitee上fork后的個(gè)人倉(cāng)庫(kù),使用git push命令來(lái)完成這個(gè)動(dòng)作。

git push origin master
  • origin指的是自己的倉(cāng)庫(kù)對(duì)應(yīng)的原始遠(yuǎn)程服務(wù)器地址。
  • master標(biāo)識(shí)的是想要提交的分支。
  • 可以使用 git remote -v查看配置的遠(yuǎn)程服務(wù)器。
  • git branch -a查看所有的分支。

進(jìn)入自己的賬號(hào)下面,查看這個(gè)倉(cāng)庫(kù),發(fā)現(xiàn)已經(jīng)發(fā)生了變化。從個(gè)人賬號(hào)倉(cāng)庫(kù)下向官方倉(cāng)庫(kù)下提交PR。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

進(jìn)入個(gè)人賬號(hào)的該倉(cāng)庫(kù)下,點(diǎn)擊增加PR即可開始提交PR。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

提交pr時(shí),push的文件超過(guò)100個(gè)文件,在pr頁(yè)面只顯示100個(gè)。

啃論文俱樂部——移植speexdsp到OpenHarmony標(biāo)準(zhǔn)系統(tǒng)⑥-開源基礎(chǔ)軟件社區(qū)

??想了解更多關(guān)于開源的內(nèi)容,請(qǐng)?jiān)L問:??

??51CTO 開源基礎(chǔ)軟件社區(qū)??

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

責(zé)任編輯:jianghua 來(lái)源: ??51CTO開源基礎(chǔ)軟件社區(qū)
相關(guān)推薦

2022-09-13 16:10:15

鴻蒙操作系統(tǒng)

2022-09-07 15:08:58

操作系統(tǒng)鴻蒙

2022-09-06 15:46:52

speexdsp鴻蒙

2022-09-14 15:28:19

操作系統(tǒng)鴻蒙

2022-09-15 15:21:22

操作系統(tǒng)鴻蒙

2023-06-27 15:12:46

C++三方庫(kù)移植

2022-05-13 23:03:25

大數(shù)據(jù)Big Data巨量資料

2022-08-22 17:36:13

啃論文方法啃論文俱樂部

2022-04-20 20:37:58

鴻蒙操作系統(tǒng)

2023-12-29 08:45:40

Python3.8鴻蒙解釋器

2022-05-13 22:44:35

物聯(lián)網(wǎng)算法鴻蒙

2022-04-07 15:03:07

Harmony計(jì)算機(jī)鴻蒙

2022-06-08 16:29:45

無(wú)損壓縮方案分布式

2022-05-12 15:05:32

云計(jì)算數(shù)據(jù)壓縮

2022-03-28 15:09:17

無(wú)線傳感器網(wǎng)絡(luò)Harmony鴻蒙

2022-06-08 11:46:29

字符串鴻蒙

2022-05-11 14:54:02

輸入法框架鴻蒙

2022-09-19 14:25:35

JSON壓縮算法

2022-06-15 16:06:29

LZ4 算法硬件加速

2022-06-15 15:56:22

壓縮算法神經(jīng)網(wǎng)絡(luò)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)