-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Setup Maui.sln with a set of net6 projects #13433
Conversation
NuGet.config
Outdated
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" /> | ||
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmarinho these are needed to build the net6 platform heads
https://github.com/xamarin/Xamarin.Legacy.Sdk/blob/main/samples/nuget.config#L7
- template: common/controlgallery-android.yml | ||
|
||
- stage: build_net6_windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These YAML steps were taken from here
https://github.com/xamarin/net6-samples/blob/main/azure-pipelines.yml
For installing the latest NET6 bits and such
At some point this will all get moved into easier to provision bits via the dotnet tool
<ItemGroup> | ||
<ProjectReference Include="..\Sample\Sample-net6.csproj" /> | ||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" /> | ||
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.3.0.4" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed so that the linker runs successfully against Essentials.
Nuget currently won't pull in all the correct dlls transitively since these are AndroidX dlls and not Net6
public class AppDelegate : FormsApplicationDelegate, IUIApplicationDelegate | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting this out for now with NET6 targets because Platform.iOS
is built against XA and not net6-ios
Once Platform.iOS
is built against net6-ios then we can go back to FormsApplicationDelegate
@@ -22,7 +22,7 @@ public static void UpdateBackgroundColor(this UIView nativeView, IView view) | |||
|
|||
var color = view.BackgroundColor; | |||
|
|||
if (color != null && !color.IsDefault) | |||
if (!color.IsDefault) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nullability checks inside NET6 throw a warning here because color will always be not null
@@ -38,7 +38,7 @@ | |||
|
|||
<!-- Auto install any missing Android SDKs --> | |||
<PropertyGroup Condition="'$(CI)' == 'true'"> | |||
<AndroidRestoreOnBuild Condition="'$(AndroidRestoreOnBuild)' == ''">True</AndroidRestoreOnBuild> | |||
<AndroidRestoreOnBuild Condition="'$(AndroidRestoreOnBuild)' == ''">False</AndroidRestoreOnBuild> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property currently doesn't work with NET6
eeebbd2
to
34add85
Compare
|
||
- powershell: | | ||
& dotnet restore Maui.sln --configfile eng\DevopsNuget.config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmarinho FYI
|
||
- bash: | | ||
dotnet restore Maui.sln --configfile eng/DevopsNuget.config && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmarinho FYI
|
||
<!-- iOS --> | ||
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-ios' "> | ||
<DefineConstants>$(DefineConstants);IOS</DefineConstants> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be defined by default in .NET 6. Is it not?
|
||
<!-- Android --> | ||
<PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-android'))"> | ||
<DefineConstants>$(DefineConstants);MONOANDROID</DefineConstants> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use the ANDROID define instead, it is there by default in .NET 6.
## Maui.sln | ||
|
||
### SDKS required | ||
- Install the SDKs listed here https://github.com/xamarin/net6-samples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We moved the repo to dotnet/net6-mobile-samples
Description of Change
Testing Procedure
PR Checklist