Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Stop producing Xamarin.Android.Cecil.dll #8489

Merged
merged 10 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .external
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
xamarin/monodroid:main@4d3ede83f699e1d127fed4a18de992819983d715
xamarin/monodroid:main@c5f1e77bc732dc660090a8d59048f07de846ccd7
mono/mono:2020-02@6dd9def57ce969ca04a0ecd9ef72c0a8f069112d
4 changes: 0 additions & 4 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,6 @@
<AndroidSupportedTargetAotAbisForConditionalChecks Condition=" !$(AndroidSupportedTargetAotAbisForConditionalChecks.StartsWith (':')) " >:$(AndroidSupportedTargetAotAbisForConditionalChecks)</AndroidSupportedTargetAotAbisForConditionalChecks>
<AndroidSupportedTargetAotAbisSplit>$(AndroidSupportedTargetAotAbis.Split(':'))</AndroidSupportedTargetAotAbisSplit>
</PropertyGroup>
<PropertyGroup>
<RemapAssemblyRefToolExecutable>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\remap-assembly-ref\remap-assembly-ref.dll</RemapAssemblyRefToolExecutable>
<RemapAssemblyRefTool>$(ManagedRuntime) $(ManagedRuntimeArgs) &quot;$(RemapAssemblyRefToolExecutable)&quot;</RemapAssemblyRefTool>
</PropertyGroup>

<!-- Unit Test Properties -->
<PropertyGroup>
Expand Down
7 changes: 0 additions & 7 deletions Xamarin.Android.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jnienv-gen", "build-tools\j
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "api-merge", "build-tools\api-merge\api-merge.csproj", "{3FC3E78B-F7D4-42EA-BBE8-4535DF42BFF8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "remap-assembly-ref", "build-tools\remap-assembly-ref\remap-assembly-ref.csproj", "{C876DA71-8573-4CEF-9149-716D72455ED4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{04E3E11E-B47D-4599-8AFC-50515A95E715}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Java.Interop", "external\Java.Interop\src\Java.Interop\Java.Interop.csproj", "{94BD81F7-B06F-4295-9636-F8A3B6BDC762}"
Expand Down Expand Up @@ -145,10 +143,6 @@ Global
{3FC3E78B-F7D4-42EA-BBE8-4535DF42BFF8}.Debug|AnyCPU.Build.0 = Debug|Any CPU
{3FC3E78B-F7D4-42EA-BBE8-4535DF42BFF8}.Release|AnyCPU.ActiveCfg = Release|Any CPU
{3FC3E78B-F7D4-42EA-BBE8-4535DF42BFF8}.Release|AnyCPU.Build.0 = Release|Any CPU
{C876DA71-8573-4CEF-9149-716D72455ED4}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
{C876DA71-8573-4CEF-9149-716D72455ED4}.Debug|AnyCPU.Build.0 = Debug|Any CPU
{C876DA71-8573-4CEF-9149-716D72455ED4}.Release|AnyCPU.ActiveCfg = Release|Any CPU
{C876DA71-8573-4CEF-9149-716D72455ED4}.Release|AnyCPU.Build.0 = Release|Any CPU
{94BD81F7-B06F-4295-9636-F8A3B6BDC762}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
{94BD81F7-B06F-4295-9636-F8A3B6BDC762}.Debug|AnyCPU.Build.0 = Debug|Any CPU
{94BD81F7-B06F-4295-9636-F8A3B6BDC762}.Release|AnyCPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -361,7 +355,6 @@ Global
{1D4FC8F1-0DA4-4F38-BE68-11AEBA9A0EA4} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
{AFB8F6D1-6EA9-42C3-950B-98F34C669AD2} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62}
{3FC3E78B-F7D4-42EA-BBE8-4535DF42BFF8} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62}
{C876DA71-8573-4CEF-9149-716D72455ED4} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62}
{94BD81F7-B06F-4295-9636-F8A3B6BDC762} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
{B501D075-6183-4E1D-92C9-F7B5002475B1} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
{D14A1B5C-2060-4930-92BE-F7190256C735} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
Expand Down

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@
<_MSBuildFiles Include="@(_LocalizationLanguages->'$(MicrosoftAndroidSdkOutDir)%(Identity)\Xamarin.Android.Build.Tasks.resources.dll')" />
<_MSBuildFiles Include="@(_LocalizationLanguages->'$(MicrosoftAndroidSdkOutDir)%(Identity)\Xamarin.Android.Tools.AndroidSdk.resources.dll')" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.BuildInfo.txt" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Cecil.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Cecil.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Cecil.Mdb.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Cecil.Mdb.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Mono.Cecil.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Mono.Cecil.pdb" />
Comment on lines +148 to +149
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first concern was that MAUI ships Mono.Cecil, will we conflict?

So, I downloaded the package and inspected it: https://www.nuget.org/packages/Mono.Cecil/0.11.4

It looks to be strong named and appropriately versioned:

image

So, what may happen is that if MAUI ships Mono.Cecil, we may use theirs or vice-versa if the version & strong name key match. Although, it will likely "just work" if the version is identical.

I don't think there is a problem here -- it should work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem used to be with VS extensions. It was never with other products like iOS etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET framework should know how to respect strong named + versioned assemblies and load new instances of them.

VS Mac would have had an issue on Mono, but I believe it will be out of support and never be able to build .NET 9 projects. VS Mac also made it to .NET 6, in its latest version?

<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Mono.Cecil.Mdb.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Mono.Cecil.Mdb.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Common.props" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Common.targets" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.D8.targets" />
Expand Down
42 changes: 0 additions & 42 deletions build-tools/remap-assembly-ref/remap-assembly-ref.cs

This file was deleted.

18 changes: 0 additions & 18 deletions build-tools/remap-assembly-ref/remap-assembly-ref.csproj

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ static class KnownProperties
public const string Pkg7Zip_CommandLine = "Pkg7-Zip_CommandLine";
public const string PkgXamarin_LibZipSharp = "PkgXamarin_LibZipSharp";
public const string ProductVersion = "ProductVersion";
public const string RemapAssemblyRefToolExecutable = "RemapAssemblyRefToolExecutable";
public const string XABuildToolsFolder = "XABuildToolsFolder";
public const string XABuildToolsVersion = "XABuildToolsVersion";
public const string XABuildToolsPackagePrefixMacOS = "XABuildToolsPackagePrefixMacOS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ namespace Xamarin.Android.Prepare
properties.Add (KnownProperties.Pkg7Zip_CommandLine, StripQuotes (@"@Pkg7-Zip_CommandLine@"));
properties.Add (KnownProperties.PkgXamarin_LibZipSharp, StripQuotes (@"@PkgXamarin_LibZipSharp@"));
properties.Add (KnownProperties.ProductVersion, StripQuotes ("@ProductVersion@"));
properties.Add (KnownProperties.RemapAssemblyRefToolExecutable, StripQuotes (@"@RemapAssemblyRefToolExecutable@"));
properties.Add (KnownProperties.XABuildToolsFolder, StripQuotes (@"@XABuildToolsFolder@"));
properties.Add (KnownProperties.XABuildToolsVersion, StripQuotes ("@XABuildToolsVersion@"));
properties.Add (KnownProperties.XABuildToolsPackagePrefixMacOS, StripQuotes ("@XABuildToolsPackagePrefixMacOS@"));
Expand Down
31 changes: 0 additions & 31 deletions build-tools/xaprepare/xaprepare/Application/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,37 +108,6 @@ static void FillCurrentAbis (Context context, ref HashSet<string>? currentAbis)
Utilities.AddAbis (context.Properties.GetRequiredValue (KnownProperties.AndroidSupportedHostJitAbis).Trim (), ref currentAbis);
}

public static void PropagateXamarinAndroidCecil (Context context)
{
const string CecilAssembly = "Xamarin.Android.Cecil.dll";

CopyFile (
Path.Combine (Configurables.Paths.InstallMSBuildDir, CecilAssembly),
Path.Combine (Configurables.Paths.ExternalJavaInteropDir, "bin", context.Configuration, CecilAssembly)
);
}

public static async Task<bool> BuildRemapRef (Context context, bool haveManagedRuntime, string managedRuntime, bool quiet = false)
{
if (!quiet)
Log.StatusLine ("Building remap-assembly-ref");

var msbuild = new MSBuildRunner (context);
string projectPath = Path.Combine (Configurables.Paths.BuildToolsDir, "remap-assembly-ref", "remap-assembly-ref.csproj");
bool result = await msbuild.Run (
projectPath: projectPath,
logTag: "remap-assembly-ref",
binlogName: "build-remap-assembly-ref"
);

if (!result) {
Log.ErrorLine ("Failed to build remap-assembly-ref");
return false;
}

return true;
}

public static string ToXamarinAndroidPropertyValue (ICollection<string> coll)
{
if (coll == null)
Expand Down
32 changes: 0 additions & 32 deletions build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -713,38 +713,6 @@ partial class Runtimes
shared: true
),

// Xamarin.Android.Cecil.dll
new RuntimeFile (
sourceCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.BuildBinDir, "Xamarin.Android.Cecil.dll"),
destinationCreator: (Runtime runtime) => "Xamarin.Android.Cecil.dll",
strip: false,
shared: true
),

// Xamarin.Android.Cecil.pdb
new RuntimeFile (
sourceCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.BuildBinDir, "Xamarin.Android.Cecil.pdb"),
destinationCreator: (Runtime runtime) => "Xamarin.Android.Cecil.pdb",
strip: false,
shared: true
),

// Xamarin.Android.Cecil.Mdb.dll
new RuntimeFile (
sourceCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.BuildBinDir, "Xamarin.Android.Cecil.Mdb.dll"),
destinationCreator: (Runtime runtime) => "Xamarin.Android.Cecil.Mdb.dll",
strip: false,
shared: true
),

// Xamarin.Android.Cecil.Mdb.pdb
new RuntimeFile (
sourceCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.BuildBinDir, "Xamarin.Android.Cecil.Mdb.pdb"),
destinationCreator: (Runtime runtime) => "Xamarin.Android.Cecil.Mdb.pdb",
strip: false,
shared: true
),

new RuntimeFile (
sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), "lib", "libmonosgen-2.0.dll.a"),
destinationCreator: (Runtime runtime) => Path.Combine (GetRuntimeOutputDir (runtime), "libmonosgen-2.0.dll.a"),
Expand Down
Loading
Loading