Inedo.UPack
2.1.6
Prefix Reserved
dotnet add package Inedo.UPack --version 2.1.6
NuGet\Install-Package Inedo.UPack -Version 2.1.6
<PackageReference Include="Inedo.UPack" Version="2.1.6" />
paket add Inedo.UPack --version 2.1.6
#r "nuget: Inedo.UPack, 2.1.6"
// Install Inedo.UPack as a Cake Addin #addin nuget:?package=Inedo.UPack&version=2.1.6 // Install Inedo.UPack as a Cake Tool #tool nuget:?package=Inedo.UPack&version=2.1.6
UpackLib.NET
This library is a work-in-progress set of utilities for working with Universal Packages and feeds.
Installation
Add a reference to Inedo.UPack using NuGet package manager.
Creating a Package
Use the UniversalPackageBuilder
class to create a new .upack
file:
var metadata = new UniversalPackageMetadata
{
Group = "my/group",
Name = "MyPackage",
Version = UniversalPackageVersion.Parse("1.0.0"),
Title = "My Test Package",
Description = "This is where a useful description would go.",
["_customProperty"] = "I am a custom, extended property."
};
using (var builder = new UniversalPackageBuilder("MyPackage.upack", metadata))
{
// Recursively add all files and directories from C:\Test\MyFiles to the package
await builder.AddContentsAsync(@"C:\Test\MyFiles", "", true);
}
Opening a Package
Create an instance of the UniversalPackage
class:
using (var package = new UniversalPackage("MyPackage.upack"))
{
}
Read Package Metadata
Access the properties on a UniversalPackage
instance:
Console.WriteLine($"Package name: {package.Name}");
Console.WriteLine($"Package version: {package.Version}");
// The UniversalPackage class only provides basic metadata.
// To get a copy of all metadata, call the GetFullMetadata method.
var fullMetadata = package.GetFullMetadata();
Console.WriteLine($"Package title: {fullMetadata.Title}");
Extract Package Contents
Use the ExtractContentItemsAsync
method on a UniversalPackage
instance:
await package.ExtractContentItemsAsync(@"C:\Test\UnpackedPackage");
Opening the Package Registry
Use the GetRegistry
method on the PackageRegistry
class:
using (var registry = PackageRegistry.GetRegistry(true /*true for user registry*/))
{
}
Registering a Package
Lock the package registry and call the RegisterPackageAsync
method on a PackageRegistry
instance:
await registry.LockAsync();
await registry.RegisterPackageAsync(
new RegisteredPackage
{
Group = "my/group",
Name = "MyPackage",
Version = "1.0.0",
InstallPath = @"C:\Test\UnpackedPackage",
InstallationDate = DateTimeOffset.Now.ToString("o"),
InstallationReason = "No reason - just a test!",
InstalledUsing = "My upack client",
InstalledBy = "Steve"
}
);
Getting a List of Registered Packages
Call the GetInstalledPackagesAsync
method on a PackageRegistry
instance:
foreach (var p in await registry.GetInstalledPackagesAsync())
Console.WriteLine($"{p.Name} {p.Version}");
Connecting to a Universal Package Feed
Create a new instance of the UniversalFeedClient
class:
var feed = new UniversalFeedClient("http://upack.example.com/feed");
List Feed Packages in a Group
Call ListPackagesAsync
on a UniversalFeedClient
instance:
var packages = await feed.ListPackagesAsync("my/group", null);
Download a Feed Package to a File
Call GetPackageStreamAsync
on a UniversalFeedClient
instance to get a stream:
using (var packageStream = await feed.GetPackageStreamAsync(UniversalPackageId.Parse("my/group/MyPackage"), UniversalPackageVersion.Parse("1.0.0")))
using (var fileStream = File.Create(@"C:\Test\DownloadedPackage.upack"))
{
await packageStream.CopyToAsync(fileStream);
}
Upload a Package to a Feed
Call UploadPackageAsync
on a UniversalFeedClient
instance:
using (var fileStream = File.OpenRead(@"C:\Test\SourcePackage.upack"))
{
await feed.UploadPackageAsync(fileStream);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.3)
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.6 | 126 | 11/9/2024 |
2.1.6-rc.2 | 43 | 11/5/2024 |
2.1.6-rc.1 | 47 | 11/5/2024 |
2.1.5 | 670 | 6/18/2024 |
2.1.5-rc.1 | 56 | 6/17/2024 |
2.1.4 | 331 | 4/25/2024 |
2.1.4-rc.1 | 63 | 4/25/2024 |
2.1.3 | 1,291 | 6/25/2023 |
2.1.3-rc.1 | 82 | 6/25/2023 |
2.1.1 | 766 | 2/20/2023 |
2.1.1-rc.5 | 100 | 2/20/2023 |
2.1.0 | 894 | 12/12/2022 |
2.1.0-rc.1 | 96 | 12/12/2022 |
2.0.4 | 676 | 11/30/2022 |
2.0.4-rc.5 | 103 | 11/30/2022 |
2.0.3 | 1,180 | 11/10/2022 |
2.0.3-rc.1 | 102 | 11/10/2022 |
2.0.2 | 876 | 10/18/2022 |
2.0.2-rc.10 | 98 | 10/18/2022 |
2.0.2-rc.6 | 107 | 8/30/2022 |
2.0.1 | 1,081 | 5/23/2022 |
2.0.1-rc.1 | 130 | 5/23/2022 |
2.0.0 | 802 | 5/6/2022 |
2.0.0-rc.5 | 128 | 5/6/2022 |
1.1.1 | 1,227 | 2/15/2022 |
1.1.1-rc.1 | 126 | 2/15/2022 |
1.1.0 | 826 | 2/8/2022 |
1.1.0-rc.1 | 120 | 2/8/2022 |
1.0.11 | 1,159 | 7/13/2021 |
1.0.11-rc.2 | 174 | 7/13/2021 |
1.0.10 | 836 | 4/1/2021 |
1.0.10-rc.3 | 168 | 3/31/2021 |
1.0.10-rc.2 | 163 | 3/31/2021 |
1.0.9 | 1,375 | 11/20/2020 |
1.0.9-rc.1 | 221 | 11/20/2020 |
1.0.8 | 3,412 | 4/1/2020 |
1.0.8-rc.2 | 311 | 4/1/2020 |
1.0.7 | 948 | 3/31/2020 |
1.0.7-rc.7 | 268 | 3/30/2020 |
1.0.7-pre0001 | 940 | 2/5/2019 |
1.0.6 | 2,581 | 1/14/2019 |
1.0.6-pre0001 | 963 | 1/14/2019 |
1.0.5 | 1,262 | 1/11/2019 |
1.0.5-pre0001 | 933 | 1/11/2019 |
1.0.4 | 1,113 | 12/6/2018 |
1.0.4-pre0001 | 1,022 | 12/6/2018 |
1.0.3 | 1,139 | 11/20/2018 |
1.0.3-pre0001 | 958 | 11/20/2018 |
1.0.2 | 1,209 | 9/19/2018 |
1.0.2-pre0001 | 1,013 | 9/19/2018 |
1.0.1 | 1,305 | 8/16/2018 |
1.0.1-pre0001 | 1,092 | 8/16/2018 |
1.0.0 | 1,400 | 6/13/2018 |
1.0.0-pre0002 | 1,112 | 6/13/2018 |
0.8.1-pre0004 | 1,228 | 5/25/2018 |
0.8.1-pre0001 | 1,186 | 5/23/2018 |
0.8.0-pre0001 | 1,160 | 5/7/2018 |