OpenTAP 9.25
API Reference
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
OpenTap.Package.PackageDef Class Reference

Definition of a package file. Contains basic structural information relating to packages. More...

Inheritance diagram for OpenTap.Package.PackageDef:
OpenTap.Package.PackageIdentifier OpenTap.Package.IPackageIdentifier

Public Member Functions

override string ToString ()
 Returns a string representation of this PackageDef containing name and version. More...
 
void SaveTo (Stream stream)
 Writes this package definition to a file. More...
 
string ComputeHash ()
 Computes the hash/signature of the package based on its definition. This method relies on hashes of each file. If those are not already part of the definition (they are normally computed when the package is created), this method will try to compute them based on files on the disk. More...
 
- Public Member Functions inherited from OpenTap.Package.PackageIdentifier
 PackageIdentifier (string packageName, string version, CpuArchitecture architecture, string os)
 Creates a package identifier More...
 
 PackageIdentifier (string packageName, SemanticVersion version, CpuArchitecture architecture, string os)
 Creates a package identifier More...
 
 PackageIdentifier (IPackageIdentifier packageIdentifier)
 Creates a package identifier from another IPackageIdentifier
 
override int GetHashCode ()
 Returns the hash code for this PackageIdentifier. More...
 
override bool Equals (object obj)
 Compare this PackageIdentifier to another object.
 

Static Public Member Functions

static PackageDef FromXml (Stream stream)
 Loads package definition from a file. More...
 
static void SaveManyTo (Stream stream, IEnumerable< PackageDef > packages)
 Writes this package definition to a file.
 
static IEnumerable< PackageDefManyFromXml (Stream stream)
 Reads a stream of XML into a list of PackageDef objects.
 
static PackageDef FromPackage (string path)
 Constructs a PackageDef object to represent a TapPackage package that has already been created. More...
 
static List< PackageDefFromPackages (string path)
 Constructs a PackageDef objects to represent each package inside a *.TapPackages file.
 
static void ValidateXml (string path)
 Throws InvalidDataException if the xml in the file does not conform to the schema.
 
static PackageDef FromXml (string path)
 Constructs a PackageDef objects to represent the package definition in the given xml file.
 
static XmlSchemaSet GetXmlSchema ()
 Returns the XML schema for a package definition XML file.
 

Static Public Attributes

const string PackageDefDirectory = "Packages"
 Relative path to the directory holding OpenTAP Package definition files
 
const string PackageDefFileName = "package.xml"
 File name for package definition files inside packages.
 

Properties

Dictionary< string, string > MetaData = new Dictionary<string [get]
 Holds additional metadata for a package
 
string? Hash [getset]
 The hash of the package. This is based on hashes of each payload file as well as metadata in the package definition.
 
string Description [getset]
 A description of this package.
 
List< PackageDependencyDependencies = new List<PackageDependency>() [getset]
 A list of other packages that this package depends on.
 
string Location [getset]
 If this package originates from a package repository. This is the URL of that repository. Otherwise null
 
IPackageDefSource PackageSource [getset]
 Information of the source of the package definition.
 
string InfoLink [getset]
 A link to get more information.
 
DateTime Date [getset]
 The date that the package was build. Defaults to DateTime.MinValue if no date is specified in package.xml
 
string FileType [getset]
 The file type of this package. Either 'application' or 'tappackage'. Default is 'tappackage'.
 
string Owner [getset]
 Name of the owner of the package. There can be multiple owners of a package, in which case this string will have several entries separated with ','.
 
string SourceUrl [getset]
 Link to the package source code. This is intended for open sourced projects.
 
string SourceLicense [getset]
 Specific open source license. Must be a SPDX identifier, read more at https://spdx.org/licenses/.
 
string LicenseRequired = "" [getset]
 License(s) required to use this package. During package create all 'PackageFile.LicenseRequired' attributes from 'Files' will be concatenated into this property. Bundle packages (Class is 'bundle') can use this property to show licenses that are required by the bundle dependencies.
 
string Class [getset]
 The package class, this can be either 'package', 'bundle' or 'solution'.
 
string Group [getset]
 Name of the group that this package belongs to. Groups can be nested in other groups, in which case this string will have several entries separated with '/' or '\'. May be empty or null. UIs may use this information to show a list of packages as a tree structure.
 
string Tags [getset]
 A list of keywords that describe the package. Tags are separated by space or comma.
 
List< PackageFileFiles [getset]
 A list of files contained in this package.
 
List< ActionStepPackageActionExtensions [getset]
 Contains steps that can be executed for this plugin during, or after installation.
 
static string SystemWideInstallationDirectory [get]
 Absolute path to the directory representing the OpenTAP installation dir for system-wide packages
 
- Properties inherited from OpenTap.Package.PackageIdentifier
string Name [getset]
 Name of the package to which this object refers.
 
SemanticVersion Version [getset]
 The Semantic Version compliant version of the package.
 
CpuArchitecture Architecture [getset]
 CPU Architecture
 
string OS [getset]
 The operating system that this package supports
 
- Properties inherited from OpenTap.Package.IPackageIdentifier
string Name [get]
 The name of the package.
 
SemanticVersion Version [get]
 The Semantic Version compliant version of the package.
 
CpuArchitecture Architecture [get]
 The CPU Architechture of the package.
 
string OS [get]
 Comma seperated list of operating systems that this package can run on.
 

Detailed Description

Definition of a package file. Contains basic structural information relating to packages.

Member Function Documentation

◆ ComputeHash()

string OpenTap.Package.PackageDef.ComputeHash ( )
inline

Computes the hash/signature of the package based on its definition. This method relies on hashes of each file. If those are not already part of the definition (they are normally computed when the package is created), this method will try to compute them based on files on the disk.

Returns
A base64 encoded SHA1 hash of relevant fields in the package definition

◆ FromPackage()

static PackageDef OpenTap.Package.PackageDef.FromPackage ( string  path)
inlinestatic

Constructs a PackageDef object to represent a TapPackage package that has already been created.

Parameters
pathPath to a *.TapPackage file

◆ FromXml()

static PackageDef OpenTap.Package.PackageDef.FromXml ( Stream  stream)
inlinestatic

Loads package definition from a file.

Parameters
stream
Returns

◆ SaveTo()

void OpenTap.Package.PackageDef.SaveTo ( Stream  stream)
inline

Writes this package definition to a file.

Parameters
stream

◆ ToString()

override string OpenTap.Package.PackageDef.ToString ( )
inline

Returns a string representation of this PackageDef containing name and version.

Returns

OpenTAP 9.25 API built Tue Aug 6 2024 07:49:25