Skip to content

Commit

Permalink
Sever CoreWidgetProvider dependency on DevHome.Common (#2535)
Browse files Browse the repository at this point in the history
  • Loading branch information
krschau authored Apr 5, 2024
1 parent 7cfce45 commit 88a9d2c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.2.206-beta" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.2" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240227000" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
Expand Down
3 changes: 0 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ Dev Home has a modular architecture that consists of multiple components. These
A more detailed look at how the projects are related:
```mermaid
graph TD;
DevHome.Logging-->DevHome.Common;
DevHome.Telemetry-->DevHome.Common;
DevHome.Common-->CoreWidgetProvider;
DevHome.Common-->DevHome;
DevHome.Common-->DevHome.Customization;
DevHome.Common-->DevHome.Dashboard;
DevHome.Common-->DevHome.Experiments;
DevHome.Common-->DevHome.ExtensionLibrary;
DevHome.Common-->DevHome.Settings;
DevHome.Logging-->DevHome.SetupFlow.Common;
DevHome.Telemetry-->DevHome.SetupFlow.Common;
DevHome.SetupFlow.Common-->DevHome.SetupFlow;
DevHome.SetupFlow.Common-->DevHome.SetupFlow.ElevatedComponent;
Expand Down
7 changes: 3 additions & 4 deletions extensions/CoreWidgetProvider/CoreWidgetProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.300.443" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
Expand All @@ -30,10 +33,6 @@
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\common\DevHome.Common.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="Widgets\Templates\LoadingTemplate.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
19 changes: 19 additions & 0 deletions extensions/CoreWidgetProvider/Helpers/Logging.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Windows.Storage;

namespace CoreWidgetProvider.Helpers;

public class Logging
{
public static readonly string LogExtension = ".dhlog";

public static readonly string LogFolderName = "Logs";

public static readonly string DefaultLogFileName = "CoreWidgets";

private static readonly Lazy<string> _logFolderRoot = new(() => Path.Combine(ApplicationData.Current.TemporaryFolder.Path, LogFolderName));

public static readonly string LogFolderRoot = _logFolderRoot.Value;
}
3 changes: 1 addition & 2 deletions extensions/CoreWidgetProvider/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.Windows.AppLifecycle;
using Serilog;
using Windows.ApplicationModel.Activation;
using Windows.Storage;

namespace CoreWidgetProvider;

Expand All @@ -15,7 +14,7 @@ public sealed class Program
public static void Main([System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArray] string[] args)
{
// Set up Logging
Environment.SetEnvironmentVariable("DEVHOME_LOGS_ROOT", Path.Join(DevHome.Common.Logging.LogFolderRoot, "CoreWidgets"));
Environment.SetEnvironmentVariable("DEVHOME_LOGS_ROOT", Path.Join(Helpers.Logging.LogFolderRoot, "CoreWidgets"));
var configuration = new ConfigurationBuilder()
.AddJsonFile("corewidgets_appsettings.json")
.Build();
Expand Down

0 comments on commit 88a9d2c

Please sign in to comment.