Add AOT analyzer, implement fixes, add json source generation

This commit is contained in:
Caelan Sayler
2024-06-01 12:04:20 +01:00
parent 16bc19e967
commit f32d6f88ff
16 changed files with 144 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0612 // Type or member is obsolete
using System.Text;
using System.Text.Json;
using Velopack.Json;
using Velopack.Sources;
namespace Velopack.Tests.TestHelpers;
@@ -63,7 +63,7 @@ internal class FakeFixtureRepository : Sources.IFileDownloader
}
if (url.Contains($"/{_releasesNameNew}?")) {
var json = JsonSerializer.Serialize(_releasesNew, SimpleJsonTests.Options);
var json = SimpleJson.SerializeObject(_releasesNew);
return Task.FromResult(Encoding.UTF8.GetBytes(json));
}
@@ -104,7 +104,7 @@ internal class FakeFixtureRepository : Sources.IFileDownloader
}
if (url.Contains($"/{_releasesNameNew}?")) {
var json = JsonSerializer.Serialize(_releasesNew, SimpleJsonTests.Options);
var json = SimpleJson.SerializeObject(_releasesNew);
return Task.FromResult(json);
}

View File

@@ -1,6 +1,6 @@
using System.Text;
using System.Text.Json;
using NuGet.Versioning;
using Velopack.Json;
using Velopack.Locators;
using Velopack.Sources;
using Velopack.Tests.TestHelpers;
@@ -38,7 +38,7 @@ public class UpdateManagerTests
},
}
};
var json = JsonSerializer.Serialize(feed, SimpleJsonTests.Options);
var json = SimpleJson.SerializeObject(feed);
return new FakeDownloader() { MockedResponseBytes = Encoding.UTF8.GetBytes(json) };
}
@@ -96,7 +96,7 @@ public class UpdateManagerTests
},
}
};
var json = JsonSerializer.Serialize(feed, SimpleJsonTests.Options);
var json = SimpleJson.SerializeObject(feed);
return new FakeDownloader() { MockedResponseBytes = Encoding.UTF8.GetBytes(json) };
}

View File

@@ -14,6 +14,10 @@
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="..\..\src\Velopack.Packaging\SimpleJson.cs" Link="SimpleJson.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.IO.Packaging" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />