17a9a4b8fSopenharmony_ci<?xml version="1.0" encoding="UTF-8"?> 27a9a4b8fSopenharmony_ci<!-- Copyright (c) 2021 Huawei Device Co., Ltd. 37a9a4b8fSopenharmony_ci 47a9a4b8fSopenharmony_ci Licensed under the Apache License, Version 2.0 (the "License"); 57a9a4b8fSopenharmony_ci you may not use this file except in compliance with the License. 67a9a4b8fSopenharmony_ci You may obtain a copy of the License at 77a9a4b8fSopenharmony_ci 87a9a4b8fSopenharmony_ci http://www.apache.org/licenses/LICENSE-2.0 97a9a4b8fSopenharmony_ci 107a9a4b8fSopenharmony_ci Unless required by applicable law or agreed to in writing, software 117a9a4b8fSopenharmony_ci distributed under the License is distributed on an "AS IS" BASIS, 127a9a4b8fSopenharmony_ci WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 137a9a4b8fSopenharmony_ci See the License for the specific language governing permissions and 147a9a4b8fSopenharmony_ci limitations under the License. 157a9a4b8fSopenharmony_ci 167a9a4b8fSopenharmony_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. 177a9a4b8fSopenharmony_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. 187a9a4b8fSopenharmony_ci 197a9a4b8fSopenharmony_ci licensefile: 207a9a4b8fSopenharmony_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. 217a9a4b8fSopenharmony_ci 227a9a4b8fSopenharmony_ci policylist: 237a9a4b8fSopenharmony_ci 1. policy: If the OAT-Default.xml policies do not meet your requirements, please add policies here. 247a9a4b8fSopenharmony_ci 2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is: 257a9a4b8fSopenharmony_ci <policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/> 267a9a4b8fSopenharmony_ci 3. policyitem type: 277a9a4b8fSopenharmony_ci "compatibility" is used to check license compatibility in the specified path; 287a9a4b8fSopenharmony_ci "license" is used to check source license header in the specified path; 297a9a4b8fSopenharmony_ci "copyright" is used to check source copyright header in the specified path; 307a9a4b8fSopenharmony_ci "import" is used to check source dependency in the specified path, such as import ... ,include ... 317a9a4b8fSopenharmony_ci "filetype" is used to check file type in the specified path, supported file types: archive, binary 327a9a4b8fSopenharmony_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 337a9a4b8fSopenharmony_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. 347a9a4b8fSopenharmony_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. 357a9a4b8fSopenharmony_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. 367a9a4b8fSopenharmony_ci 7. policyitem filefilter: Used to bind filefilter which define filter rules. 377a9a4b8fSopenharmony_ci 7. policyitem desc: Used to describe the reason of this policy item, committers will check this while merging the code. 387a9a4b8fSopenharmony_ci 8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path. 397a9a4b8fSopenharmony_ci 407a9a4b8fSopenharmony_ci Note:If the text contains special characters, please escape them according to the following rules: 417a9a4b8fSopenharmony_ci " == " 427a9a4b8fSopenharmony_ci & == & 437a9a4b8fSopenharmony_ci ' == ' 447a9a4b8fSopenharmony_ci < == < 457a9a4b8fSopenharmony_ci > == > 467a9a4b8fSopenharmony_ci--> 477a9a4b8fSopenharmony_ci 487a9a4b8fSopenharmony_ci<configuration> 497a9a4b8fSopenharmony_ci <oatconfig> 507a9a4b8fSopenharmony_ci <licensefile></licensefile> 517a9a4b8fSopenharmony_ci <policylist> 527a9a4b8fSopenharmony_ci <policy name="projectPolicy" desc=""> 537a9a4b8fSopenharmony_ci <!--policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process."/--> 547a9a4b8fSopenharmony_ci <!--policyitem type="license" name="LGPL" path=".*" desc="Dynamically linked by module X"/--> 557a9a4b8fSopenharmony_ci <!--policyitem type="copyright" name="xxx" path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by X Company"/--> 567a9a4b8fSopenharmony_ci </policy> 577a9a4b8fSopenharmony_ci </policylist> 587a9a4b8fSopenharmony_ci 597a9a4b8fSopenharmony_ci <filefilterlist> 607a9a4b8fSopenharmony_ci <filefilter name="defaultFilter" desc="Files not to check"> 617a9a4b8fSopenharmony_ci <filteritem type="filename" name="*.iml|*.json|*.txt" desc="desc files"/> 627a9a4b8fSopenharmony_ci <filteritem type="filepath" name="target/.*" desc="Compile output files"/> 637a9a4b8fSopenharmony_ci <filteritem type="filepath" name="out/.*" desc="Compile output files"/> 647a9a4b8fSopenharmony_ci <filteritem type="filepath" name="log/.*" desc="log files"/> 657a9a4b8fSopenharmony_ci <filteritem type="filepath" name=".idea/.*" desc="IDE temp files"/> 667a9a4b8fSopenharmony_ci <filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/> 677a9a4b8fSopenharmony_ci <filteritem type="filepath" name="src/test/.*" desc="Test files"/> 687a9a4b8fSopenharmony_ci </filefilter> 697a9a4b8fSopenharmony_ci <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies"> 707a9a4b8fSopenharmony_ci <filteritem type="filepath" name="src/main/java/ohos/oat/analysis/headermatcher/.*" desc="License matcher rules, not license header"/> 717a9a4b8fSopenharmony_ci </filefilter> 727a9a4b8fSopenharmony_ci <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies"> 737a9a4b8fSopenharmony_ci </filefilter> 747a9a4b8fSopenharmony_ci <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies"> 757a9a4b8fSopenharmony_ci </filefilter> 767a9a4b8fSopenharmony_ci <filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies"> 777a9a4b8fSopenharmony_ci </filefilter> 787a9a4b8fSopenharmony_ci <filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies"> 797a9a4b8fSopenharmony_ci </filefilter> 807a9a4b8fSopenharmony_ci <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies"> 817a9a4b8fSopenharmony_ci <filteritem type="filepath" name="figures/en-us_image001.png" desc="self developed image"/> 827a9a4b8fSopenharmony_ci <filteritem type="filepath" name="figures/zh-cn_image001.png" desc="self developed image"/> 837a9a4b8fSopenharmony_ci </filefilter> 847a9a4b8fSopenharmony_ci </filefilterlist> 857a9a4b8fSopenharmony_ci </oatconfig> 867a9a4b8fSopenharmony_ci</configuration> 87