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

[tests] trim trailing \ from AndroidSdkDirectory/JavaSdkDirectory #8564

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ List<string> GetDefaultCommandLineArgs (string verb, string target = null, strin
arguments.Add ($"/t:{target}");
}
if (Directory.Exists (AndroidSdkPath)) {
arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath}\"");
arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath.TrimEnd('\\')}\"");
Copy link
Contributor

Choose a reason for hiding this comment

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

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}\"

Copy link
Contributor

Choose a reason for hiding this comment

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

but if it works it works 🤷

Copy link
Member Author

@jonathanpeppers jonathanpeppers Dec 6, 2023

Choose a reason for hiding this comment

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

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.

}
if (Directory.Exists (JavaSdkPath)) {
arguments.Add ($"/p:JavaSdkDirectory=\"{JavaSdkPath}\"");
arguments.Add ($"/p:JavaSdkDirectory=\"{JavaSdkPath.TrimEnd ('\\')}\"");
}
if (parameters != null) {
foreach (var parameter in parameters) {
Expand Down
Loading