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

Shortening the path of source files in source code nuget packages #577

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

popara96
Copy link
Collaborator

@popara96 popara96 commented Oct 6, 2023

This PR will sort out long paths made by source code packages by unpacking all source files inside the packageDirectory/Sources.

src/NuGetForUnity/Editor/NugetPackageInstaller.cs Outdated Show resolved Hide resolved
src/NuGetForUnity/Editor/PackageContentManager.cs Outdated Show resolved Hide resolved
Copy link
Collaborator

@JoC0de JoC0de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice code 👍
It would be nice to at least have one NuGet package that has source code to be installed by the Test so we can ensure this woks / doesn't brake later.
We could even create a ZipFile on-the-fly just for testing instead of using a existing .nupkg

src/NuGetForUnity/Editor/NugetPackageInstaller.cs Outdated Show resolved Hide resolved
src/NuGetForUnity/Editor/NugetPackageInstaller.cs Outdated Show resolved Hide resolved
src/NuGetForUnity/Editor/PackageContentManager.cs Outdated Show resolved Hide resolved
@popara96
Copy link
Collaborator Author

popara96 commented Oct 8, 2023

Will write tests tomorrow.

[Test]
[TestCase("Microsoft.Azure.WebJobs.Sources", "3.0.37")]
[TestCase("NServiceBus.Testing.Fakes.Sources", "7.1.13")]
public void TestSourceCodePackageInstall(string packageId, string packageVersion)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check to see if Sources directory is added in the package root and ensured that contentFiles directory doesn't exist. I'm trying to thing of other generic checks that we could do while installing this but nothing comes to mind as directories/files under Sources will be very package-specific. H

Copy link
Collaborator

@JoC0de JoC0de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any more issues, I would only fix the formatting at some places. See e.g. the Compiler warnings about trailing whitespace.

@popara96 popara96 merged commit 749259d into master Oct 10, 2023
8 checks passed
@popara96 popara96 deleted the long-path-source-code-packages branch October 10, 2023 08:24
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.

Reduce the possibility of long path windows issues with source code packages
3 participants