UnityNuGet icon indicating copy to clipboard operation
UnityNuGet copied to clipboard

Feature request: Ability to set import settings for assemblies

Open JesseTG opened this issue 3 years ago • 5 comments

Some NuGet assemblies would be useful, but only on certain platforms. NSubsitute, for instance, will only work within the Editor or on Mono-powered builds, as it uses System.Reflection.Emit; it would need to have all platforms except for the Editor and Standalone excluded, plus it would need to test for whatever the#define for Mono builds is.

JesseTG avatar May 19 '21 14:05 JesseTG

Agreed. That would require a change to the registry to allow to define the constraints and platforms. PR Welcome.

xoofx avatar Oct 05 '21 05:10 xoofx

I'll do it. I'll see about mimicking the .meta file format for managed .dll's as closely as possible. Specifically, that means the following fields:

  • defineConstraints
  • isPreloaded
  • isOverridable
  • isExplicitlyReferenced
  • validateReferences
  • platformData

Couple of questions before I do:

  1. ~~How do I run a local copy of this registry? Just use the example, right? What's the command for that again? (It's been a while since I used Docker.)~~ Never mind, the Visual Studio solution already has a task for that.
  2. Is the refresh interval configurable? I'd like to locally bump it to once a minute to simplify testing.
  3. The main classes to modify include UnityPackage, UnityMeta and RegistryEntry, right? Any other places in the code you think I'll need to dig into?
  4. Is there an authoritative reference for platformData's structure? Or at least some internal class in UnityEditor.dll that I can peek into?

JesseTG avatar Oct 05 '21 16:10 JesseTG

About question 2.

I made a PR a few weeks ago to make it configurable: https://github.com/xoofx/UnityNuGet/blob/master/src/UnityNuGet.Server/appsettings.json#L8

bdovaz avatar Oct 06 '21 07:10 bdovaz

About question 2.

I made a PR a few weeks ago to make it configurable: https://github.com/xoofx/UnityNuGet/blob/master/src/UnityNuGet.Server/appsettings.json#L8

Ooh, neat, thanks!

JesseTG avatar Oct 06 '21 10:10 JesseTG

@xoofx Now that #59 has knocked out a good chunk of this feature request, do you happen to know anything about this?

  1. Is there an authoritative reference for platformData's structure? Or at least some internal class in UnityEditor.dll that I can peek into?

JesseTG avatar Oct 08 '21 14:10 JesseTG

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

If you think this issue should stay open, please remove the Stale label or comment on the issue.

github-actions[bot] avatar Nov 07 '23 00:11 github-actions[bot]