aaubry / YamlDotNet

YamlDotNet is a .NET library for YAML
MIT License
2.55k stars 478 forks source link

Unity Package #640

Open robin-moss opened 2 years ago

robin-moss commented 2 years ago

Is your feature request related to a problem? Please describe.

It would be great to be able to install YamlDotNet in Unity as a package, rather than via the asset store. This would allow me to install a specific version, and not need to store the code in VCS.

Describe the solution you'd like A clear and concise description of what you want to happen.

Add a package.json to this repo to allow installation via Git in the Unity Package Manager

Unity package.json

Describe alternatives you've considered

The alternatives are currently:

If there is another/better alternative please let me know :)

Additional context

The biggest downside I can see is that a commit would need to be made to update the version in the package.json which I don't believe is currently done

robin-moss commented 2 years ago

Also looks like it needs an asmdef

krisrok commented 2 years ago

I too am not a fan of the asset store version for the same reasons you've already mentioned.

@robin-moss a fork would be a viable way for now, I think. Just adding the files needed for Unity support, maybe removing some others. Should be trivial to sync to the upstream progress if there are no structural changes, too: Merge upstream and update version inside of package.json... Maybe I'm missing something. @aaubry could also add a branch for UPM support to not move this to another repository.

@steinbitglis as you've worked on Unity compat in the past and are maintaining the asset store version -- what are your thoughts about this?

robin-moss commented 2 years ago

@krisrok we've been using NuGetForUnity to use the NuGet package instead, but there is also MSBuildForUnity that can grab NuGet packages.

But still using UPM would be a great improvement if you don't want the hassle of using NuGet with Unity

steinbitglis commented 2 years ago

@krisrok I have been using a private npm repository (Verdaccio) for all kinds of stuff for a while now. Works very well. I don't know much about public npm hosting, but maybe OpenUPM could be the place for it?

The asset store version has been very rarely and very manually updated. That's why it's at the Asset Store, so that an easy-to-use digested version for Unity was available. I think that @aaubry has done a very good job to allow YamlDotNet work in Unity, and it shouldn't be very hard to close the gap.

steinbitglis commented 2 years ago

What I could do, is to push to OpenUPM every time I push to the asset store (very infrequently, mind you). That way, the plugin at least doesn't go into the Assets folder, and you won't have to deal with questions about VCS.

steinbitglis commented 2 years ago

The two latest packages from the asset store can now be seen in the package manager by putting the following in your manifest.json

"scopedRegistries": [ { "name": "Rain Office", "url": "https://office.rain-games.com:4873", "scopes": [ "yamldotnet" ] } ],

I don't like how Unity or UPM ties github into their tools, so that's why I don't just put everything there. The mentioned server will stay online for the forseeable future, but it's not a great, permanent place for a public package like this. Ideas (or hosting) are welcome.

ModischFabrications commented 1 year ago

Has anyone been able to import via github link? The asset store version is outdated and I would like to include the latest one.

EdwardCooke commented 1 year ago

Enhancements aren't necessarily the priority right now. My priority on working on this project is pretty much

  1. Vulnerabilities
  2. Bugs
  3. Language features
  4. Enhancements

That being said, Unity is very popular in the issues here, and it's something I really want to work on, just haven't had the time yet. One thing that would be very, very beneficial is a Unity project in a repo that references YamlDotNet as a baseline. I have seen a few different ways of referencing it, one is as a package, another is the actual source. This now seems like there may be a 3rd. I haven't ever used Unity, so it's an uncharted area for me, and having someone proficient in Unity, with the multiple ways of bringing in libraries, to help build a simple project, would really help. Would any of you be willing to help with that? I can start up a repo outside of YamlDotNet, in my personal user, where we could all work on it. Then, once we get it completed and working correctly, potentially bring it in here.

ModischFabrications commented 1 year ago

Integration into Unity is the easy part, it's literally just adding a URL via package manager and using the code. The assembly and everything surrounding it is updated automatically.

I'm only experienced on the receiving end of a unity project, so I can't help a lot with the preparations needed for it. This is the smallest unity package that can be imported directly into unity that I know of: https://github.com/JanikHelbig/TinyContainer . It also contains a simple install instruction for your test project and might be a good reference.

EdwardCooke commented 1 year ago

Great thanks. I’ll poke around when I get time.

steinbitglis commented 1 year ago

Has anyone been able to import via github link? The asset store version is outdated and I would like to include the latest one.

The asset store version should be up to date now.