PackageStore Class
Namespace: Stride.Core.AssetsAssembly: Stride.Core.Assets.dll
Manage packages locally installed and accessible on the store.
public class PackageStore
Remarks
This class is the frontend to the packaging/distribution system. It is currently using nuget for its packaging but may change in the future.
| Name | Description | |
|---|---|---|
| Properties | ||
| Instance | Gets the default package manager. |
|
| Methods | ||
| FindLocalPackage(String, PackageVersionRange, ConstraintProvider, Boolean, Boolean) | ||
| GetPackageFileName(String, PackageVersionRange, ConstraintProvider, Boolean, Boolean) | Gets the filename to the specific package |
|
| GetPackages() | Gets the packages available online. |
|
| GetPackageWithFileName(String) | Gets the filename to the specific package using just a package name. |
|
| PackageMetaFromNugetPackage(NugetPackage) | New instance of PackageMeta from a nuget package |
|
| ToNugetManifest(PackageMeta, ManifestMetadata) | ||
Properties
Instance
Gets the default package manager.
public static PackageStore Instance { get; }
Property Value
| Type | Description |
|---|---|
| PackageStore | A default instance. |
Methods
FindLocalPackage(String, PackageVersionRange, ConstraintProvider, Boolean, Boolean)
public NugetLocalPackage FindLocalPackage(string packageName, PackageVersionRange versionRange = null, ConstraintProvider constraintProvider = null, bool allowPreleaseVersion = true, bool allowUnlisted = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | packageName | |
| Stride.Core.PackageVersionRange | versionRange | |
| Stride.Core.Packages.ConstraintProvider | constraintProvider | |
| System.Boolean | allowPreleaseVersion | |
| System.Boolean | allowUnlisted |
Returns
| Type | Description |
|---|---|
| Stride.Core.Packages.NugetLocalPackage |
GetPackageFileName(String, PackageVersionRange, ConstraintProvider, Boolean, Boolean)
Gets the filename to the specific package packageName using the version versionRange if not null, otherwise the constraintProvider if specified.
If no constraints are specified, the first entry if any are founds is used to get the filename.
public UFile GetPackageFileName(string packageName, PackageVersionRange versionRange = null, ConstraintProvider constraintProvider = null, bool allowPreleaseVersion = true, bool allowUnlisted = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | packageName | Name of the package. |
| Stride.Core.PackageVersionRange | versionRange | The version range. |
| Stride.Core.Packages.ConstraintProvider | constraintProvider | The package constraint provider. |
| System.Boolean | allowPreleaseVersion | if set to |
| System.Boolean | allowUnlisted | if set to |
Returns
| Type | Description |
|---|---|
| Stride.Core.IO.UFile | A location on the disk to the specified package or null if not found. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | packageName |
GetPackages()
Gets the packages available online.
public async Task<IEnumerable<PackageMeta>> GetPackages()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<PackageMeta>> | IEnumerable<PackageMeta>. |
GetPackageWithFileName(String)
Gets the filename to the specific package using just a package name.
public UFile GetPackageWithFileName(string packageName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | packageName | Name of the package. |
Returns
| Type | Description |
|---|---|
| Stride.Core.IO.UFile | A location on the disk to the specified package or null if not found. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | packageName |
PackageMetaFromNugetPackage(NugetPackage)
New instance of PackageMeta from a nuget package metadata.
public static PackageMeta PackageMetaFromNugetPackage(NugetPackage metadata)
Parameters
| Type | Name | Description |
|---|---|---|
| Stride.Core.Packages.NugetPackage | metadata | The nuget metadata used to initialized an instance of PackageMeta. |
Returns
| Type | Description |
|---|---|
| PackageMeta |
ToNugetManifest(PackageMeta, ManifestMetadata)
public static void ToNugetManifest(PackageMeta meta, ManifestMetadata manifestMeta)
Parameters
| Type | Name | Description |
|---|---|---|
| PackageMeta | meta | |
| Stride.Core.Packages.ManifestMetadata | manifestMeta |