From 0b1378857fd466838ca81bc1a79a65bd207eb71a Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 30 May 2018 12:11:47 -0500 Subject: [PATCH] [Xamarin.Android.Cecil] fix assembly names if using $(CecilSourceDirectory) Context: https://github.com/xamarin/xamarin-android/pull/1747 Downstream in xamarin-android, I started getting a build failure on Windows such as: xamarin-android\external\Java.Interop\src\Xamarin.Android.Cecil\Xamarin.Android.Cecil.targets(23,5): error MSB3375: The file "..\..\bin\Debug\\Xamarin.Android.Cecil.dll" does not exist. xamarin-android\external\Java.Interop\src\Xamarin.Android.Cecil\Xamarin.Android.Cecil.targets(23,5): error MSB3375: The file "..\..\bin\Debug\\Xamarin.Android.Cecil.Mdb.dll" does not exist. Looking in my `external\Java.Interop\bin\Debug` directory, the `Mono.Cecil` assemblies were named `Mono.Cecil.*` instead of `Xamarin.Android.*`. I think this was an oversight, but I don't know how the builds were green... Looking at `Mono.Cecil.csproj` in `xamarin-android/external/mono/external/cecil` there was no way to override `AssemblyName`. But we can use the `` task instead. To fix this: - Added a `_MonoCecilAssemblies` to check for any files named `Mono.Cecil.*` - `` the files to start with `Xamarin.Android.*` instead. --- src/Xamarin.Android.Cecil/Xamarin.Android.Cecil.targets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Xamarin.Android.Cecil/Xamarin.Android.Cecil.targets b/src/Xamarin.Android.Cecil/Xamarin.Android.Cecil.targets index 7d4fca333..a471a38c3 100644 --- a/src/Xamarin.Android.Cecil/Xamarin.Android.Cecil.targets +++ b/src/Xamarin.Android.Cecil/Xamarin.Android.Cecil.targets @@ -20,6 +20,10 @@ Targets="Clean;Build" StopOnFirstFailure="True" Properties="Configuration=net_4_0_Debug;OutputPath=$(CecilOutputPath);BuildingSolutionFile=false" /> + + <_MonoCecilAssemblies Include="$(OutputPath)\Mono.Cecil.*" /> + +