Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

A git package can be a dependency of another git package?

Discussion in 'Package Manager' started by yu_yang, Nov 8, 2019.

  1. yu_yang

    yu_yang

    Joined:
    May 3, 2015
    Posts:
    25
  2. felipemunoz_unity

    felipemunoz_unity

    Unity Technologies

    Joined:
    Apr 5, 2019
    Posts:
    15
    Right now, only semver dependencies are allowed in a package manifest. So, you can only use:
    Code (CSharp):
    1. "com.yuyang.unity-extensions.common":"1.0.0"
    The expected workflow for this should be:
    1. Package A depends on published version of Package B
    2. You publish a new version of Package B
    3. You update Package A to use the new released version of B.
    4. You publish the new version of Package A

    Now, assuming that you are not using your own registry nor are publishing packages... A workaround I can think of would be to:
    1. Have Package A with no dependency on B (so that you can add that package without dependency resolution issues)
    2. Add B to your project manifest with the git url, so that the two packages end up in the project.

    I seem to have read somewhere about a user package that allowed using git dependencies in the package manifest, but I haven't been able to find which package that is.

    Git dependencies in packages is on our roadmap though, but there is no ETA yet as to when it will arrive.
     
    wcoastsands and TheoSabattie like this.
  3. johnsoncodehk

    johnsoncodehk

    Joined:
    Feb 19, 2016
    Posts:
    12
    Is it possible to release upm to github?
    I am glad to implement this feature.
     
  4. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    114
    Hi @johnsoncodehk,

    Not for the foreseeable future, I'm afraid.
     
  5. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    62
    I don't get it, the git URI usage is present in Unity 2019.3's documentation:
    https://docs.unity3d.com/Manual/upm-git.html

    so it should be supported now.

    Do I need to use https://github.com/mob-sakai/GitDependencyResolverForUnity for now?

    If the feature is not ready, change the documentation to say that "Unity will support git URI as dependencies in the future".

    UPDATE: OK, I noticed the doc is about the project's own manifest.json, not for each package. It would be nice to be able to use the same syntax, though. I have 5 custom packages for personal usage (so I won't officially submit them) that depend from each other (not circularly, of course).
     
    Last edited: Feb 15, 2020
unityunity