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

Option to install in /Packages/NuGetAssets #618

Closed
wants to merge 2 commits into from
Closed

Option to install in /Packages/NuGetAssets #618

wants to merge 2 commits into from

Conversation

Akeit0
Copy link

@Akeit0 Akeit0 commented Jan 21, 2024

Add an option to install not to Assets Folder but, Packages/NuGetAssets Folder
スクリーンショット 2024-01-21 175748

@Akeit0 Akeit0 closed this Jan 21, 2024
@Akeit0 Akeit0 reopened this Jan 21, 2024
@Akeit0 Akeit0 closed this Jan 21, 2024
@Akeit0 Akeit0 reopened this Jan 21, 2024
@igor84
Copy link
Collaborator

igor84 commented Jan 22, 2024

Thank you for your effort but I don't think we can accept this pull request. Disregarding all the formatting errors and a bit strange implementation of property in UnityPathHelper I think this would clash with a functionality we already have. You see if the package that is being installed contains a tools folder the contents of just that folder will be moved to Packages folder while the rest of the files, if any, will be installed somewhere under Assets directory. With your change installation of such packages would fail with strange errors.

Also there is not much sense in managed packages that are not used within Unity with NugetForUnity. Are you sure you can't just use the existing tools functionality for your use case?

@Akeit0 Akeit0 closed this Jan 23, 2024
@Akeit0
Copy link
Author

Akeit0 commented Jan 23, 2024

スクリーンショット 2024-01-23 113030
I changed implementation to one that allows config.RepositoryPath to be changed from Preferences.
Also, folders are now moved automatically.
(Editor needs to be restarted when moving dll's, but this is probably unavoidable)

I think this won't clash with a current functionality, because these are only what was originally possible with a text editor.

You see if the package that is being installed contains a tools folder the contents of just that folder will be moved to Packages folder while the rest of the files, if any, will be installed somewhere under Assets directory. With your change installation of such packages would fail with strange errors.

Is this due to my change? I tried and no error occurs and it seems to be normal behavior for the tools folder to be located in the Packages folder.

@Akeit0 Akeit0 reopened this Jan 23, 2024
@igor84
Copy link
Collaborator

igor84 commented Jan 23, 2024

Can you please explain your use case? Why do you need this and how would it be useful in your project?

@Akeit0
Copy link
Author

Akeit0 commented Jan 23, 2024

Simply because my acquaintance and I are disturbed that Packages is in Assets folder.
I think it is a waste not to use the RepositoryPath setting that is already there.

@igor84
Copy link
Collaborator

igor84 commented Jan 23, 2024

But I don't understand what is the point of installing packages for Unity in a folder where Unity will not see them and will not be able to use them? I tried just moving my existing packages to that folder and I just got a lot of compile errors. As far as I know Unity can only see packages that are specified in its Packages/manifest.json file from that folder.

@Akeit0
Copy link
Author

Akeit0 commented Jan 23, 2024

My implementation generates package.json and Unity recognizes them successfully.
Create NuGetAssets Directory Button does it.

@Akeit0
Copy link
Author

Akeit0 commented Jan 23, 2024

You can see #618 (comment) , how it actually works.

@igor84
Copy link
Collaborator

igor84 commented Jan 23, 2024

Ah, ok. I investigated it a bit more and I now understand how is this supposed to work. There are still a few more cases that needs to be handled, like a use case where users want to gitignore the folder where the packages are installed but still have everything resolve automatically after Unity start and I think some path handling will not be correct as it is. I'll try to find some time to go through this, maybe create a separate pull requests where I try to cover all the cases...

@igor84
Copy link
Collaborator

igor84 commented Jan 25, 2024

I opened a pull request #619 where I tried to cover this. Can you please review if that is it and tell me if you are ok that we go with that pull request instead of this one.

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

Successfully merging this pull request may close these issues.

2 participants