1<?xml version="1.0" encoding="UTF-8"?> 2<!-- Copyright (c) 2021 Huawei Device Co., Ltd. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 16 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. 17 All configurations in this file will be merged to OAT-Default.xml, if you have any questions or concerns, please create issue in OpenHarmony/tools_oat and @jalenchen or chenyaxun. 18 19 licensefile: 20 1.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. 21 22 policylist: 23 1. policy: If the OAT-Default.xml policies do not meet your requirements, please add policies here. 24 2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is: 25 <policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/> 26 3. policyitem type: 27 "compatibility" is used to check license compatibility in the specified path; 28 "license" is used to check source license header in the specified path; 29 "copyright" is used to check source copyright header in the specified path; 30 "import" is used to check source dependency in the specified path, such as import ... ,include ... 31 "filetype" is used to check file type in the specified path, supported file types: archive, binary 32 "filename" is used to check whether the specified file exists in the specified path(projectroot means the root dir of the project), supported file names: LICENSE, README, README.OpenSource 33 4. 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. 34 5. 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. 35 6. 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. 36 7. policyitem filefilter: Used to bind filefilter which define filter rules. 37 7. policyitem desc: Used to describe the reason of this policy item, committers will check this while merging the code. 38 8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path. 39 40 Note:If the text contains special characters, please escape them according to the following rules: 41 " == " 42 & == & 43 ' == ' 44 < == < 45 > == > 46--> 47 48<configuration> 49 <oatconfig> 50 <licensefile>LICENCE</licensefile> 51 <policylist> 52 <policy name="projectPolicy" desc=""> 53 <!--policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process."/--> 54 <!--policyitem type="license" name="LGPL" path=".*" desc="Dynamically linked by module X"/--> 55 <!--policyitem type="copyright" name="xxx" path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by X Company"/--> 56 </policy> 57 </policylist> 58 59 <filefilterlist> 60 <filefilter name="defaultFilter" desc="Files not to check"> 61 <filteritem type="filename" name="*.gitreview|*.py|*.gn" desc="desc files"/> 62 <filteritem type="filepath" name="test/.*" desc="unused"/> 63 <filteritem type="filepath" name="tools/.*" desc="unused"/> 64 <filteritem type="filepath" name="examples/.*" desc="unused"/> 65 <filteritem type="filepath" name="benchmarks/.*" desc="unused"/> 66 <filteritem type="filepath" name="src/.*" desc="src files"/> 67 <filteritem type="filename" name="AUTHORS" desc="authors declear"/> 68 <filteritem type="filename" name="LICENCE*" desc="LICENCE file"/> 69 <filteritem type="filename" name="SConstruct" desc=""/> 70 <filteritem type="filename" name="BUILD.gn" desc=""/> 71 <filteritem type="filename" name=".clang-tidy" desc=""/> 72 </filefilter> 73 <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies"> 74 <filteritem type="filename" name="BUILD.gn" desc=""/> 75 <filteritem type="filename" name=".clang-tidy" desc=""/> 76 </filefilter> 77 <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies"> 78 <filteritem type="filename" name="AUTHORS"/> 79 <filteritem type="filename" name="BUILD.gn" desc=""/> 80 <filteritem type="filename" name=".clang-tidy" desc="Vixl native file without copyright"/> 81 </filefilter> 82 <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies"> 83 <filteritem type="filename" name="BUILD.gn" desc=""/> 84 <filteritem type="filename" name=".clang-tidy" desc="Vixl native file without license"/> 85 </filefilter> 86 <filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies"> 87 <filteritem type="filename" name="README.md"/> 88 </filefilter> 89 <filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies"> 90 <filteritem type="filename" name="Readme.OpenSource"/> 91 </filefilter> 92 <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies"> 93 </filefilter> 94 </filefilterlist> 95 </oatconfig> 96</configuration> 97