From 0ac36cd0ec1659609c73aae6b5feedeb092d6aff Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 3 Nov 2017 16:01:17 -0500 Subject: [PATCH] [tests] Fix issue in ProjectBuilder.Cleanup This method was not using the full path to the project directory, and so it wasn't actually deleting anything. This caused test failures on Windows in tests such as `ManifestTest.Bug12935`. This particular test was modifying the contents of `AndroidManifest.xml`, and checking the results of the build afterward. Since the project files were not deleted, changes to the `AndroidManifest.xml` were not getting written to disk during the test. --- .../Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs index 9566758d051..47493fa3847 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs @@ -102,9 +102,11 @@ public void Cleanup () if (!last_build_result) return; built_before = false; - if (Directory.Exists (ProjectDirectory)) { - FileSystemUtils.SetDirectoryWriteable (ProjectDirectory); - Directory.Delete (ProjectDirectory, true); + + var projectDirectory = Path.Combine (Root, ProjectDirectory); + if (Directory.Exists (projectDirectory)) { + FileSystemUtils.SetDirectoryWriteable (projectDirectory); + Directory.Delete (projectDirectory, true); } }