This plugin resolves git url dependencies in the package for Unity Package Manager.
You can use a git url as a package dependency!
<< Description | Install | Usage | Demo | Development Note >>
What's new? See changelog 
Do you want to receive notifications for new releases? Watch this repo 
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.
However, UPM does not support git urls as dependencies in the package. :(
[ package-a/package.json ]
{
"name": "com.coffee.package-a",
"version": "0.1.0",
"dependencies": {
"com.coffee.core-a" : "https://github.com/mob-sakai/GitPackageTest#core-a-0.1.0"
}
}
This plugin resolves git url dependencies in the package for Unity Package Manager.
You can use a git url as a package dependency!
- Easy to use: just install
- Resolve git url dependencies in packages
- Uninstall unused packages that is installed by this plugin
- Support GitHub, Bitbucket, GitLab, etc.
- Support private repository
- Support Unity 2019.1+
- Support .Net 3.5 & 4.x
- Update package with a specific tag/branch
- Deterministic package installation
- Refer to no files from the Library folder
From: https://forum.unity.com/threads/git-support-on-package-manager.573673/page-3#post-4552084
There is no conflict detection and/or resolution algorithm. The lastest package found with the same name is used. This is not how the package manager resolve dependency (See https://docs.unity3d.com/Manual/upm-conflicts-auto.html).
In Unity's algorithm, package conflicts are resolved by "dependency-level from root".
The all packages resolved by this plugin are "dependency-level=1".
Therefore, in some cases, the package of the intended version may not be installed.
For example, in the case of a project with a dependency graph like this:
project (root)
├ package A: 1.0.0
│ └ package X: 2.0.0
└ package B: 1.0.0
└ package C: 2.0.0
└ package X: 2.0.1
This plugin's algorithm
Install -> A: 1.0.0, B: 1.0.0, C: 2.0.0, X: 2.0.1
Unity's algorithm Install -> A: 1.0.0, B: 1.0.0, C: 2.0.0, X: 2.0.0
Find Packages/manifest.json
in your project and edit it to look like this:
{
"dependencies": {
"com.coffee.git-dependency-resolver": "https://github.com/mob-sakai/GitDependencyResolverForUnity.git#1.1.3",
...
}
}
To update the package, change #{version}
to the target version.
Or, use UpmGitExtension to install or update the package.
- Unity 2018.3 or later
- If dependencies are not resolved successfully, try the following:
- When
Unity Package Manager Error
window is opens, clickContinue
.
- Use SemVer as a tag or branch name.
eg.1.0.0
,0.5.0-preview10
,0.1.0-alpha+daily5
https://github.com/mob-sakai/UnityGitDependencyTest
The branching strategy when I develop a package for UPM is as follows.
Branch | Description | 'Assets' directory |
---|---|---|
develop | Development, Testing | Included |
upm(default) | Subtree to publish for UPM | Excluded |
{tags} | Tags to install using UPM | Excluded |
Steps to release a package:
- Develop your package project on
develop
branch and update version inpackage.json
. - Split subtree into
ump
branch.
git subtree split --prefix=Assets/YOUR/PACKAGE/DIRECTRY --branch upm
- Tag on
ump
branch as new version. - That's all. :)
For details, see https://www.patreon.com/posts/25070968.
- GitHub page : https://github.com/mob-sakai/GitDependencyResolverForUnity
- Releases : https://github.com/mob-sakai/GitDependencyResolverForUnity/releases
- Issue tracker : https://github.com/mob-sakai/GitDependencyResolverForUnity/issues
- Current project : https://github.com/mob-sakai/GitDependencyResolverForUnity/projects/1
- Change log : https://github.com/mob-sakai/GitDependencyResolverForUnity/blob/upm/CHANGELOG.md