1<?xml version="1.0" encoding="UTF-8"?> 2<!-- Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14--> 15<!-- OAT(OSS Audit Tool) configuration guide: 16basedir: Root dir, the basedir + project path is the real source file location. 17licensefile: 181.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule. 19 20tasklist(only for batch mode): 211. task: Define oat check thread, each task will start a new thread. 222. task name: Only an name, no practical effect. 233. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist. 244. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist. 255. task project: Projects to be checked, the path field define the source root dir of the project. 26 27 28policyList: 291. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process. 302. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is: 31<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/> 323. policyitem type: 33 "compatibility" is used to check license compatibility in the specified path; 34 "license" is used to check source license header in the specified path; 35 "copyright" is used to check source copyright header in the specified path; 36 "import" is used to check source dependency in the specified path, such as import ... ,include ... 37 "filetype" is used to check file type in the specified path, supported file types: archive, binary 38 "filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource 39 404. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license. 415. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem. 426. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed. 437. policyitem filefilter: Used to bind filefilter which define filter rules. 448. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path. 45 46Note:If the text contains special characters, please escape them according to the following rules: 47" == > 48& == > 49' == > 50< == > 51> == > 52--> 53<configuration> 54 <oatconfig> 55 <licensefile></licensefile> 56 <policylist> 57 <policy name="projectPolicy" desc=""> 58 <policyitem type="copyright" name="Huawei Technologies Co., Ltd." path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by Huawei Technologies"/> 59 <policyitem type="copyright" name="Huawei Device Co., Ltd." path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by Huawei Device"/> 60 <policyitem type="copyright" name="Rockchip Electronics Co., Ltd." path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed By Rockchip"/> 61 <policyitem type="copyright" name="Shenzhen Kaihong DID Co., Ltd." path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by Shenzhen Kaihong DID"/> 62 <policyitem type="license" name="GPL" path=".*" desc="linux kernel adapter codes"/> 63 <policyitem type="license" name="BSD" path=".*" desc="huawei codes"/> 64 </policy> 65 </policylist> 66 <filefilterlist> 67 <filefilter name="defaultFilter" desc="Files not to check"> 68 <filteritem type="filename" name="*.lds|*.pod"/> 69 <filteritem type="filename" name="*.a|*.d|*.o|*.so|*.cmd|*.hcb|*.swp"/> 70 <filteritem type="filename" name="*.clang-format"/> 71 <filteritem type="filename" name="*.hvigorfile" desc="Build Files"/> 72 <filteritem type="filename" name="hvigorfile.js" desc="Build Files"/> 73 <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/> 74 </filefilter> 75 <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies"> 76 <filteritem type="filename" name="README.OpenSource"/> 77 <filteritem type="filename" name="README"/> 78 <filteritem type="filename" name="BUILD.gn"/> 79 <filteritem type="filename" name="*.gni"/> 80 <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/> 81 </filefilter> 82 <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies" > 83 <filteritem type="filename" name="README.OpenSource"/> 84 <filteritem type="filename" name="README"/> 85 <filteritem type="filename" name="BUILD.gn"/> 86 <filteritem type="filename" name="*.gni"/> 87 <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/> 88 </filefilter> 89 <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies" > 90 <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/> 91 <filteritem type="filename" name="BUILD.gn"/> 92 <filteritem type="filename" name="*.gni"/> 93 </filefilter> 94 <filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies" > 95 <filteritem type="filepath" name="README.md" desc="Describe the reason for filtering scan results"/> 96 </filefilter> 97 <filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies" > 98 <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/> 99 </filefilter> 100 <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies" > 101 <filteritem type="filepath" name="figures/.*.png" desc="USB architecture diagram"/> 102 <filteritem type="filepath" name="frameworks/dialog/functionswitch_ui/AppScope/resources/base/media/app_icon.png" desc="app icon"/> 103 <filteritem type="filepath" name="frameworks/dialog/dialog_ui/signature/am.p7b" desc="signature file"/> 104 <filteritem type="filepath" name="frameworks/dialog/dialog_ui/AppScope/resources/base/media/app_icon.png" desc="app icon"/> 105 <filteritem type="filepath" name="frameworks/dialog/dialog_ui/usb_right_dialog/src/main/resources/base/media/icon.png" desc="icon"/> 106 <filteritem type="filepath" name="frameworks/dialog/functionswitch_ui/signature/com.ohos.functionswitchdialog.p7b" desc="signature file"/> 107 <filteritem type="filepath" name="frameworks/dialog/functionswitch_ui/usb_function_dialog/src/main/resources/base/media/app_icon.png" desc="app icon"/> 108 <filteritem type="filepath" name="frameworks/dialog/functionswitch_ui/usb_function_dialog/src/main/resources/base/media/icon.png" desc="icon"/> 109 </filefilter> 110 </filefilterlist> 111 </oatconfig> 112</configuration> 113 114