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

[Xamarin.Android.Build.Tasks] fix $(DestinationSubDirectory) double slash #9186

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ void SetIt (ITaskItem? item)
}

string destination = Path.Combine (abi, item.GetMetadata ("DestinationSubDirectory"));
//Log.LogDebugMessage ($"DEBUG!!!'{item.ItemSpec}' '{rid}' = '{abi}'. DestinationSubDirectory='{destination}'");
item.SetMetadata ("DestinationSubDirectory", destination + Path.DirectorySeparatorChar);
if (destination.Length > 0 && destination [destination.Length - 1] != Path.DirectorySeparatorChar) {
destination += Path.DirectorySeparatorChar;
}
item.SetMetadata ("DestinationSubDirectory", destination);
item.SetMetadata ("DestinationSubPath", Path.Combine (destination, Path.GetFileName (item.ItemSpec)));
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ public void IncrementalFastDeployment (string packageFormat)
builder.BuildLogFile = "install3.log";
Assert.IsTrue (builder.Install (app, doNotCleanupOnUpdate: true, saveProject: false), "Third install should have succeeded.");
logLines = builder.LastBuildOutput;
Assert.IsFalse (logLines.Any (l => l.Contains ("Remove redundant file")), "No redundant files should be deleted");
Assert.IsTrue (logLines.Any (l => l.Contains ("NotifySync CopyFile") && l.Contains ("UnnamedProject.dll")), "UnnamedProject.dll should have been uploaded");
Assert.IsTrue (logLines.Any (l => l.Contains ("NotifySync CopyFile") && l.Contains ("Library1.dll")), "Library1.dll should have been uploaded");
Assert.IsTrue (logLines.Any (l => l.Contains ("NotifySync SkipCopyFile") && l.Contains ("Library2.dll")), "Library2.dll should not have been uploaded");
Expand Down
4 changes: 3 additions & 1 deletion tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ public void SkipFastDevAlreadyInstalledFile ()
"Xamarin.AndroidX.AppCompat.dll",
"Xamarin.AndroidX.Core.dll",
};
var logLines = b.LastBuildOutput;
Assert.IsFalse (logLines.Any (l => l.Contains ("Remove redundant file")), "No redundant files should be deleted");
foreach (var assembly in assemblies) {
Assert.IsTrue (b.LastBuildOutput.Any (l => l.Contains (assembly) && l.Contains ("NotifySync SkipCopyFile")), $"{assembly} should be skipped, but no relevant log line");
Assert.IsTrue (logLines.Any (l => l.Contains (assembly) && l.Contains ("NotifySync SkipCopyFile")), $"{assembly} should be skipped, but no relevant log line");
}

Assert.IsTrue (b.Uninstall (proj), "uninstall should have succeeded.");
Expand Down