Skip to content

Commit 6107991

Browse files
committed
[重构项目结构并改进构建与CI配置]: 将源码统一迁移到 src/ 目录,添加通用 CMake 模块,清理旧示例目录,并更新 CI 与工具配置以提升项目可维护性和构建效率
-**源码迁移**: 将 Breakpad、Crashpad、MonitorDir、Thread 和 utils 等子项目及实现统一迁移到 src/ 目录,实现目录扁平化 -**CMake 模块**: 新增 ArchitectureDetection、CompilerSettings 和 VcpkgToolchain 等通用 CMake 模块,统一构建配置并支持跨平台编译 -**CI 与工具配置**: 更新 build.yml、codeql.yml 和 clean_cache.yml 等 GitHub Actions 工作流,删除旧 cpp_linter.yml,调整 .clang-format 和 .gitignore 以适配新结构 -**新增功能模块**: 添加 OpenSSL 子模块(AES/BASE64/hash/rsa 等)和 Memcpy 实现(mymemcpy 与单元测试),丰富核心功能 -**清理与优化**: 删除 Algorithm、DesignPattern、Curl 和 Server 等旧示例目录,移除冗余文件,并更新 README.md 和 vcpkg.json 以反映新结构 -**脚本与构建**: 新增 Enter-VsDevShell.ps1 Windows 开发环境脚本,删除旧 setVsDev.ps1,重构顶层和子目录 CMakeLists.txt 以支持 src/ 新布局
1 parent 0305275 commit 6107991

File tree

167 files changed

+5859
-7879
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+5859
-7879
lines changed

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ FixNamespaceComments: true
5555
ForEachMacros:
5656
- forever
5757
- foreach
58+
- Q_FOREACH
5859
- BOOST_FOREACH
5960
IncludeBlocks: Preserve
6061
IncludeCategories:
@@ -105,5 +106,8 @@ SpacesInCStyleCastParentheses: false
105106
SpacesInContainerLiterals: false
106107
SpacesInParentheses: false
107108
SpacesInSquareBrackets: false
109+
StatementMacros:
110+
- Q_UNUSED
111+
- QT_REQUIRE_VERSION
108112
TabWidth: 4
109113
UseTab: Never

.github/workflows/build.yml

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
name: CMake Build
1+
name: CMake build and test
22

3-
on:
3+
on:
44
push:
5-
paths-ignore:
6-
- '.clang*'
7-
- '.gitignore'
8-
- 'LICENSE'
9-
- 'README*'
5+
paths-ignore:
6+
- 'docs/**'
7+
- '**/*.md'
8+
- '**/*.txt'
9+
- '**/.clang-*'
10+
- '**/.gitignore'
11+
- '**/LICENSE*'
12+
- '**/README*'
1013
pull_request:
11-
paths-ignore:
12-
- '.clang*'
13-
- '.gitignore'
14-
- 'LICENSE'
15-
- 'README*'
14+
paths-ignore:
15+
- 'docs/**'
16+
- '**/*.md'
17+
- '**/*.txt'
18+
- '**/.clang-*'
19+
- '**/.gitignore'
20+
- '**/LICENSE*'
21+
- '**/README*'
22+
23+
env:
24+
BUILD_DIR: build
25+
BUILD_TYPE: RelWithDebInfo
1626

1727
jobs:
1828
build:
@@ -25,11 +35,6 @@ jobs:
2535
- windows-latest
2636
- macos-latest
2737
- ubuntu-latest
28-
build_type:
29-
- "Debug"
30-
- "Release"
31-
- "MinSizeRel"
32-
- "RelWithDebInfo"
3338
generators:
3439
- "Ninja"
3540

@@ -44,27 +49,27 @@ jobs:
4449
if: startsWith(matrix.os, 'windows')
4550
shell: pwsh
4651
run: |
47-
.\scripts\windows\setVsDev.ps1
52+
.\packaging\windows\Enter-VsDevShell.ps1
4853
cmake `
4954
-S . `
50-
-B ./build `
51-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
55+
-B "${{ env.BUILD_DIR }}" `
56+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
5257
-G "${{ matrix.generators }}" `
5358
; if (-not $?) { Get-Content ./build/vcpkg_installed/vcpkg/issue_body.md; exit 1 }
54-
cmake --build ./build --config ${{ matrix.build_type }}
59+
cmake --build "${{ env.BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}
5560
- name: Configure and build macos or ubuntu
5661
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
5762
shell: bash
5863
run: |
5964
cmake \
6065
-S . \
61-
-B ./build \
62-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
66+
-B "${{ env.BUILD_DIR }}" \
67+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
6368
-G "${{ matrix.generators }}" \
6469
|| (cat ./build/vcpkg_installed/vcpkg/issue_body.md && exit 1)
65-
cmake --build ./build --config ${{ matrix.build_type }}
70+
cmake --build "${{ env.BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}
6671
67-
- name: Test
72+
- name: Run tests
6873
shell: bash
69-
run: cd build && ctest -C ${{ matrix.build_type }} --output-on-failure
74+
run: cd build && ctest -C ${{ env.BUILD_TYPE }} --output-on-failure
7075

.github/workflows/clean_cache.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Cleanup caches by a branch
22
on:
3+
# 每周一 0 点触发
4+
schedule:
5+
- cron: '0 0 * * 1'
36
workflow_dispatch:
47

58
jobs:

.github/workflows/codeql.yml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,43 @@
11
name: CodeQL
22

3-
on:
3+
on:
44
push:
5-
paths-ignore:
6-
- '.clang*'
7-
- '.gitignore'
8-
- 'LICENSE'
9-
- 'README*'
5+
paths-ignore:
6+
- 'docs/**'
7+
- 'packaging/**'
8+
- 'qmake/**'
9+
- 'translations/**'
10+
- '**/*.md'
11+
- '**/*.txt'
12+
- '**/.clang-*'
13+
- '**/.gitignore'
14+
- '**/*.pri'
15+
- '**/LICENSE*'
16+
- '**/*.pro'
17+
- '**/README*'
1018
branches-ignore:
1119
- 'dependabot/**'
12-
1320
pull_request:
14-
paths-ignore:
15-
- '.clang*'
16-
- '.gitignore'
17-
- 'LICENSE'
18-
- 'README*'
21+
paths-ignore:
22+
- 'docs/**'
23+
- 'packaging/**'
24+
- 'qmake/**'
25+
- 'translations/**'
26+
- '**/*.md'
27+
- '**/*.txt'
28+
- '**/.clang-*'
29+
- '**/.gitignore'
30+
- '**/*.pri'
31+
- '**/LICENSE*'
32+
- '**/*.pro'
33+
- '**/README*'
1934
branches-ignore:
2035
- 'dependabot/**'
21-
36+
2237
schedule:
2338
- cron: '0 0 1 * *'
2439
workflow_dispatch:
2540

26-
2741
jobs:
2842
CodeQL:
2943
runs-on: ubuntu-latest
@@ -36,13 +50,13 @@ jobs:
3650
- uses: ./.github/actions/install-dependencies
3751

3852
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@v3
53+
uses: github/codeql-action/init@v4
4054
with:
4155
languages: cpp
4256

4357
- name: Autobuild
44-
uses: github/codeql-action/autobuild@v3
58+
uses: github/codeql-action/autobuild@v4
4559

4660
- name: Perform CodeQL Analysis
47-
uses: github/codeql-action/analyze@v3
61+
uses: github/codeql-action/analyze@v4
4862

.github/workflows/cpp_linter.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/delete_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242
required: false
4343

4444
jobs:
45-
del_runs:
45+
delete-workflow-runs:
4646
runs-on: ubuntu-latest
4747
permissions:
4848
actions: write

.github/workflows/readme.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ on:
99
- README.md
1010

1111
jobs:
12-
build:
12+
Translate:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v5
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v5
16+
- uses: actions/setup-node@v6
1817
# ISO Langusge Codes: https://cloud.google.com/translate/docs/languages
1918
- name: Adding README - English
2019
uses: dephraiim/translate-readme@main

0 commit comments

Comments
 (0)