[tests] trim trailing \ from AndroidSdkDirectory/JavaSdkDirectory#8564
Merged
jonathanpeppers merged 1 commit intodotnet:mainfrom Dec 6, 2023
Merged
[tests] trim trailing \ from AndroidSdkDirectory/JavaSdkDirectory#8564jonathanpeppers merged 1 commit intodotnet:mainfrom
\ from AndroidSdkDirectory/JavaSdkDirectory#8564jonathanpeppers merged 1 commit intodotnet:mainfrom
Conversation
When running MSBuild tests locally, both of the paths used for:
/p:AndroidSdkDirectory="C:\Some Path\android-sdk\"
/p:JavaSdkDirectory="C:\Some Path\jdk\"
Because the two paths have a trailing `\`, it appears that MSBuild is
escaping the `\"` giving an error message that we can't build more than
one project! Basically, all command-line parsing is failing!
I am unsure what changed, but making this change locally allows me to
run the MSBuild tests again.
dellis1972
reviewed
Dec 6, 2023
| } | ||
| if (Directory.Exists (AndroidSdkPath)) { | ||
| arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath}\""); | ||
| arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath.TrimEnd('\\')}\""); |
Contributor
There was a problem hiding this comment.
I always found that the quotes need to go around the entire /p:foo=foo for it to work consistently.
e.g \"/p:AndroidSdkDirectory={AndroidSdkPath}\"
Contributor
There was a problem hiding this comment.
but if it works it works 🤷
Member
Author
There was a problem hiding this comment.
I tried this (for both the SDK and JDK), but still get the error:
Suggested change
| arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath.TrimEnd('\\')}\""); | |
| arguments.Add ($"\"/p:AndroidSdkDirectory={AndroidSdkPath}\""); |
I suspect something changed with the arguments here for dotnet build in .NET 9.
dellis1972
approved these changes
Dec 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running MSBuild tests locally, both of the paths used for:
Because the two paths have a trailing
\, it appears that MSBuild is escaping the\"giving an error message that we can't build more than one project! Basically, all command-line parsing is failing!I am unsure what changed, but making this change locally allows me to run the MSBuild tests again.