Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/packagemanifesteditor.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Package Manifest Editor** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/packagemanifesteditor.git
```

[![pkglnk](https://www.pkglnk.dev/badge/packagemanifesteditor.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/packagemanifesteditor)

Dependencies (1)

Used By (1)

README

Package Manifest Editor

GitHub package.json version GitHub issues GitHub pull requests GitHub license GitHub last commit

Package Manifest Editor is a utility to edit package manifests through code.

Installation

  1. The package is available on the openupm registry. You can install it via openupm-cli.
openupm add net.tnrd.packagemanifesteditor
  1. Installing through a Unity Package created by the Package Installer Creator from Needle

Usage

Before you can do anything you'll have to open a manifest for editing like so

private void Foo()
{
    ManifestEditor editor = ManifestEditor.OpenById("Package Folder Name");
}

I personally put my packages in folders with the reverse domain name notation so I would use something along the lines of ManifestEditor.OpenById("tld.domain.packagename");

Supported attributes

This package follows Unity's manifest definition which can be found here: https://docs.unity3d.com/Manual/upm-manifestPkg.html

The odd one out are is the dependencies attribute. This one can only be read by using the Dependencies property on the ManifestEditor.

To add a dependency one can use the AddDependency method like so

private void Foo()
{
    ManifestEditor editor = ManifestEditor.OpenById("tld.domain.packagename");
    editor.AddDependency("tld.domain.packagedependency", "1.0.0");
}

The second parameter requires a version number according to the Semantic Versioning spec using Artees' SemVer.

Removing a dependency is done using the RemoveDependency method like so

private void Foo()
{
    ManifestEditor editor = ManifestEditor.OpenById("tld.domain.packagename");
    editor.RemoveDependency("tld.domain.packagedependency");
}

Saving

Once you're done with your changes you can save the manifest file. It will overwrite the existing one on disk.

private void Foo()
{
    ManifestEditor editor = ManifestEditor.OpenById("tld.domain.packagename");
    // Do some changes
    editor.Save();
}

Undoing your changes

If you want to undo your changes you can simply reload the manifest from disk like so

private void Foo()
{
    ManifestEditor editor = ManifestEditor.OpenById("tld.domain.packagename");
    // Some changes applied that you want to undo
    editor.Reload();
}

Support

Package Manifest Editor is a small and open-source utility that I hope helps other people. It is by no means necessary but if you feel generous you can support me by donating.

ko-fi

Contributing

Pull requests are welcomed. Please feel free to fix any issues you find, or add new features.

Comments

No comments yet. Be the first!