From d34f31e755b670f5ad56abcc52db04e8a86d0454 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Wed, 6 Dec 2017 11:38:19 +0000 Subject: [PATCH] [Xamarin.Android.Build.Tasks] Dont clean the designtime folder Context https://bugzilla.xamarin.com/show_bug.cgi?id=60880 Turns out the design time build in Visual Studio does not clean up after itself.. ever. So we really should not be deleting the directory on a `Clean`. This commit move that code into is own internal target and updates the tests to reflect the changes. --- .../Tests/Xamarin.Android.Build.Tests/BuildTest.cs | 4 +++- .../Xamarin.Android.Common.targets | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index a30f1f963c6..52a5970ae3e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -1862,8 +1862,10 @@ public void BuildInDesignTimeMode ([Values(false, true)] bool useManagedParser) Assert.IsFalse (builder.Output.IsTargetSkipped ("_CreatePropertiesCache"), "target \"_CreatePropertiesCache\" should have been run."); Assert.IsTrue (builder.Output.IsTargetSkipped ("_ResolveLibraryProjectImports"), "target \"_ResolveLibraryProjectImports\' should have been skipped."); Assert.IsTrue (builder.Clean (proj), "Clean Should have succeeded"); + builder.Target = "_CleanDesignTimeIntermediateDir"; + Assert.IsTrue (builder.Build (proj), "_CleanDesignTimeIntermediateDir should have succeeded"); librarycache = Path.Combine (Root, path, proj.IntermediateOutputPath, "designtime", "libraryprojectimports.cache"); - Assert.IsFalse (File.Exists (librarycache), $"'{librarycache}' should exist."); + Assert.IsFalse (File.Exists (librarycache), $"'{librarycache}' should not exist."); } } diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 807c3ff8ae8..a9f11bad62c 100755 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -2611,6 +2611,10 @@ because xbuild doesn't support framework reference assemblies. + + + + @@ -2636,7 +2640,6 @@ because xbuild doesn't support framework reference assemblies. -