From 9658a5c450beab94876d0842655fc62385d8827b Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 3 Nov 2017 09:06:27 -0500 Subject: [PATCH] [build] fix for Xamarin.Android.Build.Tasks re-build One issue here is that `obj/Debug/Profile.g.cs` is getting regenerated on every build, forcing `Xamarin.Android.Build.Tasks.csproj` to rebuild *every* time. It looks like the `IncrementalClean` target was the culprit, in that it deleted this file after the build completed. The fix here is to add to the `FileWrites` `ItemGroup`, but it only seems to work if `FileWrites` includes the absolute path to the file. Including `$(MSBuildThisFileDirectory)` in front of `$(_GenerateProfileClass)` makes sure it is the absolute path. --- .../Xamarin.Android.Build.Tasks.targets | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index 42176bd59b1..05bdb8e7c0a 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -7,7 +7,7 @@ <_SharedRuntimeBuildPath Condition=" '$(_SharedRuntimeBuildPath)' == '' ">$(XAInstallPrefix)xbuild-frameworks\MonoAndroid\ - <_GeneratedProfileClass>$(IntermediateOutputPath)Profile.g.cs + <_GeneratedProfileClass>$(MSBuildThisFileDirectory)$(IntermediateOutputPath)Profile.g.cs _GenerateXACommonProps; $(BuildDependsOn); @@ -140,6 +140,9 @@ File="$(IntermediateOutputPath)$(CleanFile)" Lines="$(_GeneratedProfileClass)" Overwrite="false"/> + + +