• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright (c) 2021-2022 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" == &gt;
48& == &gt;
49' == &gt;
50< == &gt;
51> == &gt;
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="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/>
72            </filefilter>
73            <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
74                <filteritem type="filename" name="README.OpenSource"/>
75                <filteritem type="filename" name="README"/>
76                <filteritem type="filename" name="BUILD.gn"/>
77                <filteritem type="filename" name="*.gni"/>
78                <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/>
79            </filefilter>
80            <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies" >
81                <filteritem type="filename" name="README.OpenSource"/>
82                <filteritem type="filename" name="README"/>
83                <filteritem type="filename" name="BUILD.gn"/>
84                <filteritem type="filename" name="*.gni"/>
85                <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/>
86            </filefilter>
87            <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies" >
88                <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/>
89                <filteritem type="filename" name="BUILD.gn"/>
90                <filteritem type="filename" name="*.gni"/>
91            </filefilter>
92            <filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies" >
93                <filteritem type="filepath" name="README.md" desc="Describe the reason for filtering scan results"/>
94            </filefilter>
95            <filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies" >
96                <filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/>
97            </filefilter>
98            <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies" >
99                <filteritem type="filepath" name="figures/.*.png" desc="USB architecture diagram"/>
100                <filteritem type="filepath" name="frameworks/dialog/dialog_ui/signature/am.p7b" desc="signature file"/>
101                <filteritem type="filepath" name="frameworks/dialog/dialog_ui/AppScope/resources/base/media/app_icon.png" desc="app icon"/>
102                <filteritem type="filepath" name="frameworks/dialog/dialog_ui/usb_right_dialog/src/main/resources/base/media/icon.png" desc="icon"/>
103            </filefilter>
104        </filefilterlist>
105    </oatconfig>
106</configuration>
107
108