From 1bf172d0e7c73a70b7be5eac1b77a84bd7baad67 Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 15:46:45 -0800 Subject: [PATCH 1/9] Update build scripts to use cmake --- .github/workflows/cpp-tests.yml | 36 +++++++++++++++++---------------- Tools/build_plugin.bat | 13 +++++------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index 5055b946..c57e9276 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -12,13 +12,8 @@ on: workflow_dispatch: env: - # Path to the solution file relative to the root of the project. - SOLUTION_FILE_PATH: ./Sources/backend-cpp/Windows/com.ctytler.dcs.sdPlugin.sln - - # Configuration type to build. - # You can convert this to a build matrix if you need coverage of multiple configuration types. - # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - BUILD_CONFIGURATION: Release + SOURCE_DIR: ./Sources/backend-cpp + BUILD_DIR: ./Sources/backend-cpp/build jobs: build: @@ -26,20 +21,16 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} + - name: CMake + run: cmake -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -A x64 -DBUILD_TESTING=ON - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} + run: cmake --build ${{env.BUILD_DIR}} --config RelWithDebInfo - name: Setup OpenCppCoverage and add to PATH id: setup_opencppcoverage @@ -50,7 +41,16 @@ jobs: - name: Run C++ Unit Tests and Generate Coverage Report id: generate_test_report shell: cmd - run: OpenCppCoverage.exe --sources Sources\backend-cpp --excluded_sources Vendor --excluded_sources Windows --export_type cobertura:StreamdeckDcsInterfaceCov.xml .\Sources\backend-cpp\Windows\x64\Release\Test.exe + run: | + OpenCppCoverage.exe ^ + --quiet ^ + --sources Sources\backend-cpp ^ + --excluded_sources Vendor ^ + --excluded_sources Windows ^ + --excluded_sources Tools ^ + --export_type cobertura:StreamdeckDcsInterfaceCov.xml ^ + --cover_children ^ + -- ctest --test-dir ./${{env.BUILD_DIR}} -C RelWithDebInfo --output-on-failure - name: Upload Report to Codecov uses: codecov/codecov-action@v5 @@ -58,3 +58,5 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./StreamdeckDcsInterfaceCov.xml flags: Cpp + disable_search: true + diff --git a/Tools/build_plugin.bat b/Tools/build_plugin.bat index 422b2179..e65de9e7 100644 --- a/Tools/build_plugin.bat +++ b/Tools/build_plugin.bat @@ -5,22 +5,19 @@ :: Change directory to the project root (directory above this batch file location) cd /D "%~dp0"\.. -:: Restore NuGet packages -MSBuild.exe .\Sources\backend-cpp\Windows\com.ctytler.dcs.sdPlugin.sln /t:Restore /p:RestorePackagesConfig=true -if %errorlevel% neq 0 echo "Canceling plugin build due to failure to restore NuGet packages" && pause && exit /b %errorlevel% - :: Build C++ executable: -MSBuild.exe .\Sources\backend-cpp\Windows\com.ctytler.dcs.sdPlugin.sln /p:Configuration="Release" +cmake -S ./Sources/backend-cpp -B ./Sources/backend-cpp/build +cmake --build ./Sources/backend-cpp/build --config Release if %errorlevel% neq 0 echo "Canceling plugin build due to failed backend build" && pause && exit /b %errorlevel% :: Run unit tests, only continue if all tests pass -Sources\backend-cpp\Windows\x64\Release\Test.exe +ctest --test-dir ./Sources/backend-cpp/build --output-on-failure if %errorlevel% neq 0 echo "Canceling plugin build due to failed unit tests" && pause && exit /b %errorlevel% :: Copy C++ executable and DLLs to StreamDeck Plugin package: echo. && echo *** C++ binary compilation complete, published to Sources/com.ctytler.dcs.sdPlugin/bin/ *** && echo. -copy Sources\backend-cpp\Windows\x64\Release\streamdeck_dcs_interface.exe Sources\com.ctytler.dcs.sdPlugin\bin\ -copy Sources\backend-cpp\Windows\x64\Release\*.dll Sources\com.ctytler.dcs.sdPlugin\bin\ +copy Sources\backend-cpp\build\Release\streamdeck_dcs_interface.exe Sources\com.ctytler.dcs.sdPlugin\bin\ +copy Sources\backend-cpp\build\Release\*.dll Sources\com.ctytler.dcs.sdPlugin\bin\ :: Remove any prior build of the Plugin: echo. && echo *** Removing any previous builds of com.ctytler.dcs.streamDeckPlugin from Release/ *** From e85ec722a077e50622a71236b2ca44f139c7d3f2 Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 21:26:04 -0800 Subject: [PATCH 2/9] Update outdated codecov.yml --- codecov.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/codecov.yml b/codecov.yml index a7ee2619..f679c028 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,15 +1,24 @@ +codecov: + require_ci_to_pass: true + notify: + after_n_builds: 2 + coverage: status: - default_rules: project: - default: - target: auto - threshold: 1% + cpp: + informational: true flags: - Cpp + + react: + informational: true + flags: - ReactJS -codecov: - notify: - after_n_builds: 2 + patch: + default: + informational: true + comment: after_n_builds: 2 + From b079527608f2ea834cb04f0d580798ac012960da Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:10:16 -0800 Subject: [PATCH 3/9] Use ninja to build Cmake instead of MSBUILD --- .github/workflows/cpp-tests.yml | 11 ++++++----- .../BackwardsCompatibilityHandler.cpp | 4 ++++ Tools/build_plugin.bat | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index c57e9276..e0fc3775 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -23,14 +23,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install Ninja + run: choco install ninja -y + shell: powershell - name: CMake - run: cmake -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -A x64 -DBUILD_TESTING=ON + run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON - name: Build - run: cmake --build ${{env.BUILD_DIR}} --config RelWithDebInfo + run: cmake --build ${{env.BUILD_DIR}} - name: Setup OpenCppCoverage and add to PATH id: setup_opencppcoverage @@ -50,7 +51,7 @@ jobs: --excluded_sources Tools ^ --export_type cobertura:StreamdeckDcsInterfaceCov.xml ^ --cover_children ^ - -- ctest --test-dir ./${{env.BUILD_DIR}} -C RelWithDebInfo --output-on-failure + -- ctest --test-dir ./${{env.BUILD_DIR}} --output-on-failure - name: Upload Report to Codecov uses: codecov/codecov-action@v5 diff --git a/Sources/backend-cpp/StreamdeckContext/BackwardsCompatibilityHandler.cpp b/Sources/backend-cpp/StreamdeckContext/BackwardsCompatibilityHandler.cpp index 44f93b83..a7d77799 100644 --- a/Sources/backend-cpp/StreamdeckContext/BackwardsCompatibilityHandler.cpp +++ b/Sources/backend-cpp/StreamdeckContext/BackwardsCompatibilityHandler.cpp @@ -5,6 +5,10 @@ #include json backwardsCompatibilityHandler(const json &prevVersionPayload) { + if (prevVersionPayload.empty()) { + return prevVersionPayload; + } + json payload = prevVersionPayload; const auto prevSettings = prevVersionPayload["settings"]; if (!prevSettings.contains("send_address") && prevSettings.contains("device_id") && diff --git a/Tools/build_plugin.bat b/Tools/build_plugin.bat index e65de9e7..01957267 100644 --- a/Tools/build_plugin.bat +++ b/Tools/build_plugin.bat @@ -6,8 +6,8 @@ cd /D "%~dp0"\.. :: Build C++ executable: -cmake -S ./Sources/backend-cpp -B ./Sources/backend-cpp/build -cmake --build ./Sources/backend-cpp/build --config Release +cmake -G Ninja -S ./Sources/backend-cpp -B ./Sources/backend-cpp/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON +cmake --build ./Sources/backend-cpp/build if %errorlevel% neq 0 echo "Canceling plugin build due to failed backend build" && pause && exit /b %errorlevel% :: Run unit tests, only continue if all tests pass @@ -16,8 +16,8 @@ if %errorlevel% neq 0 echo "Canceling plugin build due to failed unit tests" && :: Copy C++ executable and DLLs to StreamDeck Plugin package: echo. && echo *** C++ binary compilation complete, published to Sources/com.ctytler.dcs.sdPlugin/bin/ *** && echo. -copy Sources\backend-cpp\build\Release\streamdeck_dcs_interface.exe Sources\com.ctytler.dcs.sdPlugin\bin\ -copy Sources\backend-cpp\build\Release\*.dll Sources\com.ctytler.dcs.sdPlugin\bin\ +copy Sources\backend-cpp\build\bin\StreamdeckInterface.exe Sources\com.ctytler.dcs.sdPlugin\bin\streamdeck_dcs_interface.exe +copy Sources\backend-cpp\build\bin\*.dll Sources\com.ctytler.dcs.sdPlugin\bin\ :: Remove any prior build of the Plugin: echo. && echo *** Removing any previous builds of com.ctytler.dcs.streamDeckPlugin from Release/ *** From a075c5dfad4fbe104ec1536ebfb023c0a279143b Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:19:47 -0800 Subject: [PATCH 4/9] Add MSBuild to path for boost includes --- .github/workflows/cpp-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index e0fc3775..39db952d 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -23,6 +23,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 + - name: Install Ninja run: choco install ninja -y shell: powershell From 38cbc4a8b5bd81f75c090a08cc141d99a8d8591b Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:25:20 -0800 Subject: [PATCH 5/9] Specify vcpkg location in github action for boost.hpp include in vendored code --- .github/workflows/cpp-tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index 39db952d..bf7eeb7a 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -23,15 +23,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - - name: Install Ninja run: choco install ninja -y shell: powershell - name: CMake - run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON + run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} ^ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build run: cmake --build ${{env.BUILD_DIR}} From 16959c60112dd20b29c9731c1a256260f49e30fb Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:27:31 -0800 Subject: [PATCH 6/9] Provide Boost root in github action --- .github/workflows/cpp-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index bf7eeb7a..bd41b916 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -28,8 +28,7 @@ jobs: shell: powershell - name: CMake - run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} ^ - -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DBOOST_ROOT="C:/local/boost_1_82_0" - name: Build run: cmake --build ${{env.BUILD_DIR}} From 70118184043aea1fda5310437fe3b57acbac3220 Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:31:26 -0800 Subject: [PATCH 7/9] Use prefix path instead of boost_root --- .github/workflows/cpp-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index bd41b916..4f0f49aa 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -28,7 +28,7 @@ jobs: shell: powershell - name: CMake - run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DBOOST_ROOT="C:/local/boost_1_82_0" + run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DCMAKE_PREFIX_PATH="C:/local/boost_1_82_0" - name: Build run: cmake --build ${{env.BUILD_DIR}} From d2b6144a7e87b9dd87f3d066bedbe26578ba4c09 Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:36:35 -0800 Subject: [PATCH 8/9] Install boost with vcpkg in github action --- .github/workflows/cpp-tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index 4f0f49aa..ec9db0d2 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -27,8 +27,16 @@ jobs: run: choco install ninja -y shell: powershell + - name: Install vcpkg + run: | + choco install vcpkg -y + echo "::add-path::C:\tools\vcpkg" # ensure it's on PATH + + - name: Install Boost + run: vcpkg install boost-thread:x64-windows + - name: CMake - run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DCMAKE_PREFIX_PATH="C:/local/boost_1_82_0" + run: cmake -G Ninja -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build run: cmake --build ${{env.BUILD_DIR}} From 7f884739c28d96926f41706391a63bf857cdba95 Mon Sep 17 00:00:00 2001 From: Charles Tytler Date: Sat, 17 Jan 2026 22:38:55 -0800 Subject: [PATCH 9/9] Remove choco vcpkg install --- .github/workflows/cpp-tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index ec9db0d2..396181b5 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -27,11 +27,6 @@ jobs: run: choco install ninja -y shell: powershell - - name: Install vcpkg - run: | - choco install vcpkg -y - echo "::add-path::C:\tools\vcpkg" # ensure it's on PATH - - name: Install Boost run: vcpkg install boost-thread:x64-windows