Skip to content

Commit fdde618

Browse files
committed
[refactor]: 项目结构重构与构建系统升级
- **项目结构重组**: 将所有示例模块移至src目录,统一管理源代码 - **构建系统现代化**: 全面升级CMake配置,引入模块化架构检测和跨平台输出目录管理 - **Qt版本升级**: 从6.9.2升级到6.10.0,移除已弃用的QtCharts模块依赖 - **CI/CD优化**: 重构GitHub Actions工作流,改进条件判断和构建矩阵配置 - **跨平台支持增强**: 完善macOS通用二进制构建,明确设置部署目标为13.0 - **QMake配置统一**: 引入标准化项目设置文件,统一编译器标志和架构检测 - **文档同步更新**: 调整README中的示例路径说明,反映新的目录结构 - **开发体验改进**: 更新.gitignore排除规则和VS Code配置,优化调试信息输出
1 parent 498dafe commit fdde618

362 files changed

Lines changed: 1929 additions & 346 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ StatementMacros:
110110
- Q_UNUSED
111111
- QT_REQUIRE_VERSION
112112
TabWidth: 4
113-
UseTab: Never
113+
UseTab: Never

.github/actions/install-dependencies/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ inputs:
44
qt_modules:
55
description: 'qt modules'
66
required: false
7-
default: 'qtcharts qt5compat qtnetworkauth qtimageformats'
7+
default: 'qt5compat qtnetworkauth qtimageformats'
88
type: string
99
qt_ver:
1010
description: 'qt version'
1111
required: false
12-
default: '6.9.2'
12+
default: '6.10.0'
1313
type: string
1414

1515
runs:

.github/workflows/cmake.yml

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
11
name: CMake Build
22

3-
on:
3+
on:
44
push:
5-
paths-ignore:
6-
- '**/picture/**'
7-
- 'packaging/**'
8-
- '.clang-*'
9-
- '.gitignore'
10-
- 'LICENSE'
11-
- '*.pro'
12-
- '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*'
1318
pull_request:
14-
paths-ignore:
15-
- '**/picture/**'
16-
- 'packaging/**'
17-
- '.clang-*'
18-
- '.gitignore'
19-
- 'LICENSE'
20-
- '*.pro'
21-
- 'README*'
19+
paths-ignore:
20+
- 'docs/**'
21+
- 'packaging/**'
22+
- 'qmake/**'
23+
- 'translations/**'
24+
- '**/*.md'
25+
- '**/*.txt'
26+
- '**/.clang-*'
27+
- '**/.gitignore'
28+
- '**/*.pri'
29+
- '**/LICENSE*'
30+
- '**/*.pro'
31+
- '**/README*'
32+
33+
env:
34+
MACOSX_DEPLOYMENT_TARGET: '13.0'
35+
MACOSX_BUILD_ARCHS: 'x86_64;arm64'
36+
BUILD_DIR: build
37+
BUILD_TYPE: RelWithDebInfo
2238

2339
jobs:
2440
build:
@@ -31,8 +47,6 @@ jobs:
3147
- windows-latest
3248
- macos-latest
3349
- ubuntu-latest
34-
build_type:
35-
- "RelWithDebInfo"
3650
generators:
3751
- "Ninja"
3852

@@ -44,23 +58,36 @@ jobs:
4458
- uses: ./.github/actions/install-dependencies
4559

4660
- name: Configure and build windows
47-
if: startsWith(matrix.os, 'windows')
61+
if: runner.os == 'Windows'
4862
shell: pwsh
4963
run: |
5064
.\packaging\windows\Enter-VsDevShell.ps1
5165
cmake `
5266
-S . `
53-
-B ./build `
54-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
67+
-B "${{ env.BUILD_DIR }}" `
68+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
69+
-G "${{ matrix.generators }}"
70+
cmake --build "${{ env.BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}
71+
72+
- name: Configure and build ubuntu
73+
if: runner.os == 'Linux'
74+
shell: bash
75+
run: |
76+
cmake \
77+
-S . \
78+
-B "${{ env.BUILD_DIR }}" \
79+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
5580
-G "${{ matrix.generators }}"
56-
cmake --build ./build --config ${{ matrix.build_type }}
57-
- name: Configure and build on ubuntu or macos
58-
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
81+
cmake --build "${{ env.BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}
82+
83+
- name: Configure and build macos
84+
if: runner.os == 'macOS'
5985
shell: bash
6086
run: |
6187
cmake \
6288
-S . \
63-
-B ./build \
64-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
89+
-B "${{ env.BUILD_DIR }}" \
90+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
91+
-DCMAKE_OSX_ARCHITECTURES="${{ env.MACOSX_BUILD_ARCHS }}" \
6592
-G "${{ matrix.generators }}"
66-
cmake --build ./build --config ${{ matrix.build_type }}
93+
cmake --build "${{ env.BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}

.github/workflows/codeql.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
11
name: CodeQL
22

3-
on:
3+
on:
44
push:
5-
paths-ignore:
6-
- '**/picture/**'
7-
- 'packaging/**'
8-
- '.clang-*'
9-
- '.gitignore'
10-
- 'LICENSE'
11-
- '*.pro'
12-
- '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*'
1318
branches-ignore:
1419
- 'dependabot/**'
1520
pull_request:
16-
paths-ignore:
17-
- '**/picture/**'
18-
- 'packaging/**'
19-
- '.clang-*'
20-
- '.gitignore'
21-
- 'LICENSE'
22-
- '*.pro'
23-
- '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*'
2434
branches-ignore:
2535
- 'dependabot/**'
2636

2737
schedule:
2838
- cron: '0 0 1 * *'
2939
workflow_dispatch:
3040

31-
3241
jobs:
3342
CodeQL:
3443
runs-on: ubuntu-latest

.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/qmake.yml

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,38 @@ name: QMake Build
22

33
on:
44
push:
5-
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
6-
- '**/picture/**'
7-
- 'cmake/**'
5+
paths-ignore:
6+
- 'cmake/**'
7+
- 'docs/**'
88
- 'packaging/**'
9-
- '.clang-*'
10-
- '.gitignore'
11-
- 'CMake*'
12-
- 'LICENSE'
13-
- 'README*'
9+
- 'translations/**'
10+
- '**/CMakeLists.txt'
11+
- '**/*.md'
12+
- '**/*.txt'
13+
- '**/.clang-*'
14+
- '**/.gitignore'
15+
- '**/LICENSE*'
16+
- '**/README*'
17+
- 'vcpkg.json'
1418
pull_request:
15-
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
16-
- '**/picture/**'
17-
- 'cmake/**'
19+
paths-ignore:
20+
- 'cmake/**'
21+
- 'docs/**'
1822
- 'packaging/**'
19-
- '.clang-*'
20-
- '.gitignore'
21-
- 'CMake*'
22-
- 'LICENSE'
23-
- 'README*'
23+
- 'translations/**'
24+
- '**/CMakeLists.txt'
25+
- '**/*.md'
26+
- '**/*.txt'
27+
- '**/.clang-*'
28+
- '**/.gitignore'
29+
- '**/LICENSE*'
30+
- '**/README*'
31+
- 'vcpkg.json'
32+
33+
env:
34+
MACOSX_DEPLOYMENT_TARGET: 13.0
35+
MACOSX_BUILD_ARCHS: 'x86_64 arm64'
36+
BUILD_DIR: build
2437

2538
jobs:
2639
build:
@@ -43,30 +56,31 @@ jobs:
4356

4457
- uses: RealChuan/install-jom@main
4558

46-
- name: mkdir build
59+
- name: Create build directory
4760
shell: bash
48-
run: |
49-
mkdir build
61+
run: mkdir -p ${{ env.BUILD_DIR }}
5062

51-
- name: msvc-build
52-
if: startsWith(matrix.os, 'windows')
63+
- name: Build windows
64+
if: runner.os == 'Windows'
65+
working-directory: ${{ env.BUILD_DIR }}
5366
shell: pwsh
5467
run: |
5568
..\packaging\windows\Enter-VsDevShell.ps1
56-
& qmake ./../.
69+
& qmake ..\.
5770
& jom
58-
working-directory: build
59-
- name: ubuntu-build
60-
if: startsWith(matrix.os, 'ubuntu')
71+
72+
- name: Build linux
73+
if: runner.os == 'Linux'
74+
working-directory: ${{ env.BUILD_DIR }}
6175
shell: bash
6276
run: |
63-
qmake ./../.
77+
qmake ../.
6478
make -j $(nproc)
65-
working-directory: build
66-
- name: macos-build
67-
if: startsWith(matrix.os, 'macos')
79+
80+
- name: Build macos
81+
if: runner.os == 'macOS'
82+
working-directory: ${{ env.BUILD_DIR }}
6883
shell: bash
6984
run: |
70-
qmake ./../.
71-
make -j $(sysctl -n hw.ncpu)
72-
working-directory: build
85+
qmake QMAKE_APPLE_DEVICE_ARCHS="${{ env.MACOSX_BUILD_ARCHS }}" ../.
86+
make -j $(sysctl -n hw.ncpu)

.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@v6
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

.gitignore

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,25 @@ tags
8888
*.dll
8989
*.exe
9090

91+
# 编译 & 打包产出
92+
build/
93+
debian/tmp/
94+
debian/.debhelper/
95+
debian/debhelper-build-stamp
96+
debian/files
97+
debian/*.log
98+
debian/*.substvars
99+
*.deb
100+
*.changes
101+
*.buildinfo
102+
*.upload
103+
obj-x86_64-linux-gnu/
104+
91105
# Others
106+
.cache
92107
.vscode
93-
bin-*
94-
build
108+
binaries
109+
output
110+
packet
111+
releases
112+
install

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
},
55
"cmake.generator": "Ninja",
66
"cmake.environment": {
7-
"PATH": "C:\\Qt\\6.9.2\\msvc2022_64\\bin;${env:PATH};"
7+
"PATH": "C:\\Qt\\6.10.0\\msvc2022_64\\bin;${env:PATH};"
88
}
99
}

0 commit comments

Comments
 (0)