Search Unity

A question that I have not been able to ask in today's Unite talk

Discussion in 'Package Manager' started by bdovaz, Sep 24, 2019.

  1. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    @BorisMongeau @DanielTG Great talk! I was there and I really like it.

    My problem

    I manage the company's code base and we have many packages in Verdaccio that developers install internally.

    Have you considered how to resolve Nuget packages? In my case we use many standard "Microsoft.Extensions.*" libraries on which several packages depend and we have been using successfully on many platforms (windows, macos, webgl, android, ios...):

    https://github.com/aspnet/Extensions/tree/master/src

    (Note: It has nothing to do with ASP NET Core, don't be afraid)

    I can't put the assemblies in all of the packages because there would be duplicate dll conflicts.

    Think that since Unity is compatible with .NET Standard 2.0 opens a world of possibilities when using third-party libraries published in nuget.

    But that in turn opens up a world of problems when the time comes when packages can be published in the Asset Store (or internally) in upm format.

    Apart from working for a company I am a publisher of the Asset Store in my spare time so I know what it is.

    My current solution

    I have implemented in a console application in .NET Core the resolution of dependencies using the Nuget API:

    https://github.com/NuGet/NuGet.Client/tree/dev/src/NuGet.Core/NuGet.PackageManagement

    Since the Nuget cli does not work with the new format "<PackageReference />":

    https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files

    So I had to implement it myself.

    Here's how it works. Unity creates a file "Assets/Packages.xml" where the dependencies are put. With the API of AssetPostProcessor look changes on the file and if there are force a "restore" of the packages.

    My solution "works" but it is not a good solution because you have to know beforehand the nuget dependencies that the UPM packages are going to have and solve it before importing them.

    The ideal solution

    The ideal thing would be to have it integrated in Unity taking advantage of the work of your colleague @xoofx that published in github: https://github.com/xoofx/UnityNuGet

    That way everything would be "connected" and in the upm system.



    You have me available for whatever you want, I can detail my solution better if you also want although the @xoofx seems to me the most correct to be "connected" with upm.
     
    meikellp likes this.
  2. cassandraL

    cassandraL

    Unity Technologies

    Joined:
    Dec 7, 2017
    Posts:
    111
    Hello @bdovaz,
    Thanks a lot for bringing this to our attention.
    We will review this and see what we can do with it!
     
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Thank you and please give me an answer as soon as you have analyzed it internally.