UPM Git Extension
Git extension for Unity Package Manager (UPM)
<< Description | WebGL Demo | Download | Usage | Development Note >>
What’s new? See changelog 
Do you want to receive notifications for new releases? Watch this repo 
Support me on Patreon! 
Description
In Unity 2018.3, the Unity Package Manager (UPM) supported Git. 😃
https://forum.unity.com/threads/git-support-on-package-manager.573673/
This update allows us to quickly install packages on code hosting services such as GitHub.
But, I’m not quite satisfied with the feature. 😦
- Incorrect links to documents (readme, changelog, license)
- There is not a link to repo URL
- I wanna add, update, and remove the packages in the UI
This project extends the UI of Unity Package Manager for package installed using git!
Features
- Show link to repository URL
- Override link to the document URL
- Readme
- Changelog
- License
- Support GitHub, Bitbucket and GitLab
- Add package from url
- Remove package
- Update package with a specific tag/branch
- Support Unity 2019.1+
Future plans
- View offline documents for private repository
- Display license
- Override the document URL with package.json
Install
Find Packages/manifest.json
in your project and edit it to look like this:
{
"dependencies": {
"com.coffee.upm-git-extension": "https://github.com/mob-sakai/UpmGitExtension.git#0.7.0",
...
},
}
For Unity 2019.1+, use UpmGitExtension 0.5.0 or higher.
Requirement
- Unity 2018.3+ (including 2019.1+)
Usage
Add package from url
- Click
+
button and selectAdd package from url
to open window - Input repository url and select a tag or branch
- Wait a few seconds for validation
- Click
Add
button to add package
Update package with a specific tag/branch
- Click version popup and select a tag/branch in repository
- Click
Update To
button
Remove package
- Click
Remove
button
Development Note
Develop a package for UPM
The branching strategy when I develop a package for UPM is as follows.
Branch | Description | ‘Assets’ directory |
---|---|---|
develop | Development, Testing | Included |
master | Publishing | Included |
upm(default) | Subtree to publish for UPM | Excluded |
{tags} | Tags to install using UPM | Excluded |
Steps to release a package:
- Update version in
package.json
. - Develop package project on develop branch.
- Close all issues on GitHub for new version.
- Generate
CHANGELOG.md
usinggithub_changelog_generator
and commit it. - Merge into master branch and publish as new version.
- Split subtree into ump branch.
- Tag on ump branch as new version.
- Release.
About default document URL
The document URL in UnityPackageManager 2.0.3 is hard-coded.
The default values are as follows:
- View document:
http://docs.unity3d.com/Packages/{ShortVersionId}/index.html
or official manual page (only for built in package) - View changelog:
http://docs.unity3d.com/Packages/{ShortVersionId}/changelog/CHANGELOG.html
- View licenses:
http://docs.unity3d.com/Packages/{ShortVersionId}/license/index.html
orhttps://unity3d.com/legal/licenses/Unity_Companion_License
ShortVersionId is defined as follows:
{PackageName}@{MajorVersion}.{MinorVersion}
- For example:
[email protected]
How to add/update/remove a package from script?
Use UnityEditor.PackageManager.Client
class.
https://docs.unity3d.com/ScriptReference/PackageManager.Client.html
- Add/Update:
Client.Add({PackageId})
- Remove:
Client.Remove({PackageName})
PackageId is defined as follows:
{PackageName}@{MajorVersion}.{MinorVersion}.{PatchVersion}
(Unity official package){PackageName}@{RepoURL}#{BranchOrTagOrRevision}
- For example:
[email protected]
,[email protected]://github.com/mob-sakai/UpmGitExtension.git#1.1.1
License
- MIT
Author
See Also
- GitHub page : https://github.com/mob-sakai/UpmGitExtension
- Releases : https://github.com/mob-sakai/UpmGitExtension/releases
- Issue tracker : https://github.com/mob-sakai/UpmGitExtension/issues
- Current project : https://github.com/mob-sakai/UpmGitExtension/projects/1
- Change log : https://github.com/mob-sakai/UpmGitExtension/blob/upm/CHANGELOG.md