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

Feature: Add MAUI support #691

Merged
merged 46 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4fc0b56
Add Sextant Maui Project
OmnipotentOwl Sep 26, 2021
d6d6566
Update github pipelines for supporting net6 maui
OmnipotentOwl Sep 26, 2021
a2063fc
Fix maui project type to match design from reactiveui.maui
OmnipotentOwl Sep 26, 2021
82f1c09
Update main Sextant library to support net6 maui
OmnipotentOwl Sep 26, 2021
f7bcddf
Merge branch 'reactiveui:main' into feature/maui
OmnipotentOwl Dec 16, 2021
ab6e136
Update samples for sextant to use newer nuget versions
OmnipotentOwl Dec 16, 2021
7aa9161
set sextant target framework for macos to maccatalyst
OmnipotentOwl Dec 16, 2021
6e94389
fix directory build props for code analysis to use build in dotnet 6 …
OmnipotentOwl Dec 16, 2021
d0dcc0e
Cleanup usings into global usings for nuget package.
OmnipotentOwl Dec 16, 2021
3bfc23c
bump ReactiveUI.XamForms
OmnipotentOwl Dec 16, 2021
e3c36f3
resolve merge conflicts from upstream
OmnipotentOwl Dec 16, 2021
18b5ba9
bump reactive ui version
OmnipotentOwl Mar 26, 2022
9c67f27
handle updates from upstream maui repo
OmnipotentOwl Mar 26, 2022
a7248f2
Add Sextant Maui Project
OmnipotentOwl Sep 26, 2021
48ced64
Update github pipelines for supporting net6 maui
OmnipotentOwl Sep 26, 2021
94bc7d8
Fix maui project type to match design from reactiveui.maui
OmnipotentOwl Sep 26, 2021
ca035e1
Update main Sextant library to support net6 maui
OmnipotentOwl Sep 26, 2021
6865184
Update samples for sextant to use newer nuget versions
OmnipotentOwl Dec 16, 2021
7e198f1
set sextant target framework for macos to maccatalyst
OmnipotentOwl Dec 16, 2021
a8498b0
Cleanup usings into global usings for nuget package.
OmnipotentOwl Dec 16, 2021
3aae13d
bump reactive ui version
OmnipotentOwl Mar 26, 2022
1f07897
handle updates from upstream maui repo
OmnipotentOwl Mar 26, 2022
b3a2f6a
Merge branch 'feature/maui' of https://github.com/OmnipotentOwl/Sexta…
OmnipotentOwl Mar 26, 2022
e7dff43
add updates from maui templates
OmnipotentOwl Nov 7, 2022
fd52f2c
migrate sample to use globalusings
OmnipotentOwl Nov 7, 2022
643ff67
update Sextant to use 18.x ReactiveUI packages
OmnipotentOwl Nov 7, 2022
6b1d641
Merge branch 'main' into feature/maui
OmnipotentOwl Dec 23, 2022
302414f
Update library to net8.0 support and deprecate uap support based on u…
OmnipotentOwl Dec 8, 2023
15fc7f7
chore: Add Release workflow mirroring ReactiveUI design model.
OmnipotentOwl Dec 8, 2023
da944ed
chore: Update Sextant CI workflow to follow patterns and practices fr…
OmnipotentOwl Dec 8, 2023
df54425
fix: Update XamForms project and tests to match ReactiveUI setup.
OmnipotentOwl Dec 8, 2023
77ef4ed
chore: Update Sextant.Mocks project to supported frameworks.
OmnipotentOwl Dec 8, 2023
ad1fa8c
Disable useMauiCheckDotNetTool in ci-build.yml
OmnipotentOwl Dec 8, 2023
eda19fd
chore: Update build samples workflow (#1)
OmnipotentOwl Dec 8, 2023
630279d
Merge branch 'main' into feature/maui
glennawatson Dec 8, 2023
d44539e
chore: Add missing sample assets from standard project setup
OmnipotentOwl Dec 9, 2023
ce81595
chore: Remove deprecated Tests for Sextant.Plugins.Popup project.
OmnipotentOwl Dec 9, 2023
04ce3bf
fix: Add PackageReference for Maui net8.0 controls using buildvar
OmnipotentOwl Dec 9, 2023
d839c74
chore: Remove Sextant.Plugins.Popup.Tests project from solution file
OmnipotentOwl Dec 9, 2023
8b0ded4
chore: Add Conditional Obsolete to ViewModelFactoryNotFoundException …
OmnipotentOwl Dec 9, 2023
99414ca
fix: Remove netcore3.1 framework from Sextant.Tests
OmnipotentOwl Dec 9, 2023
092ce02
chore: Add outputs from ApiApprovalTests runs for test projects
OmnipotentOwl Dec 9, 2023
f72b776
Update API Checks, Update majority of packages
ChrisPulman Dec 9, 2023
8d8ffc5
chore: Fix samples after updates from cherry-pick
OmnipotentOwl Dec 9, 2023
27c2ab8
chore: Update Xamarin Forms Android sample to v12 framework version.
OmnipotentOwl Dec 9, 2023
67f8463
chore: Fix Xamarin Forms Android Build issues with v13 requirements f…
OmnipotentOwl Dec 9, 2023
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
44 changes: 35 additions & 9 deletions .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,58 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build-samples:
strategy:
matrix:
configuration: [Debug, Release]

runs-on: windows-latest
runs-on: windows-2022

steps:
- name: Install Windows SDK 10.0.16299
shell: pwsh
run: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/p/?linkid=864422 -OutFile winsdk.exe
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "winsdk.exe"
$startInfo.Arguments = "/norestart /quiet"
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start()
$process.WaitForExit()

- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'microsoft'
java-version: '11'

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

# Install the .NET Core workload
- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v1
# Install the .NET workload
- name: Setup .NET 6/7/8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: |
6.0.x
7.0.x
8.0.x

- name: Install .NET 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Install DotNet workloads
shell: bash
run: |
dotnet workload install android
dotnet workload install ios
dotnet workload install tvos
dotnet workload install macos
dotnet workload install maui

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
Expand Down
134 changes: 13 additions & 121 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,130 +4,22 @@ on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]

env:
configuration: Release
productNamespacePrefix: "Sextant"

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
outputs:
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Install .NET 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Add MSBuild to PATH
uses: glennawatson/[email protected]

# - name: Update VS2019
# shell: powershell
# run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"""

- name: NBGV
id: nbgv
uses: dotnet/nbgv@master
with:
setAllVars: true

- name: NuGet Restore
run: dotnet restore
working-directory: src

- name: Build
run: msbuild /t:build,pack /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }}
working-directory: src

- name: Run Unit Tests and Generate Coverage
uses: glennawatson/coverlet-msbuild@v1
with:
project-files: '**/*Tests*.csproj'
no-build: true
exclude-filter: '[${{env.productNamespacePrefix}}.*.Tests.*]*'
include-filter: '[${{env.productNamespacePrefix}}*]*'
output-format: cobertura
output: '../../artifacts/'
configuration: ${{ env.configuration }}

- name: Upload Code Coverage
shell: bash
run: |
echo $PWD
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -t ${{ env.CODECOV_TOKEN }} -s '$PWD/artifacts' -f '*.xml'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Create NuGet Artifacts
uses: actions/upload-artifact@master
with:
name: nuget
path: '**/*.nupkg'

release:
runs-on: ubuntu-latest
needs: build
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download NuGet Packages
uses: actions/download-artifact@v2
with:
name: nuget

- name: Save SignClient Configuration
run: 'echo "$SIGN_CLIENT_CONFIG" > SignPackages.json'
shell: bash
env:
SIGN_CLIENT_CONFIG: ${{secrets.SIGN_CLIENT_CONFIG}}

- name: Sign NuGet Packages
uses: glennawatson/signclient@v1
with:
input-files: '**/*.nupkg'
sign-client-secret: ${{ secrets.SIGN_CLIENT_SECRET }}
sign-client-user: ${{ secrets.SIGN_CLIENT_USER_ID }}
project-name: reactiveui
description: reactiveui
config-file: SignPackages.json

- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ needs.build.outputs.nbgv }}
release_name: ${{ needs.build.outputs.nbgv }}
body: |
${{ steps.changelog.outputs.commitLog }}

- name: NuGet Push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg

permissions:
contents: none
uses: reactiveui/actions-common/.github/workflows/workflow-common-setup-and-build.yml@main
with:
configuration: Release
productNamespacePrefix: "Sextant"
useVisualStudioPreview: false
useMauiCheckDotNetTool: false
solutionFile: "Sextant.sln"
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
branches:
- main
- patches/*

env:
productNamespacePrefix: "Sextant"

jobs:
release:
uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main
with:
configuration: Release
productNamespacePrefix: "Sextant"
useVisualStudioPreview: true
useMauiCheckDotNetTool: false
solutionFile: "Sextant.sln"
secrets:
SIGN_CLIENT_USER_ID: ${{ secrets.SIGN_CLIENT_USER_ID }}
SIGN_CLIENT_SECRET: ${{ secrets.SIGN_CLIENT_SECRET }}
SIGN_CLIENT_CONFIG: ${{ secrets.SIGN_CLIENT_CONFIG }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
4 changes: 2 additions & 2 deletions Sample/SextantSample.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.giusepe.SextantSample" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="33" />
<application android:label="SextantSample.Android"></application>
</manifest>
</manifest>
4 changes: 2 additions & 2 deletions Sample/SextantSample.Android/Resources/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="MainTheme.Base" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#2196F3</item>
Expand All @@ -20,7 +20,7 @@
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
</style>

<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<style name="AppCompatDialogStyle" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="colorAccent">#FF4081</item>
</style>
</resources>
33 changes: 32 additions & 1 deletion Sample/SextantSample.Android/SextantSample.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -58,6 +58,36 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidSupportedAbis>armeabi-v7a</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;LOGGING</DefineConstants>
<DebugType>portable</DebugType>
<PlatformTarget>x64</PlatformTarget>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Release\</OutputPath>
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
<PlatformTarget>x64</PlatformTarget>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Sample Release|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Sample Release\</OutputPath>
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
<PlatformTarget>x64</PlatformTarget>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
Expand All @@ -66,6 +96,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI.XamForms" Version="19.*" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion Sample/SextantSample.Core/SextantSample.ViewModels.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 11 additions & 0 deletions Sample/SextantSample.Maui/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls"
xmlns:local="clr-namespace:SextantSample.Maui"
x:Class="SextantSample.Maui.App"
windows:Application.ImageDirectory="Assets">
<Application.Resources>
<ResourceDictionary>
</ResourceDictionary>
</Application.Resources>
</Application>
20 changes: 20 additions & 0 deletions Sample/SextantSample.Maui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

namespace SextantSample.Maui
{
public partial class App : Application
{
public App()
{
InitializeComponent();

Locator
.Current
.GetService<IViewStackService>()
.PushPage(new HomeViewModel(), null, true, false)
.Subscribe();

MainPage = Locator.Current.GetNavigationView();
}
}
}
17 changes: 17 additions & 0 deletions Sample/SextantSample.Maui/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
global using Microsoft.Maui;
global using Microsoft.Maui.Controls;
global using Microsoft.Maui.Controls.Hosting;
global using Microsoft.Maui.Hosting;
global using Microsoft.Maui.LifecycleEvents;
global using System;
global using System.Diagnostics;
global using System.Threading.Tasks;
global using Microsoft.Extensions.Logging;
global using ReactiveUI;
global using ReactiveUI.Maui;
global using Sextant;
global using Sextant.Maui;
global using SextantSample.Maui.Views;
global using SextantSample.ViewModels;
global using Splat;
global using Application = Microsoft.Maui.Controls.Application;
Loading
Loading