
移植完成后,先将代码上传至 sig仓中的contest仓
sig仓库是TPC仓库的孵化仓。代码先上sig仓,到时会直接平移到tpc仓。

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

编译构建:


在父目录下添加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例如笔者执行的语句为:
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文件夹

原生库通过make或者cmake时生成的一些配置文件。如比较通用的config.h配置文件,config.h文件为原生库生成文件,原则上也不做修改,为了避免文件上仓进行代码扫码,可以将文件文件修改后缀名(config.h.in)。相关文档中需要将配置文件使用方法说明。
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 等代码相关文件)文档中需罗列出
1、 导出库对外暴露的所有api接口的列表
2、导出库对外暴露的已测试api接口的列表
打开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提交三方库时候,文档中有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" //将暂存区内容签名并提交到本地git commit --amend现在需要将本地仓库的修改内容推送到gitee上fork后的个人仓库,使用git push命令来完成这个动作。
git push origin master如果你觉得这篇内容对你还蛮有帮助,我想邀请你帮我三个小忙:
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。