forked from TencentBlueKing/bk-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
蓝盾DevOps体系下孵化项目迁移事项 TencentBlueKing#8042
使用更快的gradle-license-report插件 对一些协议的全称写法不同,导致造成识别上的差异而失败需要进行补充允许, 以及对一些特殊的包进行说明和手动豁免
- Loading branch information
Showing
8 changed files
with
93,258 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/backend/ci/buildSrc/src/main/kotlin/plugins/task-license-report.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import com.github.jk1.license.render.TextReportRenderer | ||
|
||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
plugins { | ||
id("com.github.jk1.dependency-license-report") | ||
} | ||
|
||
licenseReport { | ||
excludeGroups = arrayOf( | ||
"com.tencent.bk.devops.ci", | ||
"com.tencent.bk.devops.turbo", | ||
"com.tencent.bk.repo", | ||
"com.tencent.bk.sdk", | ||
"com.tencent.devops", | ||
"com.tencent.devops.leaf" | ||
) | ||
// Don't include artifacts of project's own group into the report | ||
excludeOwnGroup = true | ||
|
||
// exclude bom dependencies. If set to true, then all boms will be excluded from the report | ||
excludeBoms = true | ||
|
||
// 第三方依赖license声明 | ||
renderers = arrayOf(TextReportRenderer(/* filename = */ "THIRD-PARTY-NOTICES.txt")) | ||
|
||
// 对一些协议的全称写法不同,导致造成识别上的差异而失败需要进行补充允许, 以及对一些特殊的包进行说明和手动豁免 | ||
allowedLicensesFile = File("${rootProject.projectDir}/buildSrc/src/main/resources/allowed-licenses.json") | ||
} | ||
|
||
tasks.register("weCheckLicense") { | ||
group = "checking" | ||
this.dependsOn("checkLicense") | ||
doLast { // 检查结束后, 将第三方依赖项license复制到release目录, 以便随包发行 | ||
println("weCheckLicense: copy THIRD-PARTY-NOTICES.txt to release") | ||
File(/* pathname = */ "${rootProject.projectDir}/build/reports/dependency-license/THIRD-PARTY-NOTICES.txt") | ||
.renameTo(File(/* pathname = */ "${rootProject.projectDir}/release/THIRD-PARTY-NOTICES.txt")) | ||
} | ||
} | ||
|
||
tasks.getByName("classes").dependsOn("weCheckLicense") |
Oops, something went wrong.