mirror of
https://github.com/quamotion/dotnet-packaging.git
synced 2026-02-15 13:46:36 +00:00
The project flag doesn't search the provided path for a CSPROJ file
#93
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AnthonyMastrean on GitHub (Dec 9, 2020).
The
dotnet publishanddotnet runcommands use aprojectflag or project positional argument that is able to search the path provided for a CSPROJ file.But, the
dotnet tarballcommand does not perform consistent searching. It fails and the CSPROJ file needs to be spelled out.@qmfrederik commented on GitHub (Dec 9, 2020):
Thanks for the feedback. Sounds reasonable, I'd be willing to accept a PR which implements this :).
@AnthonyMastrean commented on GitHub (Dec 11, 2020):
Sure! I assume you'd want the same fix for all of the subcommands that support the
projectflag, right? Looks like the dotnet CLI commands either do this manually or forward the argument to msbuild.Compare this
https://github.com/dotnet/sdk/search?q=FindSingleProjectInDirectory
to this
https://github.com/dotnet/sdk/search?q=SlnOrProjectArgument
@qmfrederik commented on GitHub (Dec 11, 2020):
Yeah, the
FindSingleProjectInDirectorylogic seems solid to me:b91b88aec2/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs (L288-L314)The code which handles the command-line arguments is located in
dotnet-rpm/PackagingRunner.cs, but is shared by all projects.@AnthonyMastrean commented on GitHub (Dec 11, 2020):
Wait a minute... it looks like you already have this behavior coded?
https://github.com/qmfrederik/dotnet-packaging/blob/master/dotnet-rpm/PackagingRunner.cs#L240-L270
@qmfrederik commented on GitHub (Dec 11, 2020):
Ah, look at that ;-). Not sure why it's not working for you, then?
@qmfrederik commented on GitHub (Dec 11, 2020):
Yeah, that logic doesn't work if you pass a directory instead of a full path to a project. Still happy to accept PRs, tough ;-)
@AnthonyMastrean commented on GitHub (Dec 11, 2020):
Yep, there it is... there's a File check, first. Well, that shouldn't be too hard to fix!
https://github.com/qmfrederik/dotnet-packaging/blob/master/dotnet-rpm/PackagingRunner.cs#L251-L255