@@ -10,7 +10,7 @@ OpenCloud Desktop is a Qt-based C++ desktop synchronization client for OpenCloud
1010- ** Language** : C++20
1111- ** Build System** : CMake 3.18+ with KDE ECM (Extra CMake Modules)
1212- ** Database** : SQLite3
13- - ** Version** : 3.1.1 (see VERSION.cmake)
13+ - ** Version** : 3.1.6 (see VERSION.cmake)
1414
1515## Build System & Development Commands
1616
@@ -29,12 +29,21 @@ mkdir -p ~/craft/CraftMaster
2929git clone --depth=1 https://invent.kde.org/kde/craftmaster.git ~ /craft/CraftMaster/CraftMaster
3030```
3131
32- #### Initial Craft Setup
32+ #### Environment Setup
33+
34+ Before running any Craft commands, set these environment variables once in your shell session:
3335
3436``` bash
35- # Set target architecture (use macos-clang-arm64 for Apple Silicon, macos-clang-x86_64 for Intel)
3637export CRAFT_TARGET=macos-clang-arm64
38+ export MAKEFLAGS=" -j$( sysctl -n hw.ncpu) "
39+ export CMAKE_BUILD_PARALLEL_LEVEL=$( sysctl -n hw.ncpu)
40+ ```
3741
42+ You only need to run these exports once per shell session. All subsequent build commands will use these settings.
43+
44+ #### Initial Craft Setup
45+
46+ ``` bash
3847# Initialize Craft
3948pwsh .github/workflows/.craft.ps1 --setup
4049
@@ -49,17 +58,13 @@ pwsh .github/workflows/.craft.ps1 -c --install-deps opencloud/opencloud-desktop
4958#### Building the Application
5059
5160``` bash
52- export CRAFT_TARGET=macos-clang-arm64
53-
5461# Point Craft to your local source directory
5562pwsh .github/workflows/.craft.ps1 -c --set " srcDir=$( pwd) " opencloud/opencloud-desktop
5663
5764# Configure build options (optional - enables crash reporter, tests, shell integration)
5865pwsh .github/workflows/.craft.ps1 -c --set ' args=-DWITH_CRASHREPORTER=ON -DCRASHREPORTER_SUBMIT_URL=http://localhost:8080/submit -DBUILD_TESTING=ON -DBUILD_SHELL_INTEGRATION=ON' opencloud/opencloud-desktop
5966
6067# Build with max parallelism
61- export MAKEFLAGS=" -j$( sysctl -n hw.ncpu) "
62- export CMAKE_BUILD_PARALLEL_LEVEL=$( sysctl -n hw.ncpu)
6368pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop
6469```
6570
@@ -73,17 +78,64 @@ open ~/Documents/craft/macos-clang-arm64/Applications/KDE/OpenCloud.app
7378#### Running Tests
7479
7580``` bash
76- export CRAFT_TARGET=macos-clang-arm64
7781pwsh .github/workflows/.craft.ps1 -c --no-cache --test opencloud/opencloud-desktop
7882```
7983
8084#### Rebuilding After Changes
8185
8286``` bash
83- export CRAFT_TARGET=macos-clang-arm64
8487pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop
8588```
8689
90+ #### Clean Rebuild (Force Full Rebuild)
91+
92+ If Craft thinks the package is up-to-date and ` --no-cache ` isn't triggering a rebuild, delete the build directory and rebuild:
93+
94+ ``` bash
95+ # Delete the build directory
96+ rm -rf ~ /Documents/craft/macos-clang-arm64/build/opencloud/opencloud-desktop/work/build
97+
98+ # Force configure, compile, and install
99+ pwsh .github/workflows/.craft.ps1 -c --configure --compile --install opencloud/opencloud-desktop
100+ ```
101+
102+ Alternatively, for a complete reset:
103+
104+ ``` bash
105+ # Delete the entire package work directory
106+ rm -rf ~ /Documents/craft/macos-clang-arm64/build/opencloud/opencloud-desktop
107+
108+ # Rebuild from scratch
109+ pwsh .github/workflows/.craft.ps1 -c opencloud/opencloud-desktop
110+ ```
111+
112+ #### Max Performance Build (Recommended)
113+
114+ With environment variables already set, you can use these faster build options:
115+
116+ ``` bash
117+ # Full rebuild with max parallelism
118+ pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop
119+
120+ # Or compile only (faster for incremental builds)
121+ pwsh .github/workflows/.craft.ps1 -c --compile opencloud/opencloud-desktop
122+
123+ # Then install
124+ pwsh .github/workflows/.craft.ps1 -c --install opencloud/opencloud-desktop
125+ ```
126+
127+ ** Flags explained:**
128+ - ` MAKEFLAGS="-j$(sysctl -n hw.ncpu)" ` - Parallel make jobs (uses all CPU cores)
129+ - ` CMAKE_BUILD_PARALLEL_LEVEL ` - Ninja/CMake parallel build level
130+ - ` --compile ` - Only compile, skip configure if already done (faster for code changes)
131+ - ` --install ` - Install to final location after compile
132+
133+ ** Filtering build output:**
134+ ``` bash
135+ # Show only errors and build status (useful for long builds)
136+ pwsh .github/workflows/.craft.ps1 -c opencloud/opencloud-desktop 2>&1 | rg " error:|BUILD"
137+ ```
138+
87139### Alternative: Plain CMake (Advanced)
88140
89141For development without Craft, you must manually install all dependencies first:
@@ -117,7 +169,11 @@ qmlformat -i <file.qml>
117169# C++ formatting (requires clang-format)
118170clang-format -i < file.cpp>
119171
120- # The project has pre-commit hooks for formatting (requires ECM 5.79+)
172+ # Format staged changes before commit (project enforces this via pre-commit hook)
173+ git clang-format --staged --extensions ' cpp,h,hpp,c'
174+
175+ # Preview formatting changes
176+ git clang-format --staged --extensions ' cpp,h,hpp,c' --diff
121177```
122178
123179### Build Options
0 commit comments