Search Unity

Expose Package Json Info Serialization

Discussion in 'Package Manager' started by Erothez, May 25, 2019.

  1. Erothez

    Erothez

    Joined:
    May 27, 2015
    Posts:
    15
    I have been doing some tooling for UPM that looks at the actual package.json file. I seem to have to duplicate a lot of work that is present internally to the PackageManager UI package. Would be nice to have a class that the .json file can be serialized to and from within Unity without a lot of boilerplate/workarounds for limits of current JSON serialise.

    Or am I missing something and there is an easy way to look at dependencies, and samples layout easily from Unity.
     
  2. GarthSmith

    GarthSmith

    Joined:
    Apr 26, 2012
    Posts:
    1,240
  3. Erothez

    Erothez

    Joined:
    May 27, 2015
    Posts:
    15
    May have missed that first time around, thank you. Sadly after some testing, it's really slow, may have to just work around it and rework the tool to handle that I guess.

    I want to pull everything from the JSON file, as it is a lot faster to just read the JSON file (very noticeable to the user faster), rather than going through the PackageManager searching for a bunch of packages and then building the tool. Basically using the PackageInfo and PackageJsonHelper in UnityEditor.PackageManager.UI at the moment as its a lot faster but internal so can't just add a dependency to it and use it.