-
Notifications
You must be signed in to change notification settings - Fork 344
Split NugetHelper code into separate classes #560
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
Split NugetHelper code into separate classes #560
Conversation
I think it makes sense. This is and will most probably stay a project that only handles nuget packages so repeating Nuget in every class name is redundant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. Interesting that you embraced procedural style (with all the static classes) :).
I thought about creating classes but I couldn't find a good separation, and as Unity always reloads the AppDomain when we install / uninstall a package the classes couldn't live long enough to get a advantage. So currently the static classes manage there state by themselves and 'Lazy' load all required information from the file system. Normally I am strongly against static fields or properties but as NuGetForUnity "lives" inside the Unity Editor and therefore has no possible Multi-Threading / scoping issues that come with static-lifetime I found it acceptable. @igor84 |
I agree with your reasoning. It makes sense in this case. From where I'm standing |
Moved code from
NugetHelper
NuGet.config
management (loading / active source) ->ConfigurationManager
FileSystemHelper
packages.config
->InstalledPackagesManager
NugetCacheManager
NugetCliHelper
NugetLogger
NugetPackageContentManager
NugetPackageInstaller
NugetPackageRestorer
NugetPackageUninstaller
NugetPackageUpdater
UnityPathHelper
WebRequestHelper
There is still code that needs to be refactored but I wanted to start creating a structure so when we e.g. split the
Install
method that still has 178 lines of code the code has a 'place' and is not hidden in a 1600 lineNugetHelper
. Eventually we should move some files into folders. Im also not sure about the naming currently most files/classes have aNuget
-prefix eventually we can remove some of them e.g.NugetPackageInstaller
vsPackageInstaller
.@igor84 what do you thing about this.