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

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

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

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

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

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

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

九、準(zhǔn)備好上傳speexdsp至OpenHarmony倉庫。

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

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

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

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

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

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

提供OAT.xml文件:

OAT開源掃描

  • OAT(OSS Audit Tool)是OpenHarmony社區(qū)的自動(dòng)化開源審視工具,用于幫助開發(fā)人員基于自定義的規(guī)則自動(dòng)掃描開源倉代碼,識別不符合預(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="原生庫文件"/>
</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文件,執(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í)行的語句為:

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目錄下,此文件記錄掃描目錄下所有疑似許可證的文件。

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

提供README.OpenSource文件

README.Opensource的格式如下:

[
{
"Name": "", ## 庫名
"License": "", ## 開源協(xié)議
"License File": ", ## 開源文件,一般開源項(xiàng)目都會(huì)自帶該文件
"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"
}
]

提供庫的分析文檔

三方庫分析文檔如下:

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

提供功能測試文檔

文檔中需羅列出:

  • 庫所有的功能
  • 已測試過的功能
  • 原生庫測試邏輯的分析

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

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

十、上傳speexdsp至OpenHarmony倉庫

配置個(gè)人信息

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

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

克隆倉庫內(nèi)容到本地

到個(gè)人賬號點(diǎn)擊并進(jìn)入??contest倉庫??, fork該倉庫:

啃論文俱樂部——移植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í)行如下語句:

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

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

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

推送本地修改到賬號倉庫

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

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

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

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

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

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

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

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

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

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

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

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

2022-09-07 15:08:58

操作系統(tǒng)鴻蒙

2022-09-06 15:46:52

speexdsp鴻蒙

2022-09-13 16:10:15

鴻蒙操作系統(tǒng)

2022-09-14 15:28:19

操作系統(tǒng)鴻蒙

2022-09-15 15:21:22

操作系統(tǒng)鴻蒙

2023-06-27 15:12:46

C++三方庫移植

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-04-07 15:03:07

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

2022-05-13 22:44:35

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

2022-03-28 15:09:17

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

2022-06-08 11:46:29

字符串鴻蒙

2022-05-12 15:05:32

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

2022-06-08 16:29:45

無損壓縮方案分布式

2022-05-11 14:54:02

輸入法框架鴻蒙

2022-06-15 15:56:22

壓縮算法神經(jīng)網(wǎng)絡(luò)

2022-06-15 16:06:29

LZ4 算法硬件加速

2022-09-19 14:25:35

JSON壓縮算法
點(diǎn)贊
收藏

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

主站蜘蛛池模板: 国产成人小视频 | 亚洲网址在线观看 | 国产激情视频在线免费观看 | 欧美日韩亚洲一区 | 性网址| 成人精品一区二区三区四区 | 久久成人免费观看 | 亚洲天堂中文字幕 | 日本不卡一区二区三区 | 日韩中文字幕视频在线观看 | 一区二区在线 | 亚洲一区二区三区在线免费观看 | 羞羞的视频免费在线观看 | 欧美性生交大片免费 | 国产欧美日韩精品在线观看 | 97久久久久久久久 | 一级网站| 97久久精品午夜一区二区 | 日韩在线免费 | 成人免费观看网站 | av在线一区二区三区 | 天堂综合网久久 | 国产亚洲一区二区三区 | 综合久久99 | 亚洲欧美中文日韩在线v日本 | 亚洲视频一区 | 亚洲a视频 | 伊人久久综合 | 国产真实乱全部视频 | 成人精品免费 | 中文字幕一区二区三区在线观看 | 一级黄色片一级黄色片 | 日韩高清中文字幕 | 欧美亚洲视频在线观看 | 成人国产精品免费观看 | 91五月婷蜜桃综合 | 欧美jizzhd精品欧美巨大免费 | 97久久精品午夜一区二区 | 久草中文网 | 久久av资源网 | 国产盗摄视频 |