Skip to content

Commit

Permalink
[tests] trim trailing \ from AndroidSdkDirectory/JavaSdkDirectory (#…
Browse files Browse the repository at this point in the history
…8564)

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.
  • Loading branch information
jonathanpeppers authored Dec 6, 2023
1 parent 6fa67be commit 58dbd6d
Showing 1 changed file with 2 additions and 2 deletions.
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('\\')}\"");
}
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

0 comments on commit 58dbd6d

Please sign in to comment.