Skip to content

Commit 9ff5cab

Browse files
committed
refactor: cleanup and improve build and logging configuration
- Comment out unused resource moving in afterbuild.ps1 - Use string resource for corrupted plugin display name - Simplify Sentry configuration class namespace - Add signing target for published output - Update log file path to use process directory
1 parent e073124 commit 9ff5cab

5 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/Apps/KeyAsio/KeyAsio.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,9 @@
107107
<Message Text="Signing the output assembly to $(MSBuildProjectDirectory)..." Importance="High" />
108108
<Exec Command="pwsh -ExecutionPolicy Bypass -File &quot;$(MSBuildProjectDirectory)\..\..\Signer.ps1&quot; sign &quot;$(TargetPath)&quot; &quot;$(MSBuildProjectDirectory)\keyasio_private.key&quot;" />
109109
</Target>
110+
111+
<Target Name="SignPublishOutput" AfterTargets="Publish" Condition="Exists('$(MSBuildProjectDirectory)\keyasio_private.key')">
112+
<Message Text="Signing the published output assembly to $(PublishDir)..." Importance="High" />
113+
<Exec Command="pwsh -ExecutionPolicy Bypass -File &quot;$(MSBuildProjectDirectory)\..\..\Signer.ps1&quot; sign &quot;$(PublishDir)$(TargetFileName)&quot; &quot;$(MSBuildProjectDirectory)\keyasio_private.key&quot;" />
114+
</Target>
110115
</Project>

src/Apps/KeyAsio/ViewModels/PluginManagerViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void RefreshMixMode()
7777
.OrderByDescending(x => x.OptionPriority)
7878
.FirstOrDefault();
7979
ActivePlugin = selected;
80-
MixModeDisplayName = selected?.OptionName ?? "Corrupted";
80+
MixModeDisplayName = selected?.OptionName ?? SR.Plugin_Corrupted;
8181
MixModeTag = selected?.OptionTag;
8282
IsMixSwitchEnabled = _appSettings.Sync.EnableSync && (selected?.CanEnableOption ?? false);
8383
}

src/Apps/KeyAsio/afterbuild.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
param([string]$exe_path)
22

33
$root = (Get-Item $exe_path).Directory.FullName
4-
$folder_runtimes = Join-Path $root "bin" "runtimes"
4+
# $folder_resources = Join-Path $root "bin" "resources"
5+
# $folder_runtimes = Join-Path $root "bin" "runtimes"
56

67
./DotNetDllPathPatcher.ps1 $exe_path
78

8-
Move-Item $folder_resources $root
9-
Move-Item $folder_runtimes $root
9+
# Move-Item $folder_resources $root
10+
# Move-Item $folder_runtimes $root

src/Apps/KeyAsio/nlog.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
autoReload="true"
@@ -8,7 +8,7 @@
88
<!-- the targets to write to -->
99
<targets>
1010
<!-- File Target for all log messages with basic details -->
11-
<target name="allfile" xsi:type="File" fileName="logs/keyasio-${date:format=yyyyMMdd}.log" encoding="UTF8"
11+
<target name="allfile" xsi:type="File" fileName="${processdir}/logs/keyasio-${date:format=yyyyMMdd}.log" encoding="UTF8"
1212
layout="${date:format=HH\:mm\:ss.fff} ${level:uppercase=true} ${logger}: ${message}${onexception:inner=${newline}${newline}======== Start of exception stacktrace ========${newline}${exception:format=tostring}${newline}======== End of exception stacktrace ========${newline}}"/>
1313

1414
<!--Console Target for hosting lifetime messages to improve Docker / Visual Studio startup detection -->

src/Common/KeyAsio.Secrets/EmbeddedSentryConfiguration.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
namespace KeyAsio.Secrets;
2-
3-
public class EmbeddedSentryConfiguration : IDisposable
1+
public class EmbeddedSentryConfiguration : IDisposable
42
{
53
private readonly IDisposable _sentrySdk;
64

@@ -15,7 +13,7 @@ public EmbeddedSentryConfiguration(Action<SentryOptions>? configureOptions = nul
1513

1614
public static void Configure(SentryOptions options)
1715
{
18-
options.Dsn = global::Secrets.Dsn;
16+
options.Dsn = Secrets.Dsn;
1917
#if !RELEASE
2018
options.Debug = true;
2119
options.Environment = "debug";

0 commit comments

Comments
 (0)