Search Unity

Can package manifest dependencies include git URLs?

Discussion in 'Package Manager' started by wcoastsands, Nov 21, 2019.

  1. wcoastsands

    wcoastsands

    Joined:
    Sep 30, 2011
    Posts:
    29
    I can add a git URL to the project manifest, but I haven't quite figured out how or where to add git URLs for dependencies in package manifests. If I add them to the project manifest, it adds the packages to the project. Which isn't quite what I'm after.

    I want to be able to add a package to the project from a git URL, where the package is able to retrieve its dependencies from other git URLs. Currently, it seems the package manifests only allow us to specify semver values for dependencies, but the Package Manager isn't able to find the dependencies because they aren't in the project manifest.

    Is there a way to specify git URLs in the package manifest?


    If not, what's the recommended workflow to achieve a similar result?

    Thanks in advance,

    Nikko
     
    GAS likes this.
  2. wcoastsands

    wcoastsands

    Joined:
    Sep 30, 2011
    Posts:
    29
    Last edited: Nov 21, 2019
  3. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    72
    Hi @wcoastsands,

    You are correct, this is not currently supported and using a scoped registry would be a good alternative for now. This is a commonly requested feature though so stay tuned :)
     
    wcoastsands likes this.
  4. wcoastsands

    wcoastsands

    Joined:
    Sep 30, 2011
    Posts:
    29
    Thanks! I appreciate the heads up. Will keep my eyes pealed for it, and setup npm for now.
     
    samuelb_unity likes this.
  5. GAS

    GAS

    Joined:
    Nov 12, 2013
    Posts:
    1
    I think this would be the correct way of doing this. Thus it is great news that Unity appears to be working on this!
     
  6. wcoastsands

    wcoastsands

    Joined:
    Sep 30, 2011
    Posts:
    29
    So I got npm setup with verdaccio locally. I can see a couple trade-offs with each workflow.

    I think the biggest benefit of allowing the use of git URLs in package manifests, similar to how git URLs currently work with project manifests in 2019.3, would be that you could quickly and easily setup up and get running with packages without having to leave Unity, especially for ones with dependencies outside the scope of Unity official packages. The drawback is that you wouldn't have a registry to reference any updates or additional package versions from. Which is a big part of package management.

    On the other hand, setting up a scoped registry takes additional time and resources to setup. Which can be a barrier to entry for anyone unfamiliar with the tech or unwilling to maintain it due to time and cost restraints. The overhead and responsibility involved in setting up and maintaining a scoped registry is not insignificant, but it may be the more appropriate solution and necessary for developers as they scale up their operations.
     
    samuelb_unity likes this.
  7. Rock360

    Rock360

    Joined:
    Oct 26, 2016
    Posts:
    8