Skip to content

Commit

Permalink
SimpleLog Nuget (#31)
Browse files Browse the repository at this point in the history
* GlobalHotKeys now uses SimpleLog via Nuget
* LocalHtmlInterop now uses SimpleLog via Nuget
* ToggleDisplay now uses SimpleLog via Nuget
* ToggleDisplay Workflow now also needs to restore nuget packages
  • Loading branch information
sgrottel authored Jun 1, 2024
1 parent 1520424 commit 9d3b35b
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 2,276 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ToggleDisplay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Setup Nuget
uses: Nuget/setup-nuget@v2

- name: Restore nuget packages
run: nuget restore ToggleDisplay\ToggleDisplay.sln

- name: Inject build number
shell: pwsh
working-directory: ./ToggleDisplay
Expand Down
4 changes: 2 additions & 2 deletions GlobalHotKeys/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ void Configuration::LoadConfigFilePathFromRegistry()
}

std::vector<wchar_t> strBuf(size + 1, L'\0');
size = strBuf.size();
size = static_cast<DWORD>(strBuf.size());
result = RegGetValueW(HKEY_CURRENT_USER, c_regKeyApp, c_regValueConfigFilePath, RRF_RT_REG_SZ, NULL, strBuf.data(), &size);
if (result != ERROR_SUCCESS)
{
Expand All @@ -667,7 +667,7 @@ void Configuration::SaveConfigFilePathInRegistry()
0,
REG_SZ,
reinterpret_cast<LPBYTE>(str.data()),
(str.length() + 1) * sizeof(wchar_t));
static_cast<DWORD>((str.length() + 1) * sizeof(wchar_t)));
if (result != ERROR_SUCCESS)
{
sgrottel::SimpleLog::Error(m_log, "Failed to save path in windows registry; RegSetValueExW: %u", static_cast<unsigned int>(result));
Expand Down
3 changes: 2 additions & 1 deletion GlobalHotKeys/GlobalHotKeys.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
<ClInclude Include="Menu.h" />
<ClInclude Include="NotifyIcon.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="SimpleLog\SimpleLog.hpp" />
<ClInclude Include="SingleInstanceGuard.h" />
<ClInclude Include="StringUtils.h" />
<ClInclude Include="Version.h" />
Expand All @@ -215,11 +214,13 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\libyaml.0.2.5.12\build\native\libyaml.targets" Condition="Exists('packages\libyaml.0.2.5.12\build\native\libyaml.targets')" />
<Import Project="packages\SGrottel.SimpleLog.Cpp.2.2.0\build\native\SGrottel.SimpleLog.Cpp.targets" Condition="Exists('packages\SGrottel.SimpleLog.Cpp.2.2.0\build\native\SGrottel.SimpleLog.Cpp.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('packages\libyaml.0.2.5.12\build\native\libyaml.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\libyaml.0.2.5.12\build\native\libyaml.targets'))" />
<Error Condition="!Exists('packages\SGrottel.SimpleLog.Cpp.2.2.0\build\native\SGrottel.SimpleLog.Cpp.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\SGrottel.SimpleLog.Cpp.2.2.0\build\native\SGrottel.SimpleLog.Cpp.targets'))" />
</Target>
</Project>
6 changes: 0 additions & 6 deletions GlobalHotKeys/GlobalHotKeys.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="SimpleLog">
<UniqueIdentifier>{b6b17268-ae13-492f-8bed-65c50ebd0376}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="GlobalHotKeys.cpp">
Expand Down Expand Up @@ -58,9 +55,6 @@
<ClInclude Include="Version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SimpleLog\SimpleLog.hpp">
<Filter>SimpleLog</Filter>
</ClInclude>
<ClInclude Include="MainWindow.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
18 changes: 0 additions & 18 deletions GlobalHotKeys/SimpleLog/ComponentSource.json

This file was deleted.

Loading

0 comments on commit 9d3b35b

Please sign in to comment.