Skip to content

Commit

Permalink
Update to net7.0 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamescaper authored Nov 13, 2022
1 parent 34cf6e2 commit 3ae5d46
Show file tree
Hide file tree
Showing 35 changed files with 98 additions and 93 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET 6.0.400
- name: Install .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.400'
include-prerelease: true
dotnet-version: '7.0.x'
- name: Install MAUI
run: |
dotnet workload install maui `
--from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/6.0.486.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json `
--source https://api.nuget.org/v3/index.json
run: dotnet workload install maui
- name: Restore dependencies
run: dotnet restore BlazorBindings.Maui.sln
- name: Run tests
Expand Down
1 change: 1 addition & 0 deletions BlazorBindings.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
global.json = global.json
nuget.config = nuget.config
Readme.md = Readme.md
Expand Down
4 changes: 2 additions & 2 deletions samples/BlazorBindingsToDo/BlazorBindingsToDo.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>BlazorBindingsToDo</RootNamespace>
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
4 changes: 2 additions & 2 deletions samples/BlazorBindingsXaminals/BlazorBindingsXaminals.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>BlazorBindingsXaminals</RootNamespace>
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
4 changes: 2 additions & 2 deletions samples/ControlGallery/ControlGallery.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>ControlGallery</RootNamespace>
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
6 changes: 3 additions & 3 deletions samples/FluxorSample/FluxorSample.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>FluxorSample</RootNamespace>
<UseMaui>true</UseMaui>
Expand Down Expand Up @@ -47,7 +47,7 @@

<ItemGroup>
<PackageReference Include="Fluxor.Blazor.Web" Version="5.5.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/FluxorSample/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
6 changes: 3 additions & 3 deletions samples/FlyoutPageSample/FlyoutPageSample.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>FlyoutPageSample</RootNamespace>
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected override void HandleParameter(string name, object value)
case nameof(OnPress):
if (!Equals(OnPress, value))
{
void NativeControlPressed(object sender, EventArgs e) => InvokeAsync(() => OnPress.InvokeAsync());
void NativeControlPressed(object sender, EventArgs e) => InvokeEventCallback(OnPress);

OnPress = (EventCallback)value;
NativeControl.Pressed -= NativeControlPressed;
Expand All @@ -142,7 +142,7 @@ protected override void HandleParameter(string name, object value)
case nameof(OnRelease):
if (!Equals(OnRelease, value))
{
void NativeControlReleased(object sender, EventArgs e) => InvokeAsync(() => OnRelease.InvokeAsync());
void NativeControlReleased(object sender, EventArgs e) => InvokeEventCallback(OnRelease);

OnRelease = (EventCallback)value;
NativeControl.Released -= NativeControlReleased;
Expand All @@ -152,7 +152,7 @@ protected override void HandleParameter(string name, object value)
case nameof(OnClick):
if (!Equals(OnClick, value))
{
void NativeControlClicked(object sender, EventArgs e) => InvokeAsync(() => OnClick.InvokeAsync());
void NativeControlClicked(object sender, EventArgs e) => InvokeEventCallback(OnClick);

OnClick = (EventCallback)value;
NativeControl.Clicked -= NativeControlClicked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void NativeControlCheckedChanged(object sender, MC.CheckedChangedEventArgs e)
{
var value = NativeControl.IsChecked;
IsChecked = value;
InvokeAsync(() => IsCheckedChanged.InvokeAsync(value));
InvokeEventCallback(IsCheckedChanged, value);
}

IsCheckedChanged = (EventCallback<bool>)value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void NativeControlValueChanged(object sender, MC.ValueChangedEventArgs e)
{
var value = NativeControl.Value;
Value = value;
InvokeAsync(() => ValueChanged.InvokeAsync(value));
InvokeEventCallback(ValueChanged, value);
}

ValueChanged = (EventCallback<double>)value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void NativeControlValueChanged(object sender, MC.ValueChangedEventArgs e)
{
var value = NativeControl.Value;
Value = value;
InvokeAsync(() => ValueChanged.InvokeAsync(value));
InvokeEventCallback(ValueChanged, value);
}

ValueChanged = (EventCallback<int>)value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected override void HandleParameter(string name, object value)
case nameof(OnClick):
if (!Equals(OnClick, value))
{
void NativeControlClicked(object sender, EventArgs e) => InvokeAsync(() => OnClick.InvokeAsync());
void NativeControlClicked(object sender, EventArgs e) => InvokeEventCallback(OnClick);

OnClick = (EventCallback)value;
NativeControl.Clicked -= NativeControlClicked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void NativeControlValueChanged(object sender, AC.RatingValueChangedEventArgs e)
{
var value = NativeControl.Value;
Value = value;
InvokeAsync(() => ValueChanged.InvokeAsync(value));
InvokeEventCallback(ValueChanged, value);
}

ValueChanged = (EventCallback<int>)value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void NativeControlValueChanged(object sender, MC.ValueChangedEventArgs e)
{
var value = NativeControl.Value;
Value = value;
InvokeAsync(() => ValueChanged.InvokeAsync(value));
InvokeEventCallback(ValueChanged, value);
}

ValueChanged = (EventCallback<double>)value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void NativeControlPropertyChanged(object sender, PropertyChangedEventArgs e)
{
var value = NativeControl.IsOn;
IsOn = value;
InvokeAsync(() => IsOnChanged.InvokeAsync(value));
InvokeEventCallback(IsOnChanged, value);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ static AvatarView()
[Parameter] public Color BorderColor { get; set; }
[Parameter] public double? BorderWidth { get; set; }
[Parameter] public double? CharacterSpacing { get; set; }
[Parameter] public CornerRadius? CornerRadius { get; set; }
[Parameter] public MC.FontAttributes? FontAttributes { get; set; }
[Parameter] public bool? FontAutoScalingEnabled { get; set; }
[Parameter] public string FontFamily { get; set; }
Expand Down Expand Up @@ -65,13 +64,6 @@ protected override void HandleParameter(string name, object value)
NativeControl.CharacterSpacing = CharacterSpacing ?? default;
}
break;
case nameof(CornerRadius):
if (!Equals(CornerRadius, value))
{
CornerRadius = (CornerRadius?)value;
NativeControl.CornerRadius = CornerRadius ?? (CornerRadius)CMV.AvatarView.CornerRadiusProperty.DefaultValue;
}
break;
case nameof(FontAttributes):
if (!Equals(FontAttributes, value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected override void HandleParameter(string name, object value)
case nameof(OnDrawingLineCompleted):
if (!Equals(OnDrawingLineCompleted, value))
{
void NativeControlDrawingLineCompleted(object sender, DrawingLineCompletedEventArgs e) => InvokeAsync(() => OnDrawingLineCompleted.InvokeAsync(e));
void NativeControlDrawingLineCompleted(object sender, DrawingLineCompletedEventArgs e) => InvokeEventCallback(OnDrawingLineCompleted, e);

OnDrawingLineCompleted = (EventCallback<DrawingLineCompletedEventArgs>)value;
NativeControl.DrawingLineCompleted -= NativeControlDrawingLineCompleted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static Popup()
[Parameter] public MMP.LayoutAlignment? HorizontalOptions { get; set; }
[Parameter] public Size? Size { get; set; }
[Parameter] public MMP.LayoutAlignment? VerticalOptions { get; set; }
[Parameter] public MC.Window Window { get; set; }
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public EventCallback<PopupClosedEventArgs> OnClosed { get; set; }
[Parameter] public EventCallback<PopupOpenedEventArgs> OnOpened { get; set; }
Expand Down Expand Up @@ -80,13 +81,20 @@ protected override void HandleParameter(string name, object value)
NativeControl.VerticalOptions = VerticalOptions ?? (MMP.LayoutAlignment)CMV.Popup.VerticalOptionsProperty.DefaultValue;
}
break;
case nameof(Window):
if (!Equals(Window, value))
{
Window = (MC.Window)value;
NativeControl.Window = Window;
}
break;
case nameof(ChildContent):
ChildContent = (RenderFragment)value;
break;
case nameof(OnClosed):
if (!Equals(OnClosed, value))
{
void NativeControlClosed(object sender, PopupClosedEventArgs e) => InvokeAsync(() => OnClosed.InvokeAsync(e));
void NativeControlClosed(object sender, PopupClosedEventArgs e) => InvokeEventCallback(OnClosed, e);

OnClosed = (EventCallback<PopupClosedEventArgs>)value;
NativeControl.Closed -= NativeControlClosed;
Expand All @@ -96,7 +104,7 @@ protected override void HandleParameter(string name, object value)
case nameof(OnOpened):
if (!Equals(OnOpened, value))
{
void NativeControlOpened(object sender, PopupOpenedEventArgs e) => InvokeAsync(() => OnOpened.InvokeAsync(e));
void NativeControlOpened(object sender, PopupOpenedEventArgs e) => InvokeEventCallback(OnOpened, e);

OnOpened = (EventCallback<PopupOpenedEventArgs>)value;
NativeControl.Opened -= NativeControlOpened;
Expand Down
2 changes: 1 addition & 1 deletion samples/ThirdPartyControlsSample/Properties/Elements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[assembly: GenerateComponent(typeof(PulseIcon))]

// CommunityToolkit
[assembly: GenerateComponent(typeof(CommunityToolkit.Maui.Views.AvatarView))]
[assembly: GenerateComponent(typeof(CommunityToolkit.Maui.Views.AvatarView), Exclude = new[] { nameof(CommunityToolkit.Maui.Views.AvatarView.CornerRadius) })]
[assembly: GenerateComponent(typeof(CommunityToolkit.Maui.Views.DrawingView))]
[assembly: GenerateComponent(typeof(CommunityToolkit.Maui.Views.Popup), Exclude = new[] { nameof(CommunityToolkit.Maui.Views.Popup.Anchor) })]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand Down Expand Up @@ -47,7 +47,7 @@

<ItemGroup>
<PackageReference Include="AlohaKit" Version="1.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="1.3.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="3.0.0" />
<PackageReference Include="XCalendar.Maui" Version="4.2.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/BlazorBindings.Core/BlazorBindings.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<Title>Blazor Bindings Core Runtime</Title>
<Description>Common logic for using Blazor to target native renderers. For mobile app projects for Android and iOS use the BlazorBindings.Maui package.</Description>
<PackageTags>blazor;blazorbindings</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.0" />

<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>

<Description>Dotnet tool which generate BlazorBindings.Maui components for MAUI elements.</Description>
<PackAsTool>true</PackAsTool>
Expand All @@ -13,6 +13,6 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
<PackageReference Include="Buildalyzer.Workspaces" Version="4.1.4" />
<PackageReference Include="Buildalyzer.Workspaces" Version="4.1.6" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<UseMaui>true</UseMaui>
<Title>Experimental binding of Skia Sharp in Maui Blazor Bindings</Title>
<Description>Support for Skia Sharp for Maui Blazor Bindings.</Description>
Expand Down
Loading

0 comments on commit 3ae5d46

Please sign in to comment.