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 | 94 | 11/9/2024 |
2.1.6-rc.2 | 35 | 11/5/2024 |
2.1.6-rc.1 | 42 | 11/5/2024 |
2.1.5 | 596 | 6/18/2024 |
2.1.5-rc.1 | 53 | 6/17/2024 |
2.1.4 | 321 | 4/25/2024 |
2.1.4-rc.1 | 60 | 4/25/2024 |
2.1.3 | 1,275 | 6/25/2023 |
2.1.3-rc.1 | 79 | 6/25/2023 |
2.1.1 | 759 | 2/20/2023 |
2.1.1-rc.5 | 97 | 2/20/2023 |
2.1.0 | 891 | 12/12/2022 |
2.1.0-rc.1 | 93 | 12/12/2022 |
2.0.4 | 673 | 11/30/2022 |
2.0.4-rc.5 | 100 | 11/30/2022 |
2.0.3 | 1,177 | 11/10/2022 |
2.0.3-rc.1 | 99 | 11/10/2022 |
2.0.2 | 871 | 10/18/2022 |
2.0.2-rc.10 | 95 | 10/18/2022 |
2.0.2-rc.6 | 104 | 8/30/2022 |
2.0.1 | 1,076 | 5/23/2022 |
2.0.1-rc.1 | 127 | 5/23/2022 |
2.0.0 | 799 | 5/6/2022 |
2.0.0-rc.5 | 125 | 5/6/2022 |
1.1.1 | 1,222 | 2/15/2022 |
1.1.1-rc.1 | 123 | 2/15/2022 |
1.1.0 | 823 | 2/8/2022 |
1.1.0-rc.1 | 117 | 2/8/2022 |
1.0.11 | 1,154 | 7/13/2021 |
1.0.11-rc.2 | 171 | 7/13/2021 |
1.0.10 | 831 | 4/1/2021 |
1.0.10-rc.3 | 165 | 3/31/2021 |
1.0.10-rc.2 | 160 | 3/31/2021 |
1.0.9 | 1,370 | 11/20/2020 |
1.0.9-rc.1 | 218 | 11/20/2020 |
1.0.8 | 3,381 | 4/1/2020 |
1.0.8-rc.2 | 308 | 4/1/2020 |
1.0.7 | 945 | 3/31/2020 |
1.0.7-rc.7 | 265 | 3/30/2020 |
1.0.7-pre0001 | 937 | 2/5/2019 |
1.0.6 | 2,576 | 1/14/2019 |
1.0.6-pre0001 | 960 | 1/14/2019 |
1.0.5 | 1,259 | 1/11/2019 |
1.0.5-pre0001 | 930 | 1/11/2019 |
1.0.4 | 1,110 | 12/6/2018 |
1.0.4-pre0001 | 1,019 | 12/6/2018 |
1.0.3 | 1,136 | 11/20/2018 |
1.0.3-pre0001 | 955 | 11/20/2018 |
1.0.2 | 1,206 | 9/19/2018 |
1.0.2-pre0001 | 1,010 | 9/19/2018 |
1.0.1 | 1,300 | 8/16/2018 |
1.0.1-pre0001 | 1,089 | 8/16/2018 |
1.0.0 | 1,397 | 6/13/2018 |
1.0.0-pre0002 | 1,109 | 6/13/2018 |
0.8.1-pre0004 | 1,225 | 5/25/2018 |
0.8.1-pre0001 | 1,183 | 5/23/2018 |
0.8.0-pre0001 | 1,155 | 5/7/2018 |