Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
psydack opened this issue May 9, 2021 · 14 comments
Open

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

psydack opened this issue May 9, 2021 · 14 comments

Comments

@psydack
Copy link

psydack commented May 9, 2021

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
Copy link
Owner

Did you try to add it using the openupm cli?

@psydack
Copy link
Author

psydack commented May 9, 2021

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
Copy link
Owner

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

@psydack
Copy link
Author

psydack commented May 9, 2021

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

@KuraiAndras
Copy link
Owner

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 KuraiAndras mentioned this issue May 9, 2021
Merged
@KuraiAndras
Copy link
Owner

Does this work for you @psydack?

@psydack
Copy link
Author

psydack commented May 9, 2021

Yes. Thanks for the explanation.

@psydack psydack closed this as completed May 9, 2021
@psydack
Copy link
Author

psydack commented May 25, 2021

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
Copy link
Owner

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

@KuraiAndras KuraiAndras reopened this May 26, 2021
@psydack
Copy link
Author

psydack commented May 26, 2021

@KuraiAndras
Copy link
Owner

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
Copy link
Author

psydack commented May 26, 2021

Yes, same error:
image

@KuraiAndras
Copy link
Owner

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
Copy link
Author

psydack commented May 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants