* Use Factory methods in DependencyInjection
Using factory methods and directly invoking the constructors instead of letting DI use reflection to find the constructor.
In local testing this appeared to shave off ~7ms from startup of a dotnet new maui app.
* Introduce BannedApiAnalyzers
- Add TryAddSingleton`2 to the banned API list
* Remove legacy TFM projects
* Rename solution files
* Remove old sln files
* Help omnisharp
Adds an omnisharp.json config file to help ignore some projects that don't load well.
But also add an _omnisharp.sln since Omnisharp basically finds the first solution it can regardless of the config file excludes and will try and load those projects. This puts it high in the list and is generally convenient to work on the main projects from the repo within omnisharp.
* Ignore .csx in omnisharp
* Fix android api level warning
* Fix up tfm logic
This will make net7.0 easier to start building against too.
* Make TFM runtime value dynamic
* Fix closing tag
* Add another project to omnisharp exclude
* Fix some logic
* Fix msbuild property function call
* Clean up resizetizer
These targets actually ship so they need to not just _use_ the Maui properties from directory build props
* Fix bad copy paste
* Another copy paste fix
* More fixes
* Add Controls.Xaml (missing) back to sln
* Drop S.N.Vectors version in csproj
It gets updated from other targets
* Don't set versions for WPF
* Bring back IsBindingProject
* Fix bad copy paste
* Make GetTfm static
* Fix missing namespace prefix
* Properly replace the TFM in BundledVersions
* Second replace should update the file the first one output
* Fix input for second replace
* Update the templates with the correct TFM
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
* Specify the minimum versions of the platforms
* maccat 13.1
* win10
* Merge all the version numbers
* ws
* not needed as winui controls these numbers
* seems this is not real
* we are going global!
Context: https://github.com/jonathanpeppers/CustomResourceDesigner
Context: https://github.com/xamarin/xamarin-android/issues/6310
We found a systemic problem with Xamarin.Android class libraries:
* Include AndroidX & Google Material
* Include at least one `@(AndroidResource)` and use the ID from C#
* `Resource.designer.cs` has 2,700+ fields. That's a lot!
This problem compounds itself as you include more class libraries that
depend on each other. The main app will end up repeatedly setting
these fields at startup for each library that contains fields in
`Resource.designer.cs`...
Reviewing the .NET MAUI fields, I found:
src\Core\src\obj\Debug\net6.0-android\Resource.designer.cs
5310
src\Controls\src\Core\obj\Debug\net6.0-android\Resource.designer.cs
5167 fields
src\Controls\src\Xaml\obj\Release\net6.0-android\Resource.designer.cs
5167 fields
src\Compatibility\Core\src\obj\Debug\net6.0-android\Resource.designer.cs
5333 fields
src\Essentials\src\obj\Debug\net6.0-android\Resource.designer.cs
204 fields
In fact, I found 21,497 fields were set at startup for a `dotnet new
maui` app in `Resource.designer.cs`!
In many projects you can simply set `$(AndroidGenerateResourceDesigner)`
to `false`, but the issue is .NET MAUI actually uses some of the C#
`Resource.designer.cs` values at runtime.
So to solve the problem here, I came up with a new pattern:
https://github.com/jonathanpeppers/CustomResourceDesigner
We can copy the contents of `Resource.designer.cs` and manually delete
all the fields we don't need. This allows
`$(AndroidGenerateResourceDesigner)` to be turned off.
We are working on a long-term solution for this issue in
Xamarin.Android, but we can do this workaround in .NET MAUI now.
~~ Results ~~
Building a `dotnet new maui` then `dotnet build -c Release` and
running on a Pixel 5.
Before:
* 21,497 fields set at startup in UpdateIdValues()
* Activity Displayed: 1s454ms
* .apk size: 17300275 bytes
After:
* 65 fields set at startup in UpdateIdValues()
* Activity Displayed: 1s079ms
* .apk size: 16677683 bytes
> apkdiff -f before.apk after.apk
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 233 assemblies/Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup.dll
- 5,264 assemblies/Microsoft.Maui.Essentials.dll
- 103,010 assemblies/Microsoft.Maui.dll
- 103,260 assemblies/Microsoft.Maui.Controls.Compatibility.dll
- 103,811 assemblies/Microsoft.Maui.Controls.Xaml.dll
- 106,127 assemblies/Microsoft.Maui.Controls.dll
- 201,031 assemblies/foo.dll
Summary:
+ 0 Other entries 0.00% (of 2,139,558)
- 622,736 Assemblies -6.93% (of 8,987,664)
+ 0 Dalvik executables 0.00% (of 6,440,988)
+ 0 Shared libraries 0.00% (of 9,860,264)
- 1,340,928 Uncompressed assemblies -6.55% (of 20,465,016)
- 622,592 Package size difference -3.60% (of 17,300,275)
I found `dotnet cake` fails with:
C:\src\maui\src\Workload\Microsoft.Maui.Controls.Sdk\Microsoft.Maui.Controls.Sdk.csproj(53,5):
error MSB4044: The "ReplaceText" task was not given a value for the required parameter "NewValue".
This is happening because `$(CI)` is not set, and
`$(PackageReferenceVersion)` is blank.
To solve this issue going forward:
* Make a `eng/Versions.dev.targets` as a local replacement for
`eng/Versions.targets`.
* Create a `SetVersions` target so we don't need to declare the empty
one anymore in several files.
* Set `$(PackageReferenceVersion)` and `$(VSComponentVersion)` to the
default `$(PackageVersion)` value that comes from
`Directory.Build.props`.
Now when I run `dotnet cake`, it is successful.
* [templates] remove Directory.Build.targets, add @(ProjectCapability)
The `Directory.Build.targets` files in the templates were a collection
of workarounds that were needed until .NET MAUI was a workload. When
.NET MAUI was a NuGet package, this was the only way to set required
values for the IDE before NuGet restore. In the early days, you had to
unload/reload MAUI projects after NuGet restore.
We can remove `Directory.Build.targets` from templates now, and
consolidate `@(ProjectCapability)` so this is defined by the workload.
The following capabilities are defined for the IDE:
* `Maui`
* When `$(SingleProject)` is `true`:
* `MauiSingleProject`, `LaunchProfiles`
* `XamarinStaticLaunchProfiles` older than Dev17
* `LaunchProfilesGroupByPlatformFilters` otherwise
These new capabilities are defined to identify projects (via telemetry)
that bring in portions of .NET MAUI:
* `MauiAssets`
* `MauiBlazor`
* `MauiCore`
* `MauiEssentials`
Other changes:
* `$(_KeepLaunchProfiles)` is set by default when `$(SingleProject)`
is `true`.
* WinUI workarounds are moved into `WinUI.SingleProject.targets`.
* Fixed `sdk-manifests` casing for `src/DotNet/DotNet.csproj -t:Install`
* Remove CI trimming workaround
* Update WinUI.SingleProject.targets
* Update Directory.Build.targets
Co-authored-by: Jonathan Dick <jond@hey.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview7-8ca289588b6969a2cc878afa0813afec8cd63dd3-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.7.91 -> To Version 30.0.100-preview.7.93
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.7.21326.8 -> To Version 6.0.0-preview.7.21368.2 (parent: Microsoft.Dotnet.Sdk.Internal
* [build] remove workaround for iOS AOT packages on Windows
* Ignore NU1703 in DeviceTests
NU1703 warns about using nuget packages which have xamarin.ios tfm references from a newer net6.0-maccatalyst project.
* Workaround error for implicit imports
Context: https://github.com/dotnet/sdk/issues/19050
and 4fb7c147f8
* Ignore NU1703 for Mac Catalyst projects
* Revert "Ignore NU1703 in DeviceTests"
This reverts commit 8fdf5e10a292d824fb2c99e7b32bbbe8c81fb4e2.
* Revert "Revert "Ignore NU1703 in DeviceTests""
This reverts commit 4d0456d558b4be5e41a6ee8a6217641162a34c6d.
* Fix other C# 10-related errors
* Use `LangVersion=latest` by default
* Fixed new NRT-related errors that appeared from C# 10.0
* Disable StaticWebAssets in MauiRazorClassLibrarySample
Workaround to get the build to work. Will revert later to investigate.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Co-authored-by: Jonathan Dick <jondick@gmail.com>
Co-authored-by: Eilon Lipton <Eilon@users.noreply.github.com>
* Update dependencies from https://github.com/xamarin/xamarin-android build main-e5103b0f97d542ce14f2ceb9f2d3a247aa6d5964-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.62 -> To Version 30.0.100-ci.main.73
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.6.21352.12 -> To Version 6.0.0-preview.7.21326.8 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20210707.26
Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
From Version 12.0.100-preview.6.63 -> To Version 12.0.100-ci.main.142
* Full Android workload has been renamed to android-aot
If you don't need AOT, the `android` workload excludes it.
Note that AOT isn't working yet, but we have the Mono packs setup.
* Use shortened Apple platform workload names
The names are now `maccatalyst`, `macos`, `ios`, and `tvos`.
* One more place the android workload name is used
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20210707.26
Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
From Version 12.0.100-preview.6.63 -> To Version 12.0.100-ci.main.142
Conflicts:
eng/Versions.props
* Use shortened Apple platform workload names
The names are now `maccatalyst`, `macos`, `ios`, and `tvos`.
* Update dependencies from https://github.com/xamarin/xamarin-android build main-7c5fab13329ee898fb1562f83576a7ca881f2881-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.62 -> To Version 30.0.100-ci.main.75
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.6.21352.12 -> To Version 6.0.0-preview.7.21326.8 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20210709.17
Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
From Version 12.0.100-preview.6.63 -> To Version 12.0.100-ci.main.150
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20210713.6
Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
From Version 12.0.100-preview.6.63 -> To Version 12.0.100-ci.main.159
* Revert "[build] remove workaround for iOS AOT packages on Windows"
This reverts commit 5231ec3509.
* Add NoWarn=CS8032 for Razor
* Update dependencies from https://github.com/xamarin/xamarin-android build main-e06d71320c8f5cebb31c42b15d8172b087a98761-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.62 -> To Version 30.0.100-ci.main.77
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.6.21352.12 -> To Version 6.0.0-preview.7.21326.8 (parent: Microsoft.Dotnet.Sdk.Internal
* Revert "Add NoWarn=CS8032 for Razor"
This reverts commit d7212d435c.
* Update dependencies from https://github.com/xamarin/xamarin-android build main-1d53c0095871293c38d16196982e83485a091a3f-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.62 -> To Version 30.0.100-ci.main.81
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.6.21352.12 -> To Version 6.0.0-preview.7.21326.8 (parent: Microsoft.Dotnet.Sdk.Internal
* Do it like a madman
* Update dependencies from https://github.com/xamarin/xamarin-android build main-7dacdd751dd0bd7b02ac443c32824f353a6da380-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.62 -> To Version 30.0.100-ci.main.83
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.6.21352.12 -> To Version 6.0.0-preview.7.21326.8 (parent: Microsoft.Dotnet.Sdk.Internal
* Update dependencies from https://github.com/xamarin/xamarin-android build main-24f272bd357d67a5e326d4cce55899a5b98905ae-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.62 -> To Version 30.0.100-ci.main.84
Dependency coherency updates
Microsoft.NETCore.App.Ref,Microsoft.Dotnet.Sdk.Internal,Microsoft.Extensions.Primitives,Microsoft.AspNetCore.App.Runtime.win-x64,Microsoft.Extensions.Hosting.Abstractions,Microsoft.Extensions.DependencyInjection.Abstractions,Microsoft.Extensions.DependencyInjection,Microsoft.Extensions.Configuration.Abstractions,Microsoft.Extensions.Configuration,Microsoft.Extensions.Logging.Abstractions,Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Console,Microsoft.Extensions.Logging.Debug,Microsoft.Extensions.FileProviders.Abstractions,Microsoft.Extensions.FileProviders.Embedded,Microsoft.AspNetCore.Authorization,Microsoft.AspNetCore.Components.WebView,Microsoft.AspNetCore.Components.Web,Microsoft.JSInterop,Microsoft.WindowsDesktop.App.Runtime.win-x64,System.CodeDom
From Version 6.0.0-preview.6.21352.12 -> To Version 6.0.0-preview.7.21326.8 (parent: Microsoft.Dotnet.Sdk.Internal
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-03b91941bf31a562b3243d3ac76846f0bac71636-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.53
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21323.1 (parent: Microsoft.Android.Sdk.Windows
* [build] set %TEMP% and %TMP%
Context: https://github.com/dotnet/sdk/issues/18516
Attempts to workaround the failure:
> D:\agent\1\s\bin\dotnet\dotnet workload install microsoft-android-sdk-full --skip-manifest-update --verbosity diag
...
Workload installation failed: Source and destination path must have identical roots. Move will not work across volumes.
If `dotnet` is in `D:\agent\1\s\bin\dotnet\dotnet` and `%TEMP%` is
`C:\Users\XAMARI~1\AppData\Local\Temp`, this seems to fail.
Setting `%TEMP%` to `.\bin\temp` in the current directory instead.
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-d515a1c8112c700ae9f22f9c27829cf54a79931e-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.54
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21323.1 (parent: Microsoft.Android.Sdk.Windows
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-9bc7166b808aa4c4456c960adb127970d9580fa1-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.55
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21324.9 (parent: Microsoft.Android.Sdk.Windows
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-f57c5c2a195d47a699a4043aa7ba5b3000278531-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.56
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21328.1 (parent: Microsoft.Android.Sdk.Windows
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20210629.4
Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
From Version 12.0.100-preview.6.60 -> To Version 12.0.100-preview.6.61
* Enable runtimeconfig.json support
We should no longer need to set `$(GenerateRuntimeConfigurationFiles)` to `false`.
* Install `microsoft-net-runtime-maccatalyst` manually
Context: a64b030fcc/dotnet/targets/WorkloadManifest.MacCatalyst.template.json
Currently, the build fails with:
error NETSDK1147: To build this project, the following workloads must be installed: microsoft-net-runtime-maccatalyst
It appears we are missing an `extends` for some xamarin-macios workloads.
* Revert "Install `microsoft-net-runtime-maccatalyst` manually"
This reverts commit 7e10ac4ab0.
* Manually patch MacCatalyst & iOS workload files
Context: d4baa2bd2b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/WorkloadManifest.targets
Previously I just tried installing an extra workload:
Workload with id microsoft-net-runtime-maccatalyst is not supported on this platform.
This workload will not install on Windows. For now I can just patch
the `WorkloadManifest.json` from xamarin/xamarin-macios to depend on
the missing workload.
Even after this, usage of `Microsoft.NETCore.App.Runtime.AOT.Cross` in
the dotnet/runtime `WorkloadManifest.targets` fails on Windows:
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst" />
...
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64" />
I can manually patch these files with a condition to not do this on
Windows.
* Set %TMP% and %TEMP% in another spot
* For now, include missing workload in maui-maccatalyst
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-3ed60bd3e4728f2ee08c6ceae1091d476743b5f0-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.58
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21328.1 (parent: Microsoft.Android.Sdk.Windows
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20210630.10
Microsoft.macOS.Sdk , Microsoft.MacCatalyst.Sdk , Microsoft.iOS.Sdk , Microsoft.tvOS.Sdk
From Version 12.0.100-preview.6.60 -> To Version 12.0.100-preview.6.62
* Revert "For now, include missing workload in maui-maccatalyst"
This reverts commit 6eeee590ed.
* No longer need to patch microsoft.net.sdk.maccatalyst/WorkloadManifest.json
* Use --temp-dir switch instead of $TMP/$TEMP env vars
* [essentials] use AssemblyMetadata w/ IsTrimmable instead of Linkersafe
Context: https://github.com/xamarin/xamarin-android/pull/6054
This solves the warning (that is turned into an error):
src/Essentials/src/AssemblyInfo/AssemblyInfo.android.cs(3,12): error CS0618: 'LinkerSafeAttribute' is obsolete: 'For .NET 6+, please use: [assembly: global::System.Reflection.AssemblyMetadata("IsTrimmable", "True")]'
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-52a34e9c48bad7ae2cb16d28af9700f605163dda-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.60
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21329.10 (parent: Microsoft.Android.Sdk.Windows
* Update dependencies from https://github.com/xamarin/xamarin-android build 6.0.1xx-preview6-ac0333b7828fd72de2afb43c67d8212f18d5be43-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.6.51 -> To Version 30.0.100-preview.6.61
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref
From Version 6.0.100-preview.6.21313.2 -> To Version 6.0.100-preview.6.21351.1 (parent: Microsoft.Android.Sdk.Windows
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
* Update dependencies from https://github.com/xamarin/xamarin-android build main-6f532314cdf888a18bc0e1b33f4c0cf47339f91b-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.5.28 -> To Version 30.0.100-ci.main.38
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-preview.5.21302.13 -> To Version 6.0.100-preview.6.21313.2 (parent: Microsoft.Android.Sdk.Windows
* Add dependency for dotnet/runtime
* Install the microsoft-net-runtime-android workload
* Update dependencies from https://github.com/xamarin/xamarin-android build main-7e9f595f23ebd5b53385b16e3890bc90f95f6fef-1
Microsoft.Android.Sdk.Windows
From Version 30.0.100-preview.5.28 -> To Version 30.0.100-ci.main.40
Dependency coherency updates
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-preview.5.21302.13 -> To Version 6.0.100-preview.6.21313.2 (parent: Microsoft.Android.Sdk.Windows
* [android] disable runtimeconfig.json under VS MSBuild
Context: 7e9f595f23/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.RuntimeConfig.targets (L16-L17)
Build was failing with:
error MSB4062: The "RuntimeConfigParserTask" task could not be loaded from the assembly
For now, we can turn off `runtimeconfig.json` until we get this fix:
9af4b97f89
* [tests] remove usage of Assembly.Location
The linker gives a new error for:
src/Core/tests/DeviceTests.Android/TestInstrumentation.cs(35,56): error IL3000: 'System.Reflection.Assembly.Location' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.
I believe we should just be using `Assembly.GetName().Name` here instead.
* Update Directory.Build.props
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
* Update WinUI
* it builds but does not run
* stuff
* make it work
* this
* Revert "this"
This reverts commit e3f25c92ef.
* Revert "Revert "this""
This reverts commit 2670ad37b4.
* Revert "Revert "Revert "this"""
This reverts commit ba4c0e99ff.
* Revert "Revert "Revert "Revert "this""""
This reverts commit 82e6acf65d.
* more
* also breaks with 5.7
* repro
* Updat WinUI and add multitargeting hacks
* Fix a crash as a result of a new thing
* :)
* dsfad
* adf
* single project template
* MAUI_VERSION
* Remove xaml from embeddedresource in windows\
* Switch output type to winexe for windows
* Add more windows xaml conventions
- Page should exclude all windows excludes
- Page should be all subfolders in windows dir, and then link them appropriately
- Make applicationdefinition link to root where the build expects it
- add additional filename for application.xaml which is a windows convention too
* Also exclude Windows\ xaml files from MauiXaml
* this
* that
* make it work
* that
* zip
* whoopsies
* maybe this?
* Generate the Windows app icons
* that
* that
* Undo things
* this
* that
* ,
* Roll back for now
* More code changes
* gen that too
* that
* use resizetized images
* Non-square app icon files - windows' wide tile
* wide tiles!
* don't pack this
* decimals!
* no need for platforms
* Windows splash screens
* Create the directory
* The correct paths
* Build with WinUI 0.8.0-preivew
* Remove these
* Exclude None with Pack=true from Content
* Project reference
* File linking
* Use a full path
https://github.com/dotnet/roslyn/issues/52034
* not needed anymore
* AssignTargetPath before CreateManifestResourceName
* guids
* not here
* GUIDs
* No need for linux arm right now
* New blazor templates
* Bump the templates versions
* invariant culture
* Do it earlier and see
* that
Co-authored-by: Jonathan Dick <jondick@gmail.com>
* [build] Update to .NET 6 Preview 4
Brings in Preview 4 updates for the Android, MaciOS, and .NET SDks.
Initial build attempts were failing with hundreds of errors:
D:\a\1\s\src\Essentials\src\Connectivity\Connectivity.ios.tvos.macos.cs(12,70): error BI1234: 'CTCellularData' is obsolete: 'Starting with ios14.0 Use the 'CallKit' API instead.' [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj]
D:\a\1\s\src\Essentials\src\Compass\Compass.ios.cs(31,6): error CA1416: This call site is reachable on: 'iOS' 13.6 and later. 'CLLocationManager.HeadingFilter' is only supported on: 'macos' 11.0 and later. [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj]
D:\a\1\s\src\Core\src\Platform\MaciOS\ColorExtensions.cs(64,13): error CA1416: This call site is reachable on: 'MacCatalyst' 13.5 and later. 'UIColor.SystemBackgroundColor.get' is supported on: 'ios' 13.0 and later. [D:\a\1\s\src\Core\src\Core-net6.csproj]
CSC : error AD0001: Analyzer 'Microsoft.NetCore.Analyzers.InteropServices.PlatformCompatibilityAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. [D:\a\1\s\src\BlazorWebView\src\core\Microsoft.AspNetCore.Components.WebView.Maui.csproj]
The [platform compatibility analyzer][0] has been disabled for now, and
it can be enabled locally to work through the few hundred errors in
future PRs.
Once these issues were sorted, there were a handful of other breaks
that I've attempted to fix:
D:\a\1\s\src\Essentials\src\AssemblyInfo\AssemblyInfo.ios.tvos.watchos.macos.cs(3,12): error CS0618: 'LinkerSafeAttribute' is obsolete: 'Replace with '[assembly: System.Reflection.AssemblyMetadata ("IsTrimmable", "True")]'.' [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj]
D:\a\1\s\src\Compatibility\Core\src\iOS\Renderers\TabbedRenderer.cs(422,33): error CS1503: Argument 1: cannot convert from 'UIKit.UIStringAttributes' to 'UIKit.UITextAttributes' [D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj]
D:\a\1\s\src\Compatibility\Core\src\iOS\CollectionView\CarouselViewController.cs(106,23): error CS0114: 'CarouselViewController.DraggingStarted(UIScrollView)' hides inherited member 'UICollectionViewController.DraggingStarted(UIScrollView)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [ D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj]
D:\a\1\s\src\Compatibility\Core\src\iOS\CollectionView\CarouselViewController.cs(117,23): error CS0114: 'CarouselViewController.DraggingEnded(UIScrollView, bool)' hides inherited member 'UICollectionViewController.DraggingEnded(UIScrollView, bool)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [ D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj]
Finally it seems JDK 14 was being preferred on macOS machines in CI, so
I've set `$(JI_JAVA_HOME)` to the [pre-installed JDK 11][1].
[0]: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1416
[1]: https://github.com/actions/virtual-environments/blob/macOS-10.15/20210419.2/images/macos/macos-10.15-Readme.md#java
* Apply feedback, bump p4 bits, provision xcode 12.5 rc
* Use Big Sur pool, clean up duplicate variable declaration
* Revert "Use Big Sur pool, clean up duplicate variable declaration"
This reverts commit b91482e10c.
* Disable linker for ios and catalyst
Co-authored-by: Rui Marinho <me@ruimarinho.net>
Bump to Microsoft.Android.Sdk 11.0.200.118. This is needed for a fix
to support net6.0-android NuGet packages.
We have new AndroidX packages:
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.7-net6preview01" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.3.0.1-net6preview01" />
These are available on the same feed we have the iOS/Android runtime
packs for .NET 6:
<add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
These packs support both Xamarin.Android & .NET 6 because they contain
both sets of assemblies, such as:
* `lib/monoandroid90/Xamarin.AndroidX.*.dll`
* `lib/net6.0-android/Xamarin.AndroidX.*.dll`
To consolidate our AndroidX package versions, we can a new MSBuild
pattern for declaring NuGet package versions that
dotnet/project-system uses:
accdee5926/Directory.Build.targets (L3)accdee5926/build/import/Packages.targets
1. List packages in `.csproj` files as they are needed. But leave off
`%(Version)` completely.
2. A `Directory.Build.targets` somewhere does: `<PackageReference
Update="YourPackage" Version="1.0.0" />` This allows you to put the
version in one place, and you don't need to check platforms or
anything, because the `Update` doesn't do anything if the `.csproj`
file isn't using that package.
We could do this pattern across the whole Maui repo, but I just set
this up for the `AndroidX` and `Microsoft.Extensions` packages for
now.
~~ .NET 6 Linker ~~
Since we are using .NET 6 AndroidX packages, the following workaround
is no longer needed, so I removed them:
<PropertyGroup>
<_DotNetPackageVersion>6.0.0-preview.2.21110.7</_DotNetPackageVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.CodeDom" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Diagnostics.EventLog" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.IO.Ports" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Security.Permissions" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Threading.AccessControl" Version="$(_DotNetPackageVersion)" />
</ItemGroup>
Previously, the AndroidX packages were Xamarin.Android libraries, and
they would cause the linker to crash in `Release` builds:
ILLink : error IL1012: IL Linker has encountered an unexpected error. Please report the issue at https://github.com/mono/linker/issues
Fatal error in IL Linker
Unhandled exception. Mono.Linker.InternalErrorException: Step 'LoadReferencesStep' failed when processing assembly 'Maui.Controls.Sample.SingleProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
---> Mono.Linker.LinkerFatalErrorException: ILLink: error IL1010: Assembly 'Maui.Controls.Sample.SingleProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' cannot be loaded due to failure in processing 'Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' reference
---> Mono.Linker.LinkerFatalErrorException: ILLink: error IL1010: Assembly 'Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' cannot be loaded due to failure in processing 'Xamarin.AndroidX.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' reference
---> Mono.Linker.LinkerFatalErrorException: ILLink: error IL1010: Assembly 'Xamarin.AndroidX.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' cannot be loaded due to failure in processing 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' reference
---> Mono.Linker.LinkerFatalErrorException: ILLink: error IL1009: Assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' reference 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' could not be resolved
---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
---> System.IO.FileNotFoundException: Unable to find 'System.Security.Permissions.dll' or 'System.Security.Permissions.exe' file
~~ AndroidX obsoleted FragmentStatePagerAdapter ~~
Initially I got several warnings (that became errors), such as:
error CS0618: 'FragmentStatePagerAdapter' is obsolete...
I don't know what should be done here, so I ignored the warning in the
two files that have a problem for now:
#pragma warning disable 618
* [Build] Remove submodule
* [Build] Use GitInfo to set Assembly metadata
* [Build] Remove extra prop
* [Build] Update version
* [Build] Update versions to be consistent with existing Build.Tasks
* [Build] Update build number
* [Build] make sure build tasks gets info
* [Build] Add assembly info unit test
* [Test] Refactor test for gitinfo on vsts