• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright (c) 2022 Huawei Device Co., Ltd.
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
18    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.
19
20-->
21<!-- OAT(OSS Audit Tool) configuration guide:
22basedir: Root dir, the basedir + project path is the real source file location.
23licensefile:
241.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.
25
26tasklist(only for batch mode):
271. task: Define oat check thread, each task will start a new thread.
282. task name: Only an name, no practical effect.
293. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
304. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
315. task project: Projects to be checked, the path field define the source root dir of the project.
32
33
34policyList:
351. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
362. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
37<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
383. policyitem type:
39    "compatibility" is used to check license compatibility in the specified path;
40    "license" is used to check source license header in the specified path;
41    "copyright" is used to check source copyright header in the specified path;
42    "import" is used to check source dependency in the specified path, such as import ... ,include ...
43    "filetype" is used to check file type in the specified path, supported file types: archive, binary
44    "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
45
464. 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.
475. 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.
486. 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.
497. policyitem filefilter: Used to bind filefilter which define filter rules.
508. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
51
52Note:If the text contains special characters, please escape them according to the following rules:
53" == &gt;
54& == &gt;
55' == &gt;
56< == &gt;
57> == &gt;
58-->
59<configuration>
60    <oatconfig>
61        <licensefile>COPYING</licensefile>
62        <policylist>
63            <policy name="projectPolicy" desc="">
64                <policyitem type="license" name="GPL" path=".*" desc="license"/>
65                <policyitem type="copyright" name="*" path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
66            </policy>
67        </policylist>
68        <filefilterlist>
69            <filefilter name="defaultFilter" desc="Files not to check">
70                <filteritem type="filename" name="*.am|*.po|*.1|*.m4|*.ac|*.sh|README.*|*.csv" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
71                <filteritem type="filename" name="*.rst|*Skylake|*.Broadwell|*.Haswell" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
72                <filteritem type="filename" name="TODO|INSTALL|go|LINGUAS|help|buildrpm|00main" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
73                <filteritem type="filename" name="ca0106|ChangeLog|gitcompile|Makevars|hda" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
74                <filteritem type="filename" name="map_test_case|default|test|info" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
75                <filteritem type="filepath" name="alsamixer/.*.h" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
76                <filteritem type="filepath" name="alsamixer/volume_mapping.c" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
77                <filteritem type="filepath" name="alsamixer/configparser.c" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
78                <filteritem type="filepath" name="alsamixer/curskey.c" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
79                <filteritem type="filepath" name="alsamixer/menu_widget.c" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
80                <filteritem type="filepath" name="alsamixer/mixer_clickable.c" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
81                <filteritem type="filepath" name="alsamixer/bindings.c" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
82                <filteritem type="filepath" name="include/gettext.h" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
83                <filteritem type="filepath" name="speaker-test/*.*" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
84                <filteritem type="filepath" name="include/gettext_curses.h" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
85                <filteritem type="filepath" name="alsactl/alsactl.h" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
86                <filteritem type="filepath" name="aplay/formats.h" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
87                <filteritem type="filepath" name="alsactl/alsactl_init.xml" desc="三方开源,不需检测文件头是否遗漏版权声明"/>
88            </filefilter>
89            <filefilter name="defaultPolicyFilter" desc="Filters for compatibility, license header policies">
90            </filefilter>
91	        <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies">
92            </filefilter>
93            <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies">
94            </filefilter>
95            <filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies">
96            </filefilter>
97            <filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies">
98            </filefilter>
99            <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
100            <filteritem type="filepath" name="speaker-test/samples/.*.wav" desc="binary files"/>
101            </filefilter>
102        </filefilterlist>
103    </oatconfig>
104</configuration>
105