Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
<!-- Version number from: https://github.com/dotnet/installer#installers-and-binaries -->
<!-- Please update DotNetRuntimePacksVersion below accordingly -->
<DotNetPreviewVersionBand Condition=" '$(DotNetPreviewVersionBand)' == '' ">6.0.100</DotNetPreviewVersionBand>
<DotNetPreviewVersionFull Condition=" '$(DotNetPreviewVersionFull)' == '' ">$(DotNetPreviewVersionBand)-preview.2.21155.3</DotNetPreviewVersionFull>
<DotNetPreviewVersionFull Condition=" '$(DotNetPreviewVersionFull)' == '' ">$(DotNetPreviewVersionBand)-preview.3.21161.23</DotNetPreviewVersionFull>
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI @rolfbjarne / @spouliot looks Android was able to bump to this version with just some minor changes.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we have a PR going here: dotnet/macios#10772, I was just waiting for P2 to go out first.

<!-- This version comes from the a file in the dotnet distribution: sdk/$(DotNetPreviewVersionFull)/dotnet.runtimeconfig.json (the `runtimeOptions/framework/version key`) -->
<DotNetRuntimePacksVersion Condition=" '$(DotNetRuntimePacksVersion)' == '' ">6.0.0-preview.2.21154.6</DotNetRuntimePacksVersion>
<DotNetRuntimePacksVersion Condition=" '$(DotNetRuntimePacksVersion)' == '' ">6.0.0-preview.3.21159.16</DotNetRuntimePacksVersion>
<ILLinkVersionBand Condition=" '$(ILLinkVersionBand)' == '' ">6.0.0</ILLinkVersionBand>
<ILLinkVersionFull Condition=" '$(ILLinkVersionFull)' == '' ">$(ILLinkVersionBand)-alpha.1.21109.1</ILLinkVersionFull>
<WixToolPath Condition=" '$(WixToolPath)' == '' ">$(AndroidToolchainDirectory)\wix\</WixToolPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<linker>
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Globalization.GlobalizationMode" />
<type fullname="System.Runtime.CompilerServices.InternalsVisibleToAttribute" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixed a crash in Mono.Android-Tests:

Can't find custom attr constructor image: Mono.Android.dll mtoken: 0x0a000464 due to:
Could not resolve type with token 010000fb from typeref (expected class 'System.Runtime.CompilerServices.InternalsVisibleToAttribute' in assembly 'System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') assembly:System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e type:System.Runtime.CompilerServices.InternalsVisibleToAttribute member:(null)

</assembly>
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ This file contains the .NET 5-specific targets to customize ILLink
<PropertyGroup>
<!-- make the output verbose to see what the linker is doing. FIXME: make dependent upon verbosity level -->
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --verbose --deterministic --custom-data XATargetFrameworkDirectories="$(_XATargetFrameworkDirectories)"</_ExtraTrimmerArgs>

<!-- we don't want to ignore stuff we can't find -->
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --skip-unresolved false</_ExtraTrimmerArgs>
<_AdditionalTaskAssemblyDirectory>$(XamarinSdkRootDirectory)tools/dotnet-linker/</_AdditionalTaskAssemblyDirectory>
<_AdditionalTaskAssembly>$(_AdditionalTaskAssemblyDirectory)dotnet-linker.dll</_AdditionalTaskAssembly>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ public void CheckEmbeddedSupportLibraryResources ()
KnownPackages.SupportV7AppCompat_27_0_2_1,
},
};
if (Builder.UseDotNet) {
proj.AddDotNetCompatPackages ();
}
using (var b = CreateApkBuilder ()) {
Assert.IsTrue (b.Build (proj), "First build should have succeeded.");
var Rdrawable = b.Output.GetIntermediaryPath (Path.Combine ("android", "bin", "classes", "android", "support", "v7", "appcompat", "R$drawable.class"));
Expand Down Expand Up @@ -989,9 +986,6 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
},
};
appProj.SetProperty ("AndroidUseManagedDesignTimeResourceGenerator", "True");
if (Builder.UseDotNet) {
appProj.AddDotNetCompatPackages ();
}
using (var libBuilder = CreateDllBuilder (Path.Combine (path, libProj.ProjectName), false, false)) {
libBuilder.AutomaticNuGetRestore = false;
Assert.IsTrue (libBuilder.RunTarget (libProj, "Restore"), "Library project should have restored.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ public void BuildReleaseArm64 ([Values (false, true)] bool forms)
if (forms) {
proj.PackageReferences.Clear ();
proj.PackageReferences.Add (KnownPackages.XamarinForms_4_7_0_1142);

if (Builder.UseDotNet)
proj.AddDotNetCompatPackages ();
}

byte [] apkDescData;
Expand Down Expand Up @@ -2039,9 +2036,7 @@ public void BuildWithNativeLibraries ([Values (true, false)] bool isRelease)
}
};
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86");
if (Builder.UseDotNet) {
proj.AddDotNetCompatPackages ();
} else {
if (!Builder.UseDotNet) {
//NOTE: Mono.Data.Sqlite and Mono.Posix do not exist in .NET 5+
proj.References.Add (new BuildItem.Reference ("Mono.Data.Sqlite"));
proj.References.Add (new BuildItem.Reference ("Mono.Posix"));
Expand Down Expand Up @@ -2564,8 +2559,6 @@ public void BuildReleaseApplicationWithNugetPackages ()
KnownPackages.AndroidSupportV4_27_0_2_1,
},
};
if (Builder.UseDotNet)
proj.AddDotNetCompatPackages ();
using (var b = CreateApkBuilder ()) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
var assets = b.Output.GetIntermediaryAsText (Path.Combine ("..", "project.assets.json"));
Expand Down Expand Up @@ -2659,8 +2652,6 @@ public void BuildAfterAddingNuget ()
string build_props = b.Output.GetIntermediaryPath ("build.props");
FileAssert.Exists (build_props, "build.props should exist after first build.");
proj.PackageReferences.Add (KnownPackages.SupportV7CardView_27_0_2_1);
if (Builder.UseDotNet)
proj.AddDotNetCompatPackages ();

Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true), "second build should have succeeded.");
FileAssert.Exists (build_props, "build.props should exist after second build.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void CheckIncludedAssemblies ()
"Java.Interop.dll",
"Mono.Android.dll",
"System.Private.CoreLib.dll",
"System.Runtime.CompilerServices.Unsafe.dll",
"System.Linq.dll",
"UnnamedProject.dll",
} :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,6 @@ namespace Xamarin.ProjectTools
{
public static class KnownPackages
{
/// <summary>
/// Adds additional dependencies for Xamarin.Forms, support libraries, etc. on .NET 5+
/// to workaround the issue similar to https://github.com/mono/linker/issues/1139
/// </summary>
public static void AddDotNetCompatPackages (this IShortFormProject project)
{
project.PackageReferences.Add (SystemCodeDom_5_0_0_preview_3_20214_6);
project.PackageReferences.Add (SystemDiagnosticsEventLog_5_0_0_preview_3_20214_6);
project.PackageReferences.Add (SystemDiagnosticsPerformanceCounter_5_0_0_preview_3_20214_6);
project.PackageReferences.Add (SystemIOPorts_5_0_0_preview_3_20214_6);
project.PackageReferences.Add (SystemSecurityPermissions_5_0_0_preview_3_20214_6);
project.PackageReferences.Add (SystemThreadingAccessControl_5_0_0_preview_3_20214_6);
}

public static Package AndroidSupportV4_27_0_2_1 = new Package () {
Id = "Xamarin.Android.Support.v4",
Version = "27.0.2.1",
Expand Down Expand Up @@ -222,38 +208,6 @@ public static void AddDotNetCompatPackages (this IShortFormProject project)
Version = "4.7.0.1142",
TargetFramework = "MonoAndroid10.0",
};
/* additional packages for XForms 4.5 on NET5 */
public static Package SystemCodeDom_5_0_0_preview_3_20214_6 = new Package {
Id = "System.CodeDom",
Version = "5.0.0-preview.3.20214.6",
TargetFramework = "netcoreapp3.0",
};
public static Package SystemDiagnosticsEventLog_5_0_0_preview_3_20214_6 = new Package {
Id = "System.Diagnostics.EventLog",
Version = "5.0.0-preview.3.20214.6",
TargetFramework = "netcoreapp3.0",
};
public static Package SystemDiagnosticsPerformanceCounter_5_0_0_preview_3_20214_6 = new Package {
Id = "System.Diagnostics.PerformanceCounter",
Version = "5.0.0-preview.3.20214.6",
TargetFramework = "netcoreapp3.0",
};
public static Package SystemIOPorts_5_0_0_preview_3_20214_6 = new Package {
Id = "System.IO.Ports",
Version = "5.0.0-preview.3.20214.6",
TargetFramework = "netcoreapp3.0",
};
public static Package SystemSecurityPermissions_5_0_0_preview_3_20214_6 = new Package {
Id = "System.Security.Permissions",
Version = "5.0.0-preview.3.20214.6",
TargetFramework = "netcoreapp3.0",
};
public static Package SystemThreadingAccessControl_5_0_0_preview_3_20214_6 = new Package {
Id = "System.Threading.AccessControl",
Version = "5.0.0-preview.3.20214.6",
TargetFramework = "netcoreapp3.0",
};
/* end of additional packages for XForms 4.5 on NET5 */
public static Package XamarinFormsMaps_4_0_0_425677 = new Package {
Id = "Xamarin.Forms.Maps",
Version = "4.0.0.425677",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ public override ProjectLanguage Language {
PackageReferences.Add (KnownPackages.Xamarin_Android_FSharp_ResourceProvider);
Sources.Remove (resourceDesigner);
OtherBuildItems.Add (new BuildItem.NoActionResource (() => "Resources\\Resource.designer" + Language.DefaultDesignerExtension) { TextContent = () => string.Empty });

if (Builder.UseDotNet) {
this.AddDotNetCompatPackages ();
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public XamarinAndroidWearApplicationProject (string debugConfigurationName = "De
TargetFrameworkVersion = Versions.KitkatWatch;
UseLatestPlatformSdk = true;
PackageReferences.Add (KnownPackages.AndroidWear_2_2_0);
if (Builder.UseDotNet) {
this.AddDotNetCompatPackages ();
}

MainActivity = default_main_activity;
StringsXml = default_strings_xml;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Runtime.CompilerServices;

Expand Down Expand Up @@ -43,7 +43,6 @@ public XamarinFormsAndroidApplicationProject (string debugConfigurationName = "D
{
if (Builder.UseDotNet) {
PackageReferences.Add (KnownPackages.XamarinForms_4_7_0_1142);
this.AddDotNetCompatPackages ();
} else {
PackageReferences.Add (KnownPackages.XamarinForms_4_0_0_425677);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public XamarinFormsXASdkProject (string outputType = "Exe", [CallerMemberName] s
: base (outputType, packageName)
{
PackageReferences.Add (KnownPackages.XamarinForms_4_7_0_1142);
this.AddDotNetCompatPackages ();

// Workaround for AndroidX, see: https://github.com/xamarin/AndroidSupportComponents/pull/239
Imports.Add (new Import (() => "Directory.Build.targets") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,25 @@
"Size": 316728
},
"assemblies/UnnamedProject.dll": {
"Size": 3075
"Size": 3084
},
"assemblies/System.Linq.dll": {
"Size": 10657
"Size": 10653
},
"assemblies/System.Runtime.CompilerServices.Unsafe.dll": {
"Size": 3384
},
"assemblies/System.Private.CoreLib.dll": {
"Size": 514928
"Size": 515824
},
"assemblies/Java.Interop.dll": {
"Size": 57483
"Size": 57083
},
"assemblies/Mono.Android.dll": {
"Size": 82533
"Size": 81984
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 68496
"Size": 68560
},
"lib/arm64-v8a/libSystem.IO.Compression.Native.so": {
"Size": 776168
Expand All @@ -56,23 +59,23 @@
"Size": 100408
},
"lib/arm64-v8a/libmonosgen-2.0.so": {
"Size": 3742608
"Size": 3737376
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 346768
"Size": 346960
},
"lib/arm64-v8a/libxamarin-debug-app-helper.so": {
"Size": 37064
"Size": 37096
},
"META-INF/ANDROIDD.SF": {
"Size": 2304
"Size": 2429
},
"META-INF/ANDROIDD.RSA": {
"Size": 1213
},
"META-INF/MANIFEST.MF": {
"Size": 2177
"Size": 2302
}
},
"PackageSize": 2885411
"PackageSize": 2889606
}
Loading