Skip to content

Commit 17678da

Browse files
authored
Refactor packaging, deployment, and dependency management (#150)
* Refactor and clean up DotnetDeployer codebase Refactored several components in the DotnetDeployer project to improve maintainability and align with best practices. Key changes include type improvements, consistent use of `IPublishedDirectory`, encapsulated disposable object handling, and migration from package references to project references. Simplified redundant code and streamlined logic in multiple modules for better readability. * Replace custom stub download logic with InstallerStubProvider - Introduced `InstallerStubProvider` to encapsulate stub download and caching. - Refactored `ExePackagingService` to use `InstallerStubProvider` for cleaner and more maintainable code. - Added tests for `InstallerStubProvider` to validate stub retrieval behavior. - Updated dependencies and bumped relevant Zafiro packages to versions `44.0.1` and `44.0.3`. * Add detached installer support to ExePackagingService and update references - Implemented logic to detach installer and stub creation in `ExePackagingService`. - Added `DetachedInstallerTests` for validating detached installer handling. - Switched from package references to project references for Zafiro modules. - Cleaned up and refactored code related to stub and installer resource generation. * Refactor publish process for better resource cleanup Introduce `Disposable` patterns and improve resource handling during publish, packaging, and deployment. Added `TemporaryDirectory` utility and enhanced logging, ensuring temporary files are properly cleaned up. Updated relevant tests to validate changes. * Migrate project references to package references and update Zafiro dependencies to 44.0.4. * Migrate project references to package references in DotnetPackaging.Exe.Installer and restructure references in DotnetPackaging.Dmg to improve modularity. * Refactor packaging commands to remove unnecessary use of `ByteSourceDetacher` and streamline byte source operations. Add end-to-end tests for packaging formats and introduce reusable `TempDirectory` utility for test isolation.
1 parent 43970a1 commit 17678da

File tree

23 files changed

+841
-365
lines changed

23 files changed

+841
-365
lines changed

Directory.Packages.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<PackageVersion Include="Avalonia.Fonts.Inter" Version="11.3.9" />
3232
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.6" />
3333
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
34-
<PackageVersion Include="Zafiro.Avalonia" Version="44.0.1" />
35-
<PackageVersion Include="Zafiro.Avalonia.Dialogs" Version="44.0.1" />
34+
<PackageVersion Include="Zafiro.Avalonia" Version="44.0.2" />
35+
<PackageVersion Include="Zafiro.Avalonia.Dialogs" Version="44.0.2" />
3636
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
3737
<PackageVersion Include="Serilog.Sinks.XUnit" Version="3.0.19" />
3838
<PackageVersion Include="SharpCompress" Version="0.42.0" />
@@ -54,9 +54,9 @@
5454
<PackageVersion Include="System.IO.Hashing" Version="10.0.0" />
5555
<PackageVersion Include="DeflateBlockCompressor" Version="0.0.13" />
5656
<PackageVersion Include="NuGet.Versioning" Version="7.0.1" />
57-
<PackageVersion Include="Zafiro.Avalonia.Generators" Version="44.0.1" />
58-
<PackageVersion Include="Zafiro" Version="44.0.3" />
59-
<PackageVersion Include="Zafiro.DivineBytes" Version="44.0.3" />
57+
<PackageVersion Include="Zafiro.Avalonia.Generators" Version="44.0.2" />
58+
<PackageVersion Include="Zafiro" Version="44.0.4" />
59+
<PackageVersion Include="Zafiro.DivineBytes" Version="44.0.4" />
6060
<PackageVersion Include="DiscUtils" Version="0.16.13" />
6161
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23" />
6262
</ItemGroup>
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
23
<PropertyGroup>
34
<TargetFramework>net10.0</TargetFramework>
45
<ImplicitUsings>enable</ImplicitUsings>
56
<Nullable>enable</Nullable>
67
</PropertyGroup>
78
<Import Project="..\Common.props" />
8-
99
<ItemGroup>
1010
<PackageReference Include="SharpCompress" />
11-
<PackageReference Include="SharpZipLib" />
1211
<PackageReference Include="SixLabors.ImageSharp" />
12+
<PackageReference Include="SharpZipLib" />
1313
</ItemGroup>
14-
1514
<ItemGroup>
1615
<ProjectReference Include="..\DotnetPackaging\DotnetPackaging.csproj" />
1716
</ItemGroup>
18-
19-
</Project>
17+
</Project>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
23
<PropertyGroup>
34
<TargetFramework>net10.0</TargetFramework>
@@ -6,8 +7,8 @@
67
</PropertyGroup>
78
<Import Project="..\Common.props" />
89
<ItemGroup>
10+
<ProjectReference Include="..\DotnetPackaging\DotnetPackaging.csproj" />
911
<ProjectReference Include="..\DotnetPackaging.Dmg.Hfs\DotnetPackaging.Dmg.Hfs.csproj" />
1012
<ProjectReference Include="..\DotnetPackaging.Dmg.Udif\DotnetPackaging.Dmg.Udif.csproj" />
11-
<ProjectReference Include="..\DotnetPackaging\DotnetPackaging.csproj" />
1213
</ItemGroup>
1314
</Project>

src/DotnetPackaging.Exe.Installer/DotnetPackaging.Exe.Installer.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@
3636
<PackageReference Include="Serilog" />
3737
<PackageReference Include="Serilog.Sinks.File" />
3838
<PackageReference Include="Zafiro.Avalonia" />
39-
<PackageReference Include="Zafiro" />
4039
<PackageReference Include="Zafiro.Avalonia.Dialogs" />
4140
<PackageReference Include="Zafiro.Avalonia.Generators" />
42-
<PackageReference Include="Zafiro.DivineBytes" />
4341
</ItemGroup>
4442

4543
<ItemGroup>

src/DotnetPackaging.Exe/DotnetPackaging.Exe.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
</PropertyGroup>
88
<Import Project="..\Common.props" />
99
<ItemGroup>
10+
<PackageReference Include="NuGet.Versioning" />
1011
<PackageReference Include="Serilog" />
1112
<PackageReference Include="System.IO.Abstractions" />
1213
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" />

0 commit comments

Comments
 (0)