KuraiAndras / NumericsConverter

Conversion methods between Unity vector types and System.Numerics.Vector
MIT License
19 stars 1 forks source link

Couldn't add Numerics Converter as package from another package #2

Open psydack opened 3 years ago

psydack commented 3 years ago

Hello!

[SUGESTION] I couldn't add NumericsConverter to another package because packages can not use scoped registries (needed by upm). Maybe it will worth to make a repository to be able to add at unity packager as "git url".

Thanks for putting effort on this.

KuraiAndras commented 3 years ago

Did you try to add it using the openupm cli?

psydack commented 3 years ago

Yes, but openupm add a scoped registry to make manageable by Package Manager, but packages can't use it. Try to make a package that needs your package (com.kuraiandras.numericsconverter).

{
  "name": "Something",
  "displayName": "New Package",
  "version": "0.0.1",
  "description": "Sample Description",
  "unity": "2020.3",
  "dependencies": {
    "com.kuraiandras.numericsconverter" : "2.0.0" 
  },
  "keywords": [
  ],
  "author": {
    "name": "Oi",
    "url": "https://github.com/KuraiAndras/NumericsConverter"
  }
}
KuraiAndras commented 3 years ago

In this case shouldn`t just adding the registry scoped to this project to the project consuming the libaray fix it?

psydack commented 3 years ago

No because the unity don't use, I don't know why, scoped registry on packages. I tried but failed.

KuraiAndras commented 3 years ago

Then you should be able to reference the project just with a git dependency like so (according to documentation):

"com.kuraiandras.numericsconverter": "https://github.com/KuraiAndras/NumericsConverter.git?path=/NumericsConverter/Assets/NumericsConverter"

for a specific version under a tag this should work:

"com.kuraiandras.numericsconverter": "https://github.com/KuraiAndras/NumericsConverter.git?path=/NumericsConverter/Assets/NumericsConverter#2.0.0"
KuraiAndras commented 3 years ago

Does this work for you @psydack?

psydack commented 3 years ago

Yes. Thanks for the explanation.

psydack commented 3 years ago

Sorry to reopen. This will only works on main manifest, if you put this on dependency from a package that won't work.

Make and empty folder (as a package) and put on packages folder Put your repo as dependency from that package

image

KuraiAndras commented 3 years ago

Can you show how you reference the package? Or a link to a full repro?

psydack commented 3 years ago

Sure: https://github.com/psydack/uimgui/commit/d2706f555578c8f79349d156453cbe38998b034b#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

KuraiAndras commented 3 years ago

Did you try specifiying a specific version/tag? "com.kuraiandras.numericsconverter": "https://github.com/KuraiAndras/NumericsConverter.git?path=/NumericsConverter/Assets/NumericsConverter#2.0.1"

psydack commented 3 years ago

Yes, same error: image

KuraiAndras commented 3 years ago

https://issuetracker.unity3d.com/issues/package-manager-doesnt-resolve-package-dependencies-when-using-git-url-to-add-a-package-which-contains-a-git-url-dependency According to this, it is by design. You can't add git dependencies to a package.json file.

Are you sure you can't make this work with the openupm package?

this in you package.json
"dependencies": {
    "com.kuraiandras.numericsconverter" : "2.0.1" 
  },

And then add the scoped registry from openupm in the consuming project?

psydack commented 3 years ago

I could add that as a need to the person who will use my package, but that's too much for a simple conversion. I manually embed to my packages your package, it's okay to me: https://github.com/psydack/uimgui/commit/d2706f555578c8f79349d156453cbe38998b034b. I am just leaving this issue because some can have this error too.

On Wed, May 26, 2021 at 10:36 AM Kurai András @.***> wrote:

https://issuetracker.unity3d.com/issues/package-manager-doesnt-resolve-package-dependencies-when-using-git-url-to-add-a-package-which-contains-a-git-url-dependency According to this, it is by design. You can't add git dependencies to a package.json file.

Are you sure you can't make this work with the openupm package?

this in you package.json "dependencies": { "com.kuraiandras.numericsconverter" : "2.0.1" },

And then add the scoped registry from openupm in the consuming project?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/KuraiAndras/NumericsConverter/issues/2#issuecomment-848776007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHK3M572WNMWOTIXMDQS6TTPT2O5ANCNFSM44PLEVXQ .