Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git repo update to windows msbuild 2022 #129

Merged
merged 7 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: clang-format

on: [push]
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
build:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/cpp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ name: cpp-tests

on:
push:
branches:
- master
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
workflow_dispatch:

env:
# Path to the solution file relative to the root of the project.
Expand All @@ -16,7 +22,7 @@ env:

jobs:
build:
runs-on: windows-2019
runs-on: windows-latest

steps:
- name: Checkout repository
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/reactjs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ name: reactjs-tests

on:
push:
branches:
- master
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
workflow_dispatch:

jobs:
build:
Expand Down
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
settingsUI/
*.exe
*.pdb
*.log
.vs
.vs/
.vscode
.vcxproj.*
*.user

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<img src="Images/DCS_Interface_Banner.png" width=400>

![GitHub Workflow Status](https://img.shields.io/github/workflow/status/charlestytler/streamdeck-dcs-interface/cpp-tests?label=C%2B%2B%20Tests)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/charlestytler/streamdeck-dcs-interface/reactjs-tests?label=ReactJS%20Tests)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/enertial/streamdeck-dcs-interface/cpp-tests.yml?label=C%2B%2B%20Tests)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/enertial/streamdeck-dcs-interface/reactjs-tests.yml?label=ReactJS%20Tests)
[![codecov](https://codecov.io/gh/charlestytler/streamdeck-dcs-interface/branch/master/graph/badge.svg?token=9K0CA0IGSM)](https://codecov.io/gh/charlestytler/streamdeck-dcs-interface)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/charlestytler/streamdeck-dcs-interface/clang-format?label=clang-format)
![GitHub all releases](https://img.shields.io/github/downloads/charlestytler/streamdeck-dcs-interface/total)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/charlestytler/streamdeck-dcs-interface)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/enertial/streamdeck-dcs-interface/clang-format.yml?label=clang-format)
![GitHub all releases](https://img.shields.io/github/downloads/enertial/streamdeck-dcs-interface/total)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/enertial/streamdeck-dcs-interface)

`DCS Interface` is a plugin for the Streamdeck that allows communication with DCS via lua UDP sockets for both receiving updates of the simulation state as well as sending commands to interact with the clickable cockpits.

Expand Down Expand Up @@ -115,11 +115,14 @@ Sources

A build script is included which will build both the C++ executable which handles the communcation with DCS as well as the package for the Stream Deck plugin: `Tools/build_plugin.bat`

You will need Visual Studio installed, and may need to edit the location of the Visual Studio install location inside the batch file if it does not match for your machine. Running the batch script will build the Streamdeck plugin and run all unit tests, generating the plugin file at `Release/com.ctytler.dcs.streamDeckPlugin`.
Before running the .bat file you will need to:
- Install MSBuild to compile C++ (comes with Microsoft Visual Studio or Build Tools)
- Install npm for Windows
- Add your install location of MSBuild.exe to your PATH environment variable:
- Click start button to search and select "Edit environment variables for your account"
- Under "User variables for ..." select the "Path" row and choose "Edit"
- Add a New path of your MSBuild.exe install location, such as "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin"

Current version was built with Visual Studio Community 2019.
Running the batch script will build the Streamdeck plugin and run all unit tests, generating the plugin file at `Release/com.ctytler.dcs.streamDeckPlugin`.

Additional convenient one-liner to build if using Windows Subsystem for Linux (WSL):
```
cmd.exe /C """C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" \& devenv D:\\code\\DCS\\streamdeck-dcs-interface\\Sources\\Windows\\com.ctytler.dcs.sdPlugin.sln /build "Release^|x64"""
```
Current version was built with Visual Studio Community 2022.
Binary file modified Release/com.ctytler.dcs.streamDeckPlugin
Binary file not shown.
2 changes: 1 addition & 1 deletion Sources/backend-cpp/ElgatoSD/EPLJSONUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Includes
//------------------------------------------------------------------------------

#include "Vendor/json/src/json.hpp"
#include "nlohmann/json.hpp"
using json = nlohmann::json;

class EPLJSONUtils
Expand Down
2 changes: 1 addition & 1 deletion Sources/backend-cpp/ElgatoSD/ESDBasePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#pragma once

#include "Vendor/json/src/json.hpp"
#include "nlohmann/json.hpp"
using json = nlohmann::json;

class ESDConnectionManager;
Expand Down
23 changes: 17 additions & 6 deletions Sources/backend-cpp/ElgatoSD/ElgatoSD.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -164,8 +164,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Target Name="AddWildCardItems"
AfterTargets="BuildGenerateSources">
<Target Name="AddWildCardItems" AfterTargets="BuildGenerateSources">
<ItemGroup>
<ClCompile Include="@(_WildCardClCompile)" />
</ItemGroup>
Expand All @@ -182,7 +181,19 @@
<ItemGroup>
<_WildCardClInclude Include="*.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets" Condition="Exists('..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" />
<Import Project="..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets" Condition="Exists('..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
<Error Condition="!Exists('..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets'))" />
</Target>
</Project>
5 changes: 5 additions & 0 deletions Sources/backend-cpp/ElgatoSD/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" version="1.8.1.7" targetFramework="native" />
<package id="nlohmann.json" version="3.11.2" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "Utilities/Decimal.h"
#include "Utilities/UdpSocket.h"
#include "Vendor/json/src/json.hpp"
#include "nlohmann/json.hpp"
using json = nlohmann::json;

#include <optional>
Expand Down
23 changes: 17 additions & 6 deletions Sources/backend-cpp/SimulatorInterface/SimulatorInterface.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -152,8 +152,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Target Name="AddWildCardItems"
AfterTargets="BuildGenerateSources">
<Target Name="AddWildCardItems" AfterTargets="BuildGenerateSources">
<ItemGroup>
<ClCompile Include="@(_WildCardClCompile)" />
</ItemGroup>
Expand All @@ -172,7 +171,19 @@
<_WildCardClInclude Include="Protocols/*.h" />
<_WildCardClInclude Include="*.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets" Condition="Exists('..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" />
<Import Project="..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets" Condition="Exists('..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
<Error Condition="!Exists('..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets'))" />
</Target>
</Project>
5 changes: 5 additions & 0 deletions Sources/backend-cpp/SimulatorInterface/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" version="1.8.1.7" targetFramework="native" />
<package id="nlohmann.json" version="3.11.2" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 Charles Tytler

#include "Vendor/json/src/json.hpp"
#include "nlohmann/json.hpp"
using json = nlohmann::json;

json backwardsCompatibilityHandler(const json &prevVersionPayload);
23 changes: 17 additions & 6 deletions Sources/backend-cpp/StreamdeckContext/StreamdeckContext.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -154,8 +154,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Target Name="AddWildCardItems"
AfterTargets="BuildGenerateSources">
<Target Name="AddWildCardItems" AfterTargets="BuildGenerateSources">
<ItemGroup>
<ClCompile Include="@(_WildCardClCompile)" />
</ItemGroup>
Expand All @@ -176,7 +175,19 @@
<_WildCardClInclude Include="SendActions\*.h" />
<_WildCardClInclude Include="*.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets" Condition="Exists('..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" />
<Import Project="..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets" Condition="Exists('..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Windows\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
<Error Condition="!Exists('..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Windows\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets'))" />
</Target>
</Project>
5 changes: 5 additions & 0 deletions Sources/backend-cpp/StreamdeckContext/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" version="1.8.1.7" targetFramework="native" />
<package id="nlohmann.json" version="3.11.2" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "Utilities/JsonReader.h"
#include "Utilities/LuaReader.h"

#include "Vendor/json/src/json.hpp"
#include "nlohmann/json.hpp"
using json = nlohmann::json;

class CallBackTimer
Expand Down
Loading
Loading