I also understand that you are talking 2 different thing (I agree on both):
@rz_0lento says, if you own a repo with a Unity project, you should put your stuff inside Packages/<your.package.name>/ and leave Assets/ empty (or with samples only)
@andybak says, existing github repos in the wild currently have stuff in Assets/, and he needs to fork them, add a package.json in their “root” (and asmdefs probably) then point to it.
given that (especially wrt. existing stuff), I vote for being able to point UPM to a subfolder of a git repo.
ps: question for unity devs: what would be the best practice for developing a git-hosted package from now on (until we get the ability to push them privately to your registry/asset store)?
(1) repo should contain everything needed to develop the package, without being a submodule
(2) I want to be able to pull it from package manager, either by using a “git:” dependency pointing to a tag, or by releasing it to a registry (main one or scoped ) and requesting with the version
Another point to being able to point to a folder (say, https://YourGitHost.com/UserName/RepoName.git/folderName): you don’t want everything on the root of a public repository. That’d make things a bit messy. For public repositories, it’s better to just have a README.md, a LICENSE.md, a CONTRIBUTE.md, and any other documentation on the root, and the actual package on a subfolder so people don’t need to download useless files into a project.
@JesOb : There are, currently, no plans to directly support Mercurial at this point. I’ll bubble up your request to the team nonetheless.
@andybak : You’re right, currently package.json needs to be at the root of the package to be consumed by UPM. I’ve taken note of your request and we will follow up internally.
Hi, will the new feature be able to add only specific subfolder. We have spine runtime that is containing code for other engines and we just need to include folder that is intended to be used with unity. Zeh mentioned it with Loading...
Git repository sub-folder is not supported for the moment. Your package has to be located at the root of the Git repository otherwise the Package Manager won’t find it. We are considering to implement sub-folder support in the future. No ETA though.
Out of curiosity, anyone knows of a package manager supporting sub-folders? I can’t find one. I would be really interested to see the chosen syntax. I know the popular ones don’t support it (e.g. npm or pip).
@Foriero , Interesting. Did not know it was possible to partially download a Git repository through SVN!. Sadly, this does not fit well with our implementation and future features that we have planned. Thank you for sharing though
Not sure if this exactly matches what you’re looking for, but in Paket (a .NET dependency manager) you can specify a directory in the repository which contains NuGet packages. It uses the following syntax:-
Hey, I’m having trouble with git trying to clone a repo using my password-protected SSH-key. I am running an ssh-agent in the background though, so I don’t know what I might need to do so unity picks it up… Many thanks!
Be sure to use package naming convention. Primarily: “Package names are written in all lower case” since otherwise it will not work. At least it not worked for me.
Package Manager is basically passing along GIT error messages through UPM when something goes amiss. If you’re getting an error message that says “authentication error”, it might be something to do with the SSH key location/availability/agent or credentials not being properly entered.