Skip to content

Commit cc45dc1

Browse files
committed
chore: restructure project files and package management
1 parent 8f80f8e commit cc45dc1

9 files changed

Lines changed: 71 additions & 58 deletions

File tree

CmdPalWebSearchShortcut/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ end_of_line = lf
66
trim_trailing_whitespace = true
77
insert_final_newline = true
88

9-
csharp_new_line_before_open_brace = all
9+
csharp_new_line_before_open_brace = all
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
<Project>
2+
23
<PropertyGroup>
34
<Version>0.1.2</Version>
45
<Platforms>x64;ARM64</Platforms>
6+
<PlatformTarget>$(Platform)</PlatformTarget>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
510
<EnableNETAnalyzers>true</EnableNETAnalyzers>
611
<AnalysisMode>Recommended</AnalysisMode>
7-
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
812
<NuGetAuditMode>direct</NuGetAuditMode>
9-
<PlatformTarget>$(Platform)</PlatformTarget>
13+
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
1014
</PropertyGroup>
15+
1116
<PropertyGroup>
1217
<IsAotCompatible>true</IsAotCompatible>
1318
<CsWinRTAotOptimizerEnabled>true</CsWinRTAotOptimizerEnabled>
1419
<CsWinRTAotWarningLevel>2</CsWinRTAotWarningLevel>
20+
</PropertyGroup>
21+
22+
<PropertyGroup>
1523
<WarningsNotAsErrors>IL2081;IL2104</WarningsNotAsErrors>
1624
</PropertyGroup>
25+
1726
</Project>
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
<Project>
2+
23
<PropertyGroup>
34
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
45
</PropertyGroup>
6+
57
<ItemGroup>
6-
<PackageVersion Include="Microsoft.CommandPalette.Extensions" Version="0.9.260303001" />
78
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24508.2" />
9+
<PackageVersion Include="Microsoft.CommandPalette.Extensions" Version="0.9.260303001" />
810
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.5" />
911
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
1012
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.5" />
1113
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="10.0.5" />
14+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
1215
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.3856.49" />
1316
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.46-beta" />
1417
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
1518
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
1619
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.8.260317003" />
20+
<PackageVersion Include="MSTest.TestAdapter" Version="4.1.0" />
21+
<PackageVersion Include="MSTest.TestFramework" Version="4.1.0" />
1722
<PackageVersion Include="Shmuelie.WinRTServer" Version="2.2.1" />
1823
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
1924
<PackageVersion Include="System.Text.Json" Version="10.0.5" />
20-
<PackageVersion Include="MSTest.TestFramework" Version="4.1.0" />
21-
<PackageVersion Include="MSTest.TestAdapter" Version="4.1.0" />
22-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
2325
</ItemGroup>
24-
</Project>
26+
27+
</Project>

CmdPalWebSearchShortcut/WebSearchShortcut.Tests/WebSearchShortcut.Tests.csproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77

88
<ItemGroup>
99
<ProjectReference Include="..\WebSearchShortcut\WebSearchShortcut.csproj" />
10-
</ItemGroup>
11-
12-
<ItemGroup>
1310
<PackageReference Include="Microsoft.Extensions.Logging" />
1411
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
1512
<PackageReference Include="Microsoft.Extensions.Logging.Debug" />
16-
<PackageReference Include="MSTest.TestFramework" />
17-
<PackageReference Include="MSTest.TestAdapter" />
1813
<PackageReference Include="Microsoft.NET.Test.Sdk" />
14+
<PackageReference Include="MSTest.TestAdapter" />
15+
<PackageReference Include="MSTest.TestFramework" />
1916
</ItemGroup>
2017

21-
</Project>
18+
</Project>

CmdPalWebSearchShortcut/WebSearchShortcut/Helpers/CmdPalLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public bool IsEnabled(LogLevel logLevel)
6363
_scopeStack.Value ??= [];
6464
_scopeStack.Value.Add(state.ToString()!);
6565

66-
return new DisposableAction(() => _scopeStack.Value.RemoveAt(_scopeStack.Value.Count - 1));
66+
return new DisposableAction(() => _scopeStack.Value.RemoveAt(_scopeStack.Value.Count - 1));
6767
}
6868

6969
private partial class DisposableAction(Action action) : IDisposable

CmdPalWebSearchShortcut/WebSearchShortcut/Pages/FallbackSearchWebItem.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public FallbackSearchWebItem(WebSearchShortcutDataEntry shortcut)
1515
: base(
1616
id: $"{shortcut.Id}.fallback",
1717
displayTitle: shortcut.Name,
18-
command: new SearchWebCommand(shortcut, string.Empty) {
18+
command: new SearchWebCommand(shortcut, string.Empty)
19+
{
1920
Id = $"{shortcut.Id}.fallback",
2021
Name = string.Empty,
2122
Icon = Icons.Search
@@ -24,7 +25,7 @@ public FallbackSearchWebItem(WebSearchShortcutDataEntry shortcut)
2425
{
2526
_shortcut = shortcut;
2627

27-
_searchWebCommand = (SearchWebCommand) Command!;
28+
_searchWebCommand = (SearchWebCommand)Command!;
2829

2930
Title = string.Empty;
3031
Subtitle = string.Empty;

CmdPalWebSearchShortcut/WebSearchShortcut/Setting/SettingsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public LogLevel LogLevel_
4949
"Information" => LogLevel.Information,
5050
"Warning" => LogLevel.Warning,
5151
"Error" => LogLevel.Error,
52-
"None" => LogLevel.None,
52+
"None" => LogLevel.None,
5353
_ => LogLevel.Information
5454
};
5555
}
Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<OutputType>WinExe</OutputType>
45
<RootNamespace>WebSearchShortcut</RootNamespace>
6+
<DefaultLanguage>en-US</DefaultLanguage>
57
<ApplicationManifest>app.manifest</ApplicationManifest>
8+
</PropertyGroup>
69

7-
<WindowsSdkPackageVersion>10.0.26100.68-preview</WindowsSdkPackageVersion>
10+
<PropertyGroup>
811
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
912
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
1013
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
11-
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
14+
<WindowsSdkPackageVersion>10.0.26100.68-preview</WindowsSdkPackageVersion>
15+
</PropertyGroup>
1216

17+
<PropertyGroup>
1318
<Platforms>x64;ARM64</Platforms>
19+
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
1420
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
21+
</PropertyGroup>
22+
23+
<PropertyGroup>
24+
<Nullable>enable</Nullable>
1525
<UseWinUI>false</UseWinUI>
1626
<EnableMsixTooling>true</EnableMsixTooling>
17-
<Nullable>enable</Nullable>
18-
27+
<GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
1928
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
2029
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
21-
22-
<GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
23-
24-
<DefaultLanguage>en-US</DefaultLanguage>
2530
</PropertyGroup>
2631

27-
<ItemGroup>
28-
<Content Include="Assets\SplashScreen.scale-200.png" />
29-
<Content Include="Assets\LockScreenLogo.scale-200.png" />
30-
<Content Include="Assets\Square150x150Logo.scale-200.png" />
31-
<Content Include="Assets\Square44x44Logo.scale-200.png" />
32-
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
33-
<Content Include="Assets\StoreLogo.png" />
34-
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
35-
</ItemGroup>
32+
<PropertyGroup>
33+
<IsAotCompatible>true</IsAotCompatible>
34+
<CsWinRTAotOptimizerEnabled>true</CsWinRTAotOptimizerEnabled>
35+
<CsWinRTAotWarningLevel>2</CsWinRTAotWarningLevel>
36+
<WarningsNotAsErrors>IL2081;IL2104;IL2026;IL3050</WarningsNotAsErrors>
37+
</PropertyGroup>
3638

37-
<ItemGroup>
38-
<Manifest Include="$(ApplicationManifest)" />
39-
</ItemGroup>
39+
<!--
40+
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
41+
Explorer "Package and Publish" context menu entry to be enabled for this project even if
42+
the Windows App SDK Nuget package has not yet been restored.
43+
-->
44+
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
45+
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
46+
</PropertyGroup>
4047

4148
<!--
4249
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
@@ -46,42 +53,38 @@
4653
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
4754
<ProjectCapability Include="Msix" />
4855
</ItemGroup>
56+
4957
<ItemGroup>
5058
<PackageReference Include="Microsoft.CommandPalette.Extensions" />
5159
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
60+
<PackageReference Include="Microsoft.Web.WebView2" />
5261
<PackageReference Include="Microsoft.Windows.CsWinRT" />
5362
<PackageReference Include="Microsoft.WindowsAppSDK" />
54-
<PackageReference Include="Microsoft.Web.WebView2" />
55-
<PackageReference Include="System.Text.Json" />
5663
<PackageReference Include="Shmuelie.WinRTServer" />
64+
<PackageReference Include="System.Text.Json" />
65+
</ItemGroup>
66+
67+
<ItemGroup>
68+
<Manifest Include="$(ApplicationManifest)" />
69+
<Content Include="Assets\LockScreenLogo.scale-200.png" />
70+
<Content Include="Assets\SplashScreen.scale-200.png" />
71+
<Content Include="Assets\Square150x150Logo.scale-200.png" />
72+
<Content Include="Assets\Square44x44Logo.scale-200.png" />
73+
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
74+
<Content Include="Assets\StoreLogo.png" />
75+
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
5776
</ItemGroup>
77+
5878
<ItemGroup>
5979
<Compile Update="Properties\Resources.Designer.cs">
6080
<DesignTime>True</DesignTime>
6181
<AutoGen>True</AutoGen>
6282
<DependentUpon>Resources.resx</DependentUpon>
6383
</Compile>
64-
</ItemGroup>
65-
<ItemGroup>
6684
<EmbeddedResource Update="Properties\Resources.resx">
6785
<Generator>ResXFileCodeGenerator</Generator>
6886
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
6987
</EmbeddedResource>
7088
</ItemGroup>
7189

72-
<!--
73-
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
74-
Explorer "Package and Publish" context menu entry to be enabled for this project even if
75-
the Windows App SDK Nuget package has not yet been restored.
76-
-->
77-
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
78-
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
79-
</PropertyGroup>
80-
81-
<PropertyGroup>
82-
<IsAotCompatible>true</IsAotCompatible>
83-
<CsWinRTAotOptimizerEnabled>true</CsWinRTAotOptimizerEnabled>
84-
<CsWinRTAotWarningLevel>2</CsWinRTAotWarningLevel>
85-
<WarningsNotAsErrors>IL2081;IL2104;IL2026;IL3050</WarningsNotAsErrors>
86-
</PropertyGroup>
8790
</Project>

CmdPalWebSearchShortcut/WebSearchShortcut/WebSearchShortcutCommandsProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public WebSearchShortcutCommandsProvider()
5353
{
5454
Title = Resources.AddShortcutItem_Title,
5555
Icon = Icons.AddShortcut,
56-
MoreCommands = [new CommandContextItem(SettingsManager.Instance.Settings.SettingsPage) { Title = Resources.SettingsItem_Title}]
56+
MoreCommands = [new CommandContextItem(SettingsManager.Instance.Settings.SettingsPage) { Title = Resources.SettingsItem_Title }]
5757
};
5858
}
5959

0 commit comments

Comments
 (0)