Refactor projects & add NSwag codegen

This commit is contained in:
Caelan Sayler
2024-12-24 14:36:26 +00:00
committed by Caelan
parent 2d6d155444
commit 6eb35b8a81
90 changed files with 6267 additions and 702 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 Velopack.Packaging;
using Velopack.Core;
using Velopack.Sources;
using Velopack.Util;
@@ -39,13 +39,14 @@ internal class FakeFixtureRepository : Sources.IFileDownloader
var name = new ReleaseEntryName(maxfullVer.PackageId, maxDeltaVer.Version, false);
releases.Add(new ReleaseEntry("0000000000000000000000000000000000000000", name.ToFileName(), maxfullVer.Filesize));
releasesNew.Add(new VelopackAsset {
PackageId = maxfullVer.PackageId,
Version = maxDeltaVer.Version,
Type = VelopackAssetType.Full,
FileName = $"{maxfullVer.PackageId}-{maxDeltaVer.Version}-full.nupkg",
Size = maxfullVer.Filesize,
});
releasesNew.Add(
new VelopackAsset {
PackageId = maxfullVer.PackageId,
Version = maxDeltaVer.Version,
Type = VelopackAssetType.Full,
FileName = $"{maxfullVer.PackageId}-{maxDeltaVer.Version}-full.nupkg",
Size = maxfullVer.Filesize,
});
}
}
@@ -80,7 +81,8 @@ internal class FakeFixtureRepository : Sources.IFileDownloader
return Task.FromResult(File.ReadAllBytes(filePath));
}
public Task DownloadFile(string url, string targetFile, Action<int> progress, string authorization = null, string accept = null, double timeout = 30, CancellationToken token = default)
public Task DownloadFile(string url, string targetFile, Action<int> progress, string authorization = null, string accept = null, double timeout = 30,
CancellationToken token = default)
{
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
var filePath = PathHelper.GetFixture(rel.OriginalFilename);
@@ -111,4 +113,4 @@ internal class FakeFixtureRepository : Sources.IFileDownloader
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + url);
}
}
}