Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] Dont clean the designtime folder (#1074)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dellis1972 authored and jonpryor committed Dec 6, 2017
1 parent 67dd3e5 commit 34a3774
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2611,6 +2611,10 @@ because xbuild doesn't support framework reference assemblies.
<RemoveDirFixed Directories="$(OutDir)$(_AndroidPackage).apk.mSYM" Condition=" '$(_AndroidPackage)' != '' And Exists ('$(OutDir)$(_AndroidPackage).apk.mSYM')" />
</Target>

<Target Name="_CleanDesignTimeIntermediateDir">
<RemoveDirFixed Directories="$(_AndroidDesignTimeResDirIntermediate)" Condition="Exists ('$(_AndroidDesignTimeResDirIntermediate)')" />
</Target>

<Target Name="_CleanGeneratedDeploymentFiles">
<CreateItem Include="$(IntermediateOutputPath)*.deployment">
<Output TaskParameter="Include" ItemName="_OutputDeploymentFiles" />
Expand All @@ -2636,7 +2640,6 @@ because xbuild doesn't support framework reference assemblies.
<RemoveDirFixed Directories="$(MonoAndroidIntermediate)proguard" Condition="Exists ('$(MonoAndroidIntermediate)proguard')" />
<RemoveDirFixed Directories="$(MonoAndroidIntermediateResourceCache)" Condition="Exists ('$(MonoAndroidIntermediateResourceCache)')" />
<RemoveDirFixed Directories="$(_AndroidAotBinDirectory)" Condition="Exists ('$(_AndroidAotBinDirectory)')" />
<RemoveDirFixed Directories="$(_AndroidDesignTimeResDirIntermediate)" Condition="Exists ('$(_AndroidDesignTimeResDirIntermediate)')" />
<Delete Files="$(IntermediateOutputPath)_dex_stamp" />
<Delete Files="$(MonoAndroidIntermediate)R.cs.flag" />
<Delete Files="$(MonoAndroidIntermediate)acw-map.txt" />
Expand Down

0 comments on commit 34a3774

Please sign in to comment.