mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Refactor projects & add NSwag codegen
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user