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     Notes:
17     This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun.
18-->
19<!-- OAT(OSS Audit Tool) configuration guide:
20basedir: Root dir, the basedir + project path is the real source file location.
21licensefile:
221.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.
23
24tasklist(only for batch mode):
251. task: Define oat check thread, each task will start a new thread.
262. task name: Only an name, no practical effect.
273. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
284. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
295. task project: Projects to be checked, the path field define the source root dir of the project.
30
31
32policyList:
331. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
342. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
35<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
363. policyitem type:
37    "compatibility" is used to check license compatibility in the specified path;
38    "license" is used to check source license header in the specified path;
39    "copyright" is used to check source copyright header in the specified path;
40    "import" is used to check source dependency in the specified path, such as import ... ,include ...
41    "filetype" is used to check file type in the specified path, supported file types: archive, binary
42    "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
43
444. 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. 
455. 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.
466. 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.
477. policyitem filefilter: Used to bind filefilter which define filter rules.
488. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
49
50Note:If the text contains special characters, please escape them according to the following rules:
51" == &gt;
52& == &gt;
53' == &gt;
54< == &gt;
55> == &gt;
56-->
57
58<configuration>
59    <oatconfig>
60        <licensefile>LICENSE</licensefile>
61        <policylist>
62            <policy name="projectPolicy" desc="">
63                <policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="实际为GPL 2.0 with SANE Exception"/>
64                <policyitem type="compatibility" name="GPLStyleLicense" path=".*" desc="实际为GPL 2.0 with SANE Exception"/>
65                <policyitem type="compatibility" name="JPEG License" path=".*" desc="JPEG"/>
66                <policyitem type="compatibility" name="public domain" path=".*" desc="public domain"/>
67            </policy>
68        </policylist>
69        <filefilterlist>
70            <filefilter name="defaultPolicyFilter" desc="Filters for compatibility, license header policies">
71                <filteritem type="filename" name="git-version-gen" desc="git version check script"/>
72                <filteritem type="filename" name="README*|*.po|*.am|*.sh|INSTALL*|*change*|*.desc|*.ref|Makevars|*.man" desc="README"/>
73                <filteritem type="filepath" name="backend/epson2-cct.c" desc="本文件不使用"/>
74                <filteritem type="filepath" name="lib/snprintf.c" desc="本文件不使用"/>
75                <filteritem type="filepath" name="tools/hotplug-ng/libsane.hotplug" desc="插件"/>
76            </filefilter>
77            <filefilter name="binaryFileTypePolicyFilter" desc="Filters for compatibility, license header policies">
78                <filteritem type="filename" name="*.jpg" desc="jpg build files, not used"/>
79                <filteritem type="filename" name="*.png" desc="png build files, not used"/>
80            </filefilter>
81        </filefilterlist>
82        <licensematcherlist>
83            <licensematcher name="GPL 2.0 with SANE Exception" desc="SANE Exception description">
84                <licensetext name="
85                    This program is free software; you can redistribute it and/or
86                    modify it under the terms of the GNU General Public License as
87                    published by the Free Software Foundation; either version 2 of the
88                    License, or (at your option) any later version.
89
90                    This program is distributed in the hope that it will be useful, but
91                    WITHOUT ANY WARRANTY; without even the implied warranty of
92                    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
93                    General Public License for more details.
94
95                    You should have received a copy of the GNU General Public License
96                    along with this program.  If not, see &lt;https://www.gnu.org/licenses/&gt;.
97
98                    As a special exception, the authors of SANE give permission for
99                    additional uses of the libraries contained in this release of SANE.
100
101                    The exception is that, if you link a SANE library with other files
102                    to produce an executable, this does not by itself cause the
103                    resulting executable to be covered by the GNU General Public
104                    License.  Your use of that executable is in no way restricted on
105                    account of linking the SANE library code into it.
106
107                    This exception does not, however, invalidate any other reasons why
108                    the executable file might be covered by the GNU General Public
109                    License.
110
111                    If you submit changes to SANE to the maintainers to be included in
112                    a subsequent release, you agree by submitting the changes that
113                    those changes may be distributed with this exception intact.
114
115                    If you write modifications of your own for SANE, it is your choice
116                    whether to permit this exception to apply to your modifications.
117                    If you do not wish that, delete this exception notice.
118				 " desc="SANE exception description"/>
119            </licensematcher>
120            <licensematcher name="JPEG License" desc="JPEG description">
121                <licensetext name="
122                    This file is part of the Independent JPEG Group's software
123				 " desc=""/>
124            </licensematcher>
125            <licensematcher name="public domain" desc="JPEG description">
126                <licensetext name="
127                    This file is in the public domain.  You may use and modify it as
128   you see fit, as long as this copyright message is included and
129   that there is an indication as to what modifications have been
130   made (if any).
131				 " desc=""/>
132            </licensematcher>
133        </licensematcherlist>
134    </oatconfig>
135</configuration>
136