Files
PMF/README.md
2020-07-09 09:36:59 +01:00

3.6 KiB

PMF - Package Management Framework

Build Status

Build Status Build Status

Code Coverage

Coverage Status Codacy Badge

PMF is a barebones C# library that provides basic support for package management

Features

  • Install
  • Update
  • Uninstall

Planned features

  • Abstract Package, Asset and Dependency class
  • Multithreading

API

Initialization

These functions need to be called at the beggining of the program and at the end, respectively, they handle the manifest.json file that is saved with information regarding packages installed

PackageManager.Start();

// Do stuff

PackageManager.Stop();

Install

Installs selected version of a package

public static PackageState Install(string id, Version version, out Package package)

Installs latest version of a package

public static PackageState InstallLatest(string id, out Package package)

Installs by SDK version provided by software

public static PackageState InstallBySdkVersion(string id, out Package package)

Uninstall

Uninstalls a package

public static bool Uninstall(string id)

Update

Updates a package to the most recent version, ignoring SDK version

public static PackageState UpdateLatest(string id, out Package package)

Updates a package to a specified version

public static PackageState UpdatePackage(string id, Version version, out Package package)

Updates a package to the most recent version provided an SDK version

public static PackageState UpdateBySdkVersion(string id, out Package package, bool dontAsk = false)

Configuration

Defines the manifest file name

string Config.ManifestFileName = "manifest.json";

Defines the folder where packages are to be installed

string Config.PackageInstallationFolder

The http server where you will be sending information about the packages

string Config.RepositoryEndpoint

Current SDK version

Version Config.CurrentSdkVersion = null;

Temporary folder where zip files will be downloaded to, gets deleted at the end of execution

string Config.TemporaryFolder = ".pmf-temp";

JSON

This is the basic information a package would have

{
	"ID": "something_cool",
	"Type": "Plugin",
	"Name": "Im Something cool",
	"Description": "This is a package that makes you cool and awesome",
	"Assets": [
		{
			"Version": "0.0.1",
			"SdkVersion": "0.0.5",
			"Checksum": "somethingCoolWithLettersAndNumbers",
			"FileName": "name.zip",
			"Url": "somewhereElseDoesntNeedToBeYourServer.zip",
			"Dependencies": [
			{
				"ID": "Inner Spirit",
				"Checksum": "somethingHere",
				"Type": "Standalone",
				"FileName": "zipped.zip",
				"Url": "somewhereElseDoesntNeedToBeYourServer.zip"
			},
			{
				"ID": "Other package id",
				"Checksum": "somethingHere",
				"Type": "Package",
				"Version": "0.2.3"
			}]
		}
	]
}

Building for source

To build from source, clone or fork the repository and open with Visual Studio.