Skip to content

Commit 4ee1c3d

Browse files
jonathanpeppersdellis1972
authored andcommitted
[tests] Fix issue in ProjectBuilder.Cleanup (#1005)
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.
1 parent f11b873 commit 4ee1c3d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ public void Cleanup ()
102102
if (!last_build_result)
103103
return;
104104
built_before = false;
105-
if (Directory.Exists (ProjectDirectory)) {
106-
FileSystemUtils.SetDirectoryWriteable (ProjectDirectory);
107-
Directory.Delete (ProjectDirectory, true);
105+
106+
var projectDirectory = Path.Combine (Root, ProjectDirectory);
107+
if (Directory.Exists (projectDirectory)) {
108+
FileSystemUtils.SetDirectoryWriteable (projectDirectory);
109+
Directory.Delete (projectDirectory, true);
108110
}
109111
}
110112

0 commit comments

Comments
 (0)