From 7b9dbd9ae679946f7dd4e081187bc293d1c02e90 Mon Sep 17 00:00:00 2001 From: restot Date: Sat, 27 Dec 2025 20:45:28 -0500 Subject: [PATCH 01/55] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 69b7d67015..c23c3722a3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ t1.cfg *.user *.sln.docstates .drone-secrets.env +.env # Build results [Dd]ebug/ @@ -178,3 +179,5 @@ FakesAssemblies/ test/gui/config.ini test/gui/reports */**/__pycache__/ +tools/crash_reports/ +.claude \ No newline at end of file From a290bcc82f3cb306c43484820be848a6a0fe85a1 Mon Sep 17 00:00:00 2001 From: restot Date: Sat, 27 Dec 2025 20:50:51 -0500 Subject: [PATCH 02/55] add warp and envrc --- .envrc | 10 ++ WARP.md | 327 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 337 insertions(+) create mode 100644 .envrc create mode 100644 WARP.md diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000..de5c2bc9bc --- /dev/null +++ b/.envrc @@ -0,0 +1,10 @@ +# Automatically load environment variables from .env when entering this directory +# Requires direnv (brew install direnv) and `eval "$(direnv hook zsh)"` in your ~/.zshrc + +# Load variables from .env (use plain `dotenv` for compatibility with older direnv versions) +dotenv .env + +# High-performance Craft/CMake defaults for this project +export CRAFT_TARGET=macos-clang-arm64 +export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" +export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu) diff --git a/WARP.md b/WARP.md new file mode 100644 index 0000000000..1921239af0 --- /dev/null +++ b/WARP.md @@ -0,0 +1,327 @@ +# WARP.md + +This file provides guidance to WARP (warp.dev) when working with code in this repository. + +## Project Overview + +OpenCloud Desktop is a Qt-based C++ desktop synchronization client for OpenCloud, supporting Windows, macOS, and Linux. The project uses CMake as its build system and follows a modular architecture with separate libraries for sync logic, GUI, and platform-specific integrations. + +- **Framework**: Qt 6.8+ (Core, Widgets, Network, QML/Quick) +- **Language**: C++20 +- **Build System**: CMake 3.18+ with KDE ECM (Extra CMake Modules) +- **Database**: SQLite3 +- **Version**: 3.1.1 (see VERSION.cmake) + +## Build System & Development Commands + +### Building with Craft (Recommended) + +Craft is KDE's meta-build system that handles all dependencies automatically. This is the recommended approach for local development. + +#### Prerequisites + +```bash +# Install PowerShell (required by Craft scripts) +brew install powershell/tap/powershell + +# Clone CraftMaster (if not already present) +mkdir -p ~/craft/CraftMaster +git clone --depth=1 https://invent.kde.org/kde/craftmaster.git ~/craft/CraftMaster/CraftMaster +``` + +#### Initial Craft Setup + +```bash +# Set target architecture (use macos-clang-arm64 for Apple Silicon, macos-clang-x86_64 for Intel) +export CRAFT_TARGET=macos-clang-arm64 + +# Initialize Craft +pwsh .github/workflows/.craft.ps1 --setup + +# Unshelve cached dependency versions +pwsh .github/workflows/.craft.ps1 -c --unshelve .craft.shelf +pwsh .github/workflows/.craft.ps1 -c craft + +# Install project dependencies +pwsh .github/workflows/.craft.ps1 -c --install-deps opencloud/opencloud-desktop +``` + +#### Building the Application + +```bash +export CRAFT_TARGET=macos-clang-arm64 + +# Point Craft to your local source directory +pwsh .github/workflows/.craft.ps1 -c --set "srcDir=$(pwd)" opencloud/opencloud-desktop + +# Configure build options (optional - enables crash reporter, tests, shell integration) +pwsh .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 + +# Build with max parallelism +export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" +export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu) +pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop +``` + +#### Running the Built Application + +```bash +# macOS +open ~/Documents/craft/macos-clang-arm64/Applications/KDE/OpenCloud.app +``` + +#### Running Tests + +```bash +export CRAFT_TARGET=macos-clang-arm64 +pwsh .github/workflows/.craft.ps1 -c --no-cache --test opencloud/opencloud-desktop +``` + +#### Rebuilding After Changes + +```bash +export CRAFT_TARGET=macos-clang-arm64 +pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop +``` + +### Alternative: Plain CMake (Advanced) + +For development without Craft, you must manually install all dependencies first: + +### Running Tests + +Tests use Qt Test framework via ECM's `ecm_add_tests`: + +```bash +# From build directory +ctest + +# Run specific test +ctest -R testname + +# Run tests with verbose output +ctest -V + +# Run single test binary directly +./bin/testsyncengine +``` + +Test binaries are located in `build/bin/` and follow the naming pattern `test` (e.g., `testsyncengine`, `testsyncmove`). + +### Code Quality + +```bash +# QML formatting (requires qttools) +qmlformat -i + +# C++ formatting (requires clang-format) +clang-format -i + +# The project has pre-commit hooks for formatting (requires ECM 5.79+) +``` + +### Build Options + +Key CMake options (set via `-D