Skip to content

Commit 19eb167

Browse files
committed
Merge branch 'develop'
2 parents d87fc1e + b3e59bc commit 19eb167

File tree

79 files changed

+635
-723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+635
-723
lines changed

.github/workflows/dotnetcore.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ env:
1515
GITVERSION_VERSION: 5.12.0
1616
MSVS_TOOLSET_VERSION: 16
1717
SNAPX_DOTNET_FRAMEWORK_VERSION: net8.0
18-
DOTNET_NET60_VERSION: 6.0.417
19-
DOTNET_NET70_VERSION: 7.0.404
20-
DOTNET_NET80_VERSION: 8.0.100
18+
DOTNET_NET60_VERSION: 6.0.421
19+
DOTNET_NET70_VERSION: 7.0.408
20+
DOTNET_NET80_VERSION: 8.0.204
2121
DOTNET_CLI_TELEMETRY_OPTOUT: 1
2222
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
2323
DOTNET_NOLOGO: 1
@@ -74,7 +74,7 @@ jobs:
7474
password: ${{ secrets.SNAPX_DOCKER_READ_PAT }}
7575

7676
- name: Setup .NET
77-
uses: actions/setup-dotnet@v3.2.0
77+
uses: actions/setup-dotnet@v4.0.0
7878
with:
7979
dotnet-version: |
8080
${{ env.DOTNET_NET60_VERSION }}
@@ -116,7 +116,7 @@ jobs:
116116
117117
- name: Upload artifacts
118118
if: success()
119-
uses: actions/upload-artifact@v3
119+
uses: actions/upload-artifact@v4
120120
with:
121121
name: ${{ matrix.os }}-${{ matrix.rid }}-${{ matrix.configuration }}
122122
path: ${{ github.workspace }}/artifacts/**/*
@@ -140,7 +140,7 @@ jobs:
140140
submodules: true
141141

142142
- name: Setup .NET
143-
uses: actions/setup-dotnet@v3.2.0
143+
uses: actions/setup-dotnet@v4.0.0
144144
with:
145145
dotnet-version: |
146146
${{ env.DOTNET_NET60_VERSION }}
@@ -179,7 +179,7 @@ jobs:
179179
180180
- name: Upload artifacts
181181
if: success()
182-
uses: actions/upload-artifact@v3
182+
uses: actions/upload-artifact@v4
183183
with:
184184
name: ${{ matrix.os }}-${{ matrix.rid }}-${{ matrix.configuration }}
185185
path: ${{ github.workspace }}/artifacts/**/*
@@ -198,31 +198,31 @@ jobs:
198198
lfs: true
199199

200200
- name: Download ubuntu-latest-linux-arm64-Release artifacts
201-
uses: actions/download-artifact@v3
201+
uses: actions/download-artifact@v4
202202
with:
203203
name: ubuntu-latest-linux-arm64-Release
204204
path: ${{ github.workspace }}
205205

206206
- name: Download ubuntu-latest-linux-x64-Release artifacts
207-
uses: actions/download-artifact@v3
207+
uses: actions/download-artifact@v4
208208
with:
209209
name: ubuntu-latest-linux-x64-Release
210210
path: ${{ github.workspace }}
211211

212212
- name: Download windows-latest-win-x86-Release artifacts
213-
uses: actions/download-artifact@v3
213+
uses: actions/download-artifact@v4
214214
with:
215215
name: windows-latest-win-x86-Release
216216
path: ${{ github.workspace }}
217217

218218
- name: Download windows-latest-win-x64-Release artifacts
219-
uses: actions/download-artifact@v3
219+
uses: actions/download-artifact@v4
220220
with:
221221
name: windows-latest-win-x64-Release
222222
path: ${{ github.workspace }}
223223

224224
- name: Setup .NET
225-
uses: actions/setup-dotnet@v3.2.0
225+
uses: actions/setup-dotnet@v4.0.0
226226
with:
227227
dotnet-version: |
228228
${{ env.DOTNET_NET60_VERSION }}

GitVersion.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 5.2.5
1+
next-version: 5.2.6
22
mode: ContinuousDeployment
33
continuous-delivery-fallback-tag: ''
44
branches:

build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param(
88
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
99
[string] $DockerImageName = "snapx",
1010
[Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
11-
[string] $DockerVersion = "29.0",
11+
[string] $DockerVersion = "32.0",
1212
[Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
1313
[switch] $DockerLocal,
1414
[Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]

docker/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ FROM ubuntu:20.04 as env-build
33
ENV DEBIAN_FRONTEND=noninteractive
44
ENV SNAPX_DOCKER_WORKING_DIR /build/snapx
55

6-
ARG DOTNET_60_SDK_VERSION=6.0.417
7-
ARG DOTNET_70_SDK_VERSION=7.0.404
8-
ARG DOTNET_80_SDK_VERSION=8.0.100
6+
ARG DOTNET_60_SDK_VERSION=6.0.421
7+
ARG DOTNET_70_SDK_VERSION=7.0.408
8+
ARG DOTNET_80_SDK_VERSION=8.0.204
99
ARG DOTNET_RID=linux-x64
1010

1111

src/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<LangVersion>11.0</LangVersion>
4+
<LangVersion>12.0</LangVersion>
55
</PropertyGroup>
66

77
<PropertyGroup>

src/Directory.Packages.props

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
1919
<PackageVersion Include="Mono.Cecil" Version="0.11.5" />
2020
<PackageVersion Include="Moq" Version="4.20.69" />
21-
<PackageVersion Include="NLog" Version="5.2.5" />
22-
<PackageVersion Include="NuGet.Packaging.Core" Version="6.7.0" />
23-
<PackageVersion Include="NuGet.Protocol" Version="6.7.0" />
24-
<PackageVersion Include="SharpCompress" Version="0.34.1" />
21+
<PackageVersion Include="NLog" Version="5.2.6" />
22+
<PackageVersion Include="NuGet.Packaging.Core" Version="6.8.0" />
23+
<PackageVersion Include="NuGet.Protocol" Version="6.8.0" />
24+
<PackageVersion Include="SharpCompress" Version="0.34.2" />
2525
<PackageVersion Include="System.CodeDom" Version="8.0.0" />
2626
<PackageVersion Include="System.Security.Permissions" Version="8.0.0" />
27-
<PackageVersion Include="xunit" Version="2.6.1" />
28-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
27+
<PackageVersion Include="xunit" Version="2.6.2" />
28+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
2929
<PackageVersion Include="XunitXml.TestLogger" Version="3.1.17" />
3030
<PackageVersion Include="YamlDotNet" Version="13.7.1" />
3131
</ItemGroup>
+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
namespace Snap.Installer.Assets;
22

3-
class AssetsTypeRoot
4-
{
5-
}
3+
class AssetsTypeRoot;

src/Snap.Installer/Controls/GifAnimationControl.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@ namespace Snap.Installer.Controls;
1212

1313
public class GifAnimationControl : Control
1414
{
15-
readonly List<Bitmap> _bitmaps;
15+
readonly List<Bitmap> _bitmaps = [];
1616
DispatcherTimer _dispatcherTimer;
1717
TimeSpan _delayTimespan;
1818
int _bitmapindex;
1919
Action _onFirstDrawAction;
2020
bool _isFirstDraw;
2121

22-
public GifAnimationControl()
23-
{
24-
_bitmaps = new List<Bitmap>();
25-
}
26-
2722
public void AddImages([NotNull] IEnumerable<Bitmap> bitmaps)
2823
{
2924
if (bitmaps == null) throw new ArgumentNullException(nameof(bitmaps));
@@ -42,7 +37,7 @@ public void Run(TimeSpan delayTimeSpan, [NotNull] Action onFirstDrawAction)
4237
_onFirstDrawAction = onFirstDrawAction ?? throw new ArgumentNullException(nameof(onFirstDrawAction));
4338

4439
_dispatcherTimer = new DispatcherTimer(_delayTimespan, DispatcherPriority.Render,
45-
(sender, args) => InvalidateVisual());
40+
(_, _) => InvalidateVisual());
4641
_dispatcherTimer.Start();
4742
}
4843

src/Snap.Installer/Core/SnapEnvironment.cs

+11-14
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,19 @@ internal interface ISnapInstallerEnvironment
2424
void Shutdown();
2525
}
2626

27-
internal class SnapInstallerEnvironment : ISnapInstallerEnvironment
27+
internal class SnapInstallerEnvironment(
28+
LogLevel logLevel,
29+
[NotNull] CancellationTokenSource cancellationTokenSource,
30+
[NotNull] string loggerName)
31+
: ISnapInstallerEnvironment
2832
{
29-
readonly CancellationTokenSource _cancellationTokenSource;
30-
readonly string _loggerName;
33+
readonly CancellationTokenSource _cancellationTokenSource = cancellationTokenSource ?? throw new ArgumentNullException(nameof(cancellationTokenSource));
34+
readonly string _loggerName = loggerName ?? throw new ArgumentNullException(nameof(loggerName));
3135
public CancellationToken CancellationToken => _cancellationTokenSource.Token;
32-
public LogLevel LogLevel { get; set; }
33-
public IServiceContainer Container { get; set; }
34-
public ISnapInstallerIoEnvironment Io { get; set; }
36+
public LogLevel LogLevel { get; set; } = logLevel;
37+
public IServiceContainer Container { get; init; }
38+
public ISnapInstallerIoEnvironment Io { get; init; }
3539

36-
public SnapInstallerEnvironment(LogLevel logLevel, [NotNull] CancellationTokenSource cancellationTokenSource, [NotNull] string loggerName)
37-
{
38-
LogLevel = logLevel;
39-
_cancellationTokenSource = cancellationTokenSource ?? throw new ArgumentNullException(nameof(cancellationTokenSource));
40-
_loggerName = loggerName ?? throw new ArgumentNullException(nameof(loggerName));
41-
}
42-
4340
public ILog BuildLogger<T>()
4441
{
4542
return LogProvider.GetLogger($"{_loggerName}.{typeof(T).Name}");
@@ -53,7 +50,7 @@ public void Shutdown()
5350

5451
internal class SnapInstallerIoEnvironment : ISnapInstallerIoEnvironment
5552
{
56-
public ISnapOsSpecialFolders SpecialFolders { get; set; }
53+
public ISnapOsSpecialFolders SpecialFolders { get; init; }
5754
public string WorkingDirectory { get; set; }
5855
public string ThisExeWorkingDirectory { get; set; }
5956
}

src/Snap.Installer/Core/SnapInstallerEmbeddedResources.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public SnapInstallerEmbeddedResources()
1919
{
2020
AddFromTypeRoot(typeof(AssetsTypeRoot), x => x.StartsWith("Snap.Installer.Assets"));
2121

22-
GifAnimation = new List<byte[]>();
22+
GifAnimation = [];
2323

2424
const string animatedGifNs = "AnimatedGif.";
2525
foreach (var image in Resources.Where(x => x.Filename.StartsWith(animatedGifNs)).OrderBy(x => x.Filename[animatedGifNs.Length..].ToIntSafe()))

src/Snap.Installer/Program.Install.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async Task InstallInBackgroundAsync(IMainWindowViewModel mainWindowViewModel)
6969
diskLogger.Info("Main window should now be visible.");
7070
}
7171

72-
var mainWindowLogger = new LogForwarder(LogLevel.Info, diskLogger, (level, func, exception, parameters) =>
72+
var mainWindowLogger = new LogForwarder(LogLevel.Info, diskLogger, (_, func, _, _) =>
7373
{
7474
var message = func?.Invoke();
7575
if (message == null)
@@ -419,7 +419,7 @@ await snapFilesystem.FileCopyAsync(
419419
}
420420

421421
var avaloniaApp = BuildAvaloniaApp<App>()
422-
.AfterSetup(builder =>
422+
.AfterSetup(_ =>
423423
{
424424
MainWindow.Environment = environment;
425425
MainWindow.ViewModel = new AvaloniaMainWindowViewModel(snapInstallerEmbeddedResources,

src/Snap.Installer/Program.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,21 @@ static IServiceContainer BuildEnvironment(ISnapOs snapOs, CancellationTokenSourc
179179

180180
container.Register<ILibPal>(_ => new LibPal());
181181
container.Register<IBsdiffLib>(_ => new LibBsDiff());
182-
container.Register(c => snapOs);
183-
container.Register(c => snapOs.SpecialFolders);
182+
container.Register(_ => snapOs);
183+
container.Register(_ => snapOs.SpecialFolders);
184184

185-
container.Register(c => snapOs.Filesystem);
186-
container.Register<ISnapHttpClient>(c => new SnapHttpClient(new HttpClient()));
187-
container.Register<ISnapInstallerEmbeddedResources>(c => new SnapInstallerEmbeddedResources());
185+
container.Register(_ => snapOs.Filesystem);
186+
container.Register<ISnapHttpClient>(_ => new SnapHttpClient(new HttpClient()));
187+
container.Register<ISnapInstallerEmbeddedResources>(_ => new SnapInstallerEmbeddedResources());
188188
container.Register<INuGetPackageSources>(c =>
189189
new NuGetMachineWidePackageSources(
190190
c.GetInstance<ISnapFilesystem>(),
191191
workingDirectory
192192
)
193193
);
194-
container.Register<ISnapCryptoProvider>(c => new SnapCryptoProvider());
195-
container.Register<ISnapAppReader>(c => new SnapAppReader());
196-
container.Register<ISnapAppWriter>(c => new SnapAppWriter());
194+
container.Register<ISnapCryptoProvider>(_ => new SnapCryptoProvider());
195+
container.Register<ISnapAppReader>(_ => new SnapAppReader());
196+
container.Register<ISnapAppWriter>(_ => new SnapAppWriter());
197197
container.Register<ISnapBinaryPatcher>(c => new SnapBinaryPatcher(c.GetInstance<IBsdiffLib>()));
198198
container.Register<ISnapPack>(c => new SnapPack(
199199
c.GetInstance<ISnapFilesystem>(),
@@ -210,7 +210,7 @@ static IServiceContainer BuildEnvironment(ISnapOs snapOs, CancellationTokenSourc
210210
c.GetInstance<ISnapOs>(),
211211
c.GetInstance<ISnapAppWriter>()
212212
));
213-
container.Register<ISnapNugetLogger>(c => new NugetLogger(logger));
213+
container.Register<ISnapNugetLogger>(_ => new NugetLogger(logger));
214214
container.Register<INugetService>(c => new NugetService(
215215
c.GetInstance<ISnapFilesystem>(),
216216
c.GetInstance<ISnapNugetLogger>())

src/Snap.Installer/ViewModels/ViewModelBase.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@
22

33
namespace Snap.Installer.ViewModels;
44

5-
internal abstract class ViewModelBase : ReactiveObject
6-
{
7-
8-
}
5+
internal abstract class ViewModelBase : ReactiveObject;

src/Snap.Shared.Tests/BaseFixture.cs

+9-12
Original file line numberDiff line numberDiff line change
@@ -113,25 +113,22 @@ public SnapApp BuildSnapApp(string id = "demoapp", bool isGenesis = false,
113113
Version = new SemanticVersion(1, 0, 0),
114114
IsGenesis = isGenesis,
115115
IsFull = isGenesis,
116-
Channels = new List<SnapChannel>
117-
{
116+
Channels =
117+
[
118118
testChannel,
119119
stagingChannel,
120120
productionChannel
121-
},
121+
],
122122
Target = new SnapTarget
123123
{
124124
Framework = "net8.0",
125-
Shortcuts = new List<SnapShortcutLocation>
126-
{
125+
Shortcuts =
126+
[
127127
SnapShortcutLocation.Desktop,
128128
SnapShortcutLocation.Startup,
129129
SnapShortcutLocation.StartMenu
130-
},
131-
PersistentAssets = new List<string>
132-
{
133-
"application.json"
134-
},
130+
],
131+
PersistentAssets = ["application.json"],
135132
Environment = new Dictionary<string, string>
136133
{
137134
{ "TEST", "123" }
@@ -152,7 +149,7 @@ public SnapApps BuildSnapApps()
152149
{
153150
Schema = 1,
154151
Channels = snapApp.Channels.Select(x => new SnapsChannel(x)).ToList(),
155-
Apps = new List<SnapsApp> { new(snapApp) },
152+
Apps = [new(snapApp)],
156153
Generic = new SnapAppsGeneric
157154
{
158155
Nuspecs = "snap/nuspecs",
@@ -277,7 +274,7 @@ public AssemblyDefinition BuildExecutable(string applicationName, bool randomVer
277274

278275
AddVersioningAttributes(assemblyDefinition, semanticVersion);
279276

280-
assemblyReferencesDefinitions ??= new List<AssemblyDefinition>();
277+
assemblyReferencesDefinitions ??= [];
281278

282279
foreach (var assemblyReferenceDefinition in assemblyReferencesDefinitions)
283280
{

0 commit comments

Comments
 (0)