forked from dotnet/java-interop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cecil is an "interesting" complication: it's a dependency of Java.Interop, but Xamarin.Android use requires that it be "vendorized" -- renamed as `Xamarin.Android.Cecil.dll` -- to avoid previously seen issues because it's an unsigned assembly, and thus There Can Be Only One `Mono.Cecil.dll` loaded into an AppDomain, and whichever is loaded first "wins", but that version may not be compatible with what other assemblies in the AppDomain need, and... Renaming the assembly was just seen as the easiest solution. This choice hasn't been without its own shortcomings; see e.g. commits 168c94d ("priorities"), cfa74d3 (downstream build system changes), 5eeb287 ("rebuilds are hard"), 6717275 ("because of 168c94d, xamarin-android 'owns' the checkout, but that may not be API compatible, oops"), etc., etc. Plus, it kinda became moot with [dotnet/android@0c9f83b7][0] which removed the `mono` git submodule from xamarin-android. Instead of building mono from source -- and, implicitly, building *cecil* from source -- mono was instead obtained from a "mono archive" which contained a prebuilt `Mono.Cecil.dll` which was "renamed" to `Xamarin.Android.Cecil.dll`. Which meant that in a xamarin-android build, cecil should *never* be built from source anymore, which in turn meant that -- give or take the occasional build system bug -- `Java.Interop/src/Xamarin.Android.Cecil` and company were "dead code", as far as the commercial product is concerned. Meanwhile, the existance of `src/Xamarin.Android.Cecil` proved to be an ongoing source of maintenance pain, as -- depending on the IDE -- it couldn't build reliably, or would rebuild when it shouldn't have. Rethink the whole Cecil relationship. If xamarin-android doesn't require a cecil source checkout, why not ditch it entirely? Remove the `external/cecil` git submodule, and the `src/Xamarin.Android.Cecil*` projects, and replace them with NuGet package references to the [`Mono.Cecil` NuGet package][1]. What this means is that a "pure Java.Interop" build will now have *different* assembly references than the "same" utilities built from xamarin-android. For example, `generator.exe`, when built from Java.Interop, will reference `Mono.Cecil.dll`, while it will instead reference `Xamarin.Android.Cecil.dll` when built from xamarin-android. The `$(CecilSourceDirectory)` MSBuild property is used to determine whether the Mono.Cecil NuGet package or the `Xamarin.Android.Cecil.dll` assembly reference should be used at build time. [0]: dotnet/android@0c9f83b [1]: https://www.nuget.org/packages/Mono.Cecil/0.11.2
- Loading branch information
Showing
19 changed files
with
27 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Condition=" '$(CecilSourceDirectory)' == '' "> | ||
<PackageReference Include="Mono.Cecil" Version="0.11.2" /> | ||
</ItemGroup> | ||
<ItemGroup Condition=" '$(CecilSourceDirectory)' != '' "> | ||
<Reference Include="$(UtilityOutputFullPath)Xamarin.Android.Cecil.dll" /> | ||
</ItemGroup> | ||
</Project> |
Submodule cecil
deleted from
a6a7f5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
src/Xamarin.Android.Cecil/Xamarin.Android.Cecil.Mdb.csproj
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters