11ebd3d54Sopenharmony_ci<?xml version="1.0" encoding="UTF-8"?>
21ebd3d54Sopenharmony_ci<!-- Copyright (c) 2022 Huawei Device Co., Ltd.
31ebd3d54Sopenharmony_ci
41ebd3d54Sopenharmony_ci     Licensed under the Apache License, Version 2.0 (the "License");
51ebd3d54Sopenharmony_ci     you may not use this file except in compliance with the License.
61ebd3d54Sopenharmony_ci     You may obtain a copy of the License at
71ebd3d54Sopenharmony_ci
81ebd3d54Sopenharmony_ci          http://www.apache.org/licenses/LICENSE-2.0
91ebd3d54Sopenharmony_ci
101ebd3d54Sopenharmony_ci     Unless required by applicable law or agreed to in writing, software
111ebd3d54Sopenharmony_ci     distributed under the License is distributed on an "AS IS" BASIS,
121ebd3d54Sopenharmony_ci     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131ebd3d54Sopenharmony_ci     See the License for the specific language governing permissions and
141ebd3d54Sopenharmony_ci     limitations under the License.
151ebd3d54Sopenharmony_ci
161ebd3d54Sopenharmony_ci    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.
171ebd3d54Sopenharmony_ci    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.
181ebd3d54Sopenharmony_ci
191ebd3d54Sopenharmony_ci    licensefile:
201ebd3d54Sopenharmony_ci    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.
211ebd3d54Sopenharmony_ci
221ebd3d54Sopenharmony_ci    policylist:
231ebd3d54Sopenharmony_ci    1. policy: If the OAT-Default.xml policies do not meet your requirements, please add policies here.
241ebd3d54Sopenharmony_ci    2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
251ebd3d54Sopenharmony_ci    <policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
261ebd3d54Sopenharmony_ci    3. policyitem type:
271ebd3d54Sopenharmony_ci        "compatibility" is used to check license compatibility in the specified path;
281ebd3d54Sopenharmony_ci        "license" is used to check source license header in the specified path;
291ebd3d54Sopenharmony_ci        "copyright" is used to check source copyright header in the specified path;
301ebd3d54Sopenharmony_ci        "import" is used to check source dependency in the specified path, such as import ... ,include ...
311ebd3d54Sopenharmony_ci        "filetype" is used to check file type in the specified path, supported file types: archive, binary
321ebd3d54Sopenharmony_ci        "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
331ebd3d54Sopenharmony_ci    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.
341ebd3d54Sopenharmony_ci    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.
351ebd3d54Sopenharmony_ci    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.
361ebd3d54Sopenharmony_ci    7. policyitem filefilter: Used to bind filefilter which define filter rules.
371ebd3d54Sopenharmony_ci    7. policyitem desc: Used to describe the reason of this policy item, committers will check this while merging the code.
381ebd3d54Sopenharmony_ci    8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
391ebd3d54Sopenharmony_ci
401ebd3d54Sopenharmony_ci    Note:If the text contains special characters, please escape them according to the following rules:
411ebd3d54Sopenharmony_ci    " == &quot;
421ebd3d54Sopenharmony_ci    & == &amp;
431ebd3d54Sopenharmony_ci    ' == &apos;
441ebd3d54Sopenharmony_ci    < == &lt;
451ebd3d54Sopenharmony_ci    > == &gt;
461ebd3d54Sopenharmony_ci-->
471ebd3d54Sopenharmony_ci
481ebd3d54Sopenharmony_ci<configuration>
491ebd3d54Sopenharmony_ci    <oatconfig>
501ebd3d54Sopenharmony_ci        <licensefile></licensefile>
511ebd3d54Sopenharmony_ci        <policylist>
521ebd3d54Sopenharmony_ci            <policy name="projectPolicy" desc="">
531ebd3d54Sopenharmony_ci                <!--policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process."/-->
541ebd3d54Sopenharmony_ci                <!--policyitem type="license" name="LGPL" path=".*" desc="Dynamically linked by module X"/-->
551ebd3d54Sopenharmony_ci                <!--policyitem type="copyright" name="xxx" path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by X Company"/-->
561ebd3d54Sopenharmony_ci            </policy>
571ebd3d54Sopenharmony_ci        </policylist>
581ebd3d54Sopenharmony_ci
591ebd3d54Sopenharmony_ci        <filefilterlist>
601ebd3d54Sopenharmony_ci            <filefilter name="defaultFilter" desc="Files not to check">
611ebd3d54Sopenharmony_ci                <filteritem type="filename" name="*.iml|*.json|*.txt" desc="desc files"/>
621ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="target/.*" desc="Compile output files"/>
631ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="out/.*" desc="Compile output files"/>
641ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="log/.*" desc="log files"/>
651ebd3d54Sopenharmony_ci                <filteritem type="filepath" name=".idea/.*" desc="IDE temp files"/>
661ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/>
671ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="src/test/.*" desc="Test files"/>
681ebd3d54Sopenharmony_ci            </filefilter>
691ebd3d54Sopenharmony_ci            <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
701ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="src/main/java/ohos/oat/analysis/headermatcher/.*" desc="License matcher rules, not license header"/>
711ebd3d54Sopenharmony_ci            </filefilter>
721ebd3d54Sopenharmony_ci            <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies">
731ebd3d54Sopenharmony_ci            </filefilter>
741ebd3d54Sopenharmony_ci            <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies">
751ebd3d54Sopenharmony_ci            </filefilter>
761ebd3d54Sopenharmony_ci            <filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies">
771ebd3d54Sopenharmony_ci            </filefilter>
781ebd3d54Sopenharmony_ci            <filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies">
791ebd3d54Sopenharmony_ci            </filefilter>
801ebd3d54Sopenharmony_ci            <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
811ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="figures/zh-cn_image_0000001115940671.png" desc="self developed image"/>
821ebd3d54Sopenharmony_ci                <filteritem type="filepath" name="figures/en-us_image_0000001115940671.png" desc="self developed image"/>
831ebd3d54Sopenharmony_ci            </filefilter>
841ebd3d54Sopenharmony_ci        </filefilterlist>
851ebd3d54Sopenharmony_ci    </oatconfig>
861ebd3d54Sopenharmony_ci</configuration>
87