Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 支持国际化 #26 #37

Merged
merged 23 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
92adccf
feat: 支持国际化 #26
brookylin Jan 13, 2023
2e4c75d
feat: 支持国际化 #26
eazence Jan 16, 2023
54f9dfb
feat: 支持国际化 #26
eazence Jan 16, 2023
4ff072f
feat: 支持国际化 #26
eazence Jan 17, 2023
37aad04
feat: 支持国际化 #26
eazence Jan 17, 2023
e2b72d0
Merge branch 'master' into i18n
eazence Feb 21, 2023
a8b3f9e
Merge branch 'i18n' into issue_26
eazence Feb 21, 2023
1d5dc27
Merge pull request #27 from eazence/issue_26
Yuanruitao Feb 22, 2023
e2ea5ae
feat: 支持国际化 #26
Yuanruitao Feb 22, 2023
2534e45
Merge pull request #32 from Yuanruitao/i18n
Yuanruitao Feb 22, 2023
8672942
feat: 支持国际化 #26
Yuanruitao Feb 22, 2023
d8c12bb
Merge branch 'TencentBlueKing:i18n' into i18n
Yuanruitao Feb 22, 2023
0c70a6c
Merge pull request #33 from Yuanruitao/i18n
Yuanruitao Feb 22, 2023
55eae35
feat: 支持国际化 #26
Yuanruitao Feb 22, 2023
6ae8c17
Merge branch 'i18n' of https://github.com/Yuanruitao/ci-CodeCCCheckAt…
Yuanruitao Feb 22, 2023
446772c
Merge branch 'TencentBlueKing:i18n' into i18n
Yuanruitao Feb 22, 2023
7407e28
Merge pull request #34 from Yuanruitao/i18n
Yuanruitao Feb 22, 2023
5165938
feat: 支持国际化 #26
Yuanruitao Feb 22, 2023
b662811
Merge branch 'i18n' of https://github.com/Yuanruitao/ci-CodeCCCheckAt…
Yuanruitao Feb 22, 2023
c34459d
Merge pull request #2 from TencentBlueKing/i18n
Yuanruitao Feb 22, 2023
a5d828e
Merge pull request #35 from Yuanruitao/i18n
Yuanruitao Feb 22, 2023
0f5c1a7
feat: 支持国际化 #26
Yuanruitao Feb 22, 2023
0e6f2fe
Merge pull request #36 from Yuanruitao/i18n
Yuanruitao Feb 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
build-root-directory: src/backend/core
gradle-version: 6.7.1
arguments: clean buildAndCopyZip -DmavenCredUserName=${{ secrets.NAME }} -DmavenCredPassword=${{ secrets.GITHUB_TOKEN }} -DmavenRepoUrl=http://maven.aliyun.com/nexus/content/groups/public/
arguments: clean buildZipWithEn -DmavenCredUserName=${{ secrets.NAME }} -DmavenCredPassword=${{ secrets.GITHUB_TOKEN }} -DmavenRepoUrl=http://maven.aliyun.com/nexus/content/groups/public/
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -59,7 +59,7 @@ jobs:
release_name: ${{ github.ref }}
draft: true
prerelease: true
- name: Upload Release Asset
- name: Upload ZH_CN Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -68,3 +68,12 @@ jobs:
asset_path: src/backend/core/build/distributions/CodeCCCheckAtom.zip
asset_name: CodeCCCheckAtom.zip
asset_content_type: application/zip
- name: Upload EN Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: src/backend/core/build/distributions/CodeCCCheckAtom_en.zip
asset_name: CodeCCCheckAtom_en.zip
asset_content_type: application/zip
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.codecc
.idea
.vscode
.vscode
target
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 32 additions & 6 deletions src/backend/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,47 @@ allprojects {
into "../../frontend/target/frontend"
}

task buildZip(type: Zip, dependsOn: [shadowJar, copyFrontend]) {
from "build/libs", "task.json", "quality.json", "../../frontend/target"
task cleanTarget(type:Delete) {
delete "../../../target"
}

task copyDocs(type:Copy) {
from "../../../docs"
into "../../../target/file/docs"
}

task copyImages(type:Copy) {
from "../../../images"
into "../../../target/file/images"
}

task buildZipCn(type: Zip, dependsOn: [shadowJar, copyFrontend, cleanTarget, copyDocs, copyImages]) {
from "build/libs", "task.json", "quality.json", "../../frontend/target", "../../../target"
into "CodeCCCheckAtom"
archiveName "CodeCCCheckAtom.zip"
}

task buildAndCopyZip(type: Copy, dependsOn: [buildZip]) {
from "build/distributions"
into "build/distributions"
task renameEnTaskJson(type:Copy) {
from "task_en.json"
into "../../../target/"
rename { String fileName ->
// a simple way is to remove the "-$version" from the jar filename
// but you can customize the filename replacement rule as you wish.
fileName = "CodeCCCheckAtom.zip"
fileName = "task.json"
}
}

task buildZipWithEn(type: Zip, dependsOn: [buildZipCn, renameEnTaskJson]) {
from "build/libs", "quality.json", "../../frontend/target", "../../../target"
into "CodeCCCheckAtom"
archiveName "CodeCCCheckAtom_en.zip"
}

// task buildAndCopyZip(type: Copy, dependsOn: [buildZipCn, buildZipEn]) {
// from "build/distributions"
// into "build/distributions"
// }

check.dependsOn ktlint

// 固定入口类 不要改
Expand Down
22 changes: 22 additions & 0 deletions src/backend/core/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,27 @@
"type": "string",
"description": "CodeCC任务是否运行成功,成功则未true,不然取不到"
}
},
"releaseInfo": {
"projectId": "demo",
"name": "CodeCC代码检查",
"language": "java",
"logoUrl": "${{indexFile(\"images/logo.png\")}}",
"category": "TASK",
"classifyCode": "scm",
"jobType": "AGENT",
"os": ["LINUX", "MACOS", "WINDOWS"],
"labelCodes": [],
"summary":"支持Linux、MacOS、Windows系统下执行所有CodeCC代码检查工具,包括代码缺陷(bkcheck等)、安全漏洞(敏感信息、高危组件等)、代码规范(CppLint、CheckStyle等)、圈复杂度、重复率等。",
"description": "${{indexFile(\"docs/aboutCodeCC.md\")}}",
"configInfo": {
"frontendType": "SPECIAL"
},
"versionInfo": {
"publisher": "admin",
"releaseType": "NEW",
"version": "1.0.0",
"versionContent": "Test"
}
}
}
268 changes: 268 additions & 0 deletions src/backend/core/task_en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"atomCode": "CodeCCCheckAtom",
"execution": {
"packagePath": "CodeCCCheckAtom.jar",
"language": "java",
"minimumVersion": "1.8",
"deFmands": [],
"target": "$bk_java_path -Dfile.encoding=utf8 -jar CodeCCCheckAtom.jar"
},
"input": {
"languages": {
"rule": {},
"type": "atom-checkbox-list",
"required": true,
"label": "Programming Language",
"list": [],
"default": [],
"desc": "tools will match different programming language",
"tabName": "basic"
},
"tools": {
"rule": {},
"required": true,
"hidden": true,
"type": "atom-checkbox-list",
"label": "Code Review Tool",
"list": [],
"default": [],
"tabName": "basic"
},
"asyncTask": {
"rule": {},
"type": "enum-input",
"label": "Sync Method",
"list": [
{
"value": false,
"label": "Synchronize"
},
{
"value": true,
"label": "Asynchronous"
}
],
"default": false,
"desc": "",
"tabName": "main",
"inline": true
},
"asyncTaskId": {
"rule": {
"asyncTaskRequired": true
},
"type": "task-select",
"label": "Task",
"required": true,
"tabName": "async",
"inline": true,
"list": {},
"default": "",
"rely": {},
"desc": "You can choose to create a task yourself in the CodeCC service, or you can directly enter the task ID. The task ID can be obtained from the CodeCC link (in /codecc/myproj/task/25324/, 25324 is the task ID). Support pipeline variables."
},
"goPath": {
"rule": {},
"type": "vuex-input",
"label": "GOPATH",
"default": "",
"required": false,
"desc": "Help find the code path of the dependent library to get a more useful result",
"placeholder": "Relative paths under {WORKSPACE}, please use comma to separate multiple paths, support pipeline variables",
"tabName": "basic",
"inline": true,
"rely": {
"operation": "AND",
"expression": [
{
"key": "tools",
"value": "GOML"
}
]
}
},
"pyVersion": {
"rule": {},
"type": "enum-input",
"label": "Python Version",
"required": true,
"list": [
{
"label": "Python2",
"value": "py2"
},
{
"label": "Python3",
"value": "py3"
}
],
"default": "py3",
"tabName": "basic",
"inline": true,
"rely": {
"operation": "AND",
"expression": [
{
"key": "tools",
"value": "PYLINT"
}
]
}
},
"scriptType": {
"rule": {},
"type": "enum-input",
"label": "Script Type",
"required": true,
"hidden": false,
"list": [
{
"id": "sh",
"value": "SHELL",
"label": "Shell"
}
],
"default": "SHELL",
"tabName": "basic",
"lang": "sh",
"inline": true
},
"script": {
"rule": {
"scriptRequired": true
},
"label": "Script",
"hidden": false,
"default": "#Coverity/Klocwork will compile your code by calling the compilation script to identify defects\n# Please use build tools such as maven/cmake to write a compilation script build.sh\n# Make sure build.sh can compile the code\n# cd path/to/build.sh\n# sh build.sh",
"required": true,
"type": "atom-ace-editor",
"desc": "The corresponding tool will use this script to compile the code in order to track the compilation process and find code defects",
"tabName": "basic"
},
"languageRuleSetMap": {
"hidden": true,
"default": {}
},
"C_CPP_RULE": {
"rule": {
"ruleSetRequired": true
},
"type": "rule-set-select",
"label": "C/C++",
"required": true,
"tabName": "basic",
"inline": true,
"list": {},
"default": [],
"rely": {
"operation": "AND",
"expression": [
{
"key": "languages",
"value": "C_CPP"
}
]
}
},
"multiPipelineMark": {
"rule": {},
"label": "label",
"placeholder": "Optional. Only numbers, letters, and underscores are supported.",
"type": "vuex-input",
"default": "",
"tabName": "basic",
"desc": "If the pipeline has multiple code analysis plugins, a label can be used to distinguish them.",
"inline": true
},
"toolScanType": {
"rule": {},
"type": "radio-group",
"label": "Scan Method",
"required": true,
"list": [
{
"label": "Incremental Scan(recommended)",
"value": "1"
},
{
"label": "MR/PR Scan",
"value": "2"
},
{
"label": "Full Scan",
"value": "0"
}
],
"default": "1",
"desc": "Incremental scan: Scan the difference code between current build and previous build. Full scan will be used in the first time.\nMR/PR Scan: Scan the difference code between the source branch and the target branch of MR/PR. The source branch code needs to be pulled to the workspace\nFull Scan: Scan all codes. Klocwork, Pinpoint, Gometalinter, and repetition rate only support this scanning method."
},
"mrCommentEnable": {
"label": "",
"default": true,
"type": "atom-checkbox",
"text": "Sync the defect info to Tencent internal Git viewing page"
},
"newDefectJudgeFromDate": {
"default": "",
"label": "New Alerts Threshold",
"desc": "Alerts sent after the selected date are New Alerts"
},
"transferAuthorList": {
"default": [],
"type": "author-transfer",
"label": "change owner",
"desc": "Alerts will sent to the new owner when the tools's ownership changed "
},
"path": {
"default": [],
"type": "item-edit"
},
"customPath": {
"default": [],
"type": "item-edit"
},
"openScanPrj": {
"label": "",
"default": false,
"placeholder": "",
"type": "atom-checkbox",
"text": "use open sourced tool to scan project",
"desc": "Use open sourced scanning tool when selected",
"required": false,
"disabled": false,
"hidden": true
}
},
"output": {
"BK_CI_CODECC_TASK_ID": {
"type": "string",
"description": "CodeCC task id"
},
"BK_CI_CODECC_TASK_STATUS": {
"type": "string",
"description": "Whether the CodeCC task runs successfully"
}
},
"releaseInfo": {
"projectId": "demo",
"name": "CodeCC Code Check",
"language": "java",
"logoUrl": "${{indexFile(\"images/logo.png\")}}",
"category": "TASK",
"classifyCode": "scm",
"jobType": "AGENT",
"os": ["LINUX", "MACOS", "WINDOWS"],
"labelCodes": [],
"summary":"Support all CodeCC code inspection tools under Linux, MacOS, and Windows systems, including code defects (bkcheck, etc.), security vulnerabilities (sensitive information, high-risk components, etc.), code specifications (CppLint, CheckStyle, etc.), cyclomatic complexity, repetition rate, etc. .",
"description": "${{indexFile(\"docs/aboutCodeCC_en.md\")}}",
"configInfo": {
"frontendType": "SPECIAL"
},
"versionInfo": {
"publisher": "admin",
"releaseType": "NEW",
"version": "1.0.0",
"versionContent": "Test"
}
}
}
Loading