Skip to content

Commit

Permalink
Housekeeping Retire Xamarin (#788)
Browse files Browse the repository at this point in the history
* Housekeeping Retire Xamarin

* Update Samples

* Update UPI

* Use DotNet Build

* Add Runtime Identifier

* Update Sample RuntimeIdentifier

* Update SextantSample.Maui.csproj

* Update SextantSample.Maui.csproj

* Update solution

* Update build-samples.yml

* Revert to Sln as Slnx is not enabled in cloud build

* Update build-samples.yml
  • Loading branch information
ChrisPulman authored May 27, 2024
1 parent aaf46c4 commit 476a93f
Show file tree
Hide file tree
Showing 231 changed files with 1,195 additions and 5,044 deletions.
88 changes: 81 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,39 @@ root = true
insert_final_newline = true
indent_style = space
indent_size = 4
dotnet_diagnostic.CA1027.severity=error
dotnet_diagnostic.CA1062.severity=error
dotnet_diagnostic.CA1064.severity=error
dotnet_diagnostic.CA1066.severity=error
dotnet_diagnostic.CA1067.severity=error
dotnet_diagnostic.CA1068.severity=error
dotnet_diagnostic.CA1069.severity=warning
dotnet_diagnostic.CA2013.severity=error
dotnet_diagnostic.CA1802.severity=error
dotnet_diagnostic.CA1813.severity=error
dotnet_diagnostic.CA1814.severity=error
dotnet_diagnostic.CA1815.severity=error
dotnet_diagnostic.CA1822.severity=error
dotnet_diagnostic.CA1827.severity=error
dotnet_diagnostic.CA1828.severity=error
dotnet_diagnostic.CA1826.severity=error
dotnet_diagnostic.CA1829.severity=error
dotnet_diagnostic.CA1830.severity=error
dotnet_diagnostic.CA1831.severity=error
dotnet_diagnostic.CA1832.severity=error
dotnet_diagnostic.CA1833.severity=error
dotnet_diagnostic.CA1834.severity=error
dotnet_diagnostic.CA1835.severity=error
dotnet_diagnostic.CA1836.severity=error
dotnet_diagnostic.CA1837.severity=error
dotnet_diagnostic.CA1838.severity=error
dotnet_diagnostic.CA2015.severity=error
dotnet_diagnostic.CA2012.severity=error
dotnet_diagnostic.CA2011.severity=error
dotnet_diagnostic.CA2009.severity=error
dotnet_diagnostic.CA2008.severity=error
dotnet_diagnostic.CA2007.severity=warning
dotnet_diagnostic.CA2000.severity=suggestion

[project.json]
indent_size = 2
Expand Down Expand Up @@ -43,14 +76,11 @@ dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# only use var when it's obvious what the variable type is
csharp_style_var_for_built_in_types = false:none
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Types: use keywords instead of BCL types, and permit var only when the type is clear
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion
# prefer C# premade types.
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

Expand Down Expand Up @@ -370,7 +400,7 @@ dotnet_diagnostic.SA1501.severity = error
dotnet_diagnostic.SA1502.severity = error
dotnet_diagnostic.SA1503.severity = error
dotnet_diagnostic.SA1504.severity = error
dotnet_diagnostic.SA1505.severity = error
dotnet_diagnostic.SA1505.severity = none
dotnet_diagnostic.SA1506.severity = error
dotnet_diagnostic.SA1507.severity = error
dotnet_diagnostic.SA1508.severity = error
Expand All @@ -379,7 +409,7 @@ dotnet_diagnostic.SA1510.severity = error
dotnet_diagnostic.SA1511.severity = error
dotnet_diagnostic.SA1512.severity = error
dotnet_diagnostic.SA1513.severity = error
dotnet_diagnostic.SA1514.severity = error
dotnet_diagnostic.SA1514.severity = none
dotnet_diagnostic.SA1515.severity = error
dotnet_diagnostic.SA1516.severity = error
dotnet_diagnostic.SA1517.severity = error
Expand Down Expand Up @@ -429,6 +459,48 @@ dotnet_diagnostic.SA1651.severity = error
dotnet_diagnostic.SX1101.severity = error
dotnet_diagnostic.SX1309.severity = error
dotnet_diagnostic.SX1623.severity = none
dotnet_diagnostic.RCS1102.severity=error
dotnet_diagnostic.RCS1166.severity=error
dotnet_diagnostic.RCS1078i.severity=error
dotnet_diagnostic.RCS1248.severity=error
dotnet_diagnostic.RCS1080.severity=error
dotnet_diagnostic.RCS1077.severity=error
dotnet_diagnostic.CA1825.severity=error
dotnet_diagnostic.CA1812.severity=error
dotnet_diagnostic.CA1805.severity=error
dotnet_diagnostic.RCS1197.severity=error
dotnet_diagnostic.RCS1198.severity=none
dotnet_diagnostic.RCS1231.severity=suggestion
dotnet_diagnostic.RCS1235.severity=error
dotnet_diagnostic.RCS1242.severity=error
dotnet_diagnostic.RCS1256.severity=none
dotnet_diagnostic.CA2016.severity=warning
dotnet_diagnostic.CA2014.severity=error
dotnet_diagnostic.RCS1010.severity=error
dotnet_diagnostic.RCS1006.severity=error
dotnet_diagnostic.RCS1005.severity=error
dotnet_diagnostic.RCS1020.severity=error
dotnet_diagnostic.RCS1049.severity=warning
dotnet_diagnostic.RCS1058.severity=warning
dotnet_diagnostic.RCS1068.severity=warning
dotnet_diagnostic.RCS1073.severity=warning
dotnet_diagnostic.RCS1084.severity=error
dotnet_diagnostic.RCS1085.severity=error
dotnet_diagnostic.RCS1105.severity=error
dotnet_diagnostic.RCS1112.severity=error
dotnet_diagnostic.RCS1128.severity=error
dotnet_diagnostic.RCS1143.severity=error
dotnet_diagnostic.RCS1158.severity=none
dotnet_diagnostic.RCS1163.severity=none
dotnet_diagnostic.RCS1171.severity=error
dotnet_diagnostic.RCS1173.severity=error
dotnet_diagnostic.RCS1176.severity=error
dotnet_diagnostic.RCS1177.severity=error
dotnet_diagnostic.RCS1179.severity=error
dotnet_diagnostic.RCS1180.severity=warning
dotnet_diagnostic.RCS1190.severity=error
dotnet_diagnostic.RCS1195.severity=error
dotnet_diagnostic.RCS1214.severity=error

# C++ Files
[*.{cpp,h,in}]
Expand Down Expand Up @@ -456,3 +528,5 @@ indent_size = 2
end_of_line = lf
[*.{cmd, bat}]
end_of_line = crlf

vsspell_dictionary_languages = en-US
1 change: 1 addition & 0 deletions .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ jobs:
uses: reactiveui/actions-common/.github/workflows/workflow-common-setup-and-build.yml@main
with:
productNamespacePrefix: "Sextant"
dotNetBuild: true
srcFolder: "src/Sample"
solutionFile: "SextantSample.sln"
1 change: 1 addition & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ jobs:
uses: reactiveui/actions-common/.github/workflows/workflow-common-setup-and-build.yml@main
with:
productNamespacePrefix: "Sextant"
dotNetBuild: true
solutionFile: "Sextant.sln"
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main
with:
productNamespacePrefix: "Sextant"
dotNetBuild: true
solutionFile: "Sextant.sln"
secrets:
SIGN_CLIENT_USER_ID: ${{ secrets.SIGN_CLIENT_USER_ID }}
Expand Down
3 changes: 3 additions & 0 deletions Archive/SextantSample.Android.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions Archive/SextantSample.UWP.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions Archive/SextantSample.WPF.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions Archive/SextantSample.iOS.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions Archive/SextantSample.zip
Git LFS file not shown
14 changes: 14 additions & 0 deletions Samples/SextantSample.Maui/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SextantSample.Maui"
x:Class="SextantSample.Maui.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
19 changes: 19 additions & 0 deletions Samples/SextantSample.Maui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace SextantSample.Maui
{
public partial class App : Application
{
public App()
{
InitializeComponent();

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

MainPage = Locator.Current.GetNavigationView();
}
}
}
15 changes: 15 additions & 0 deletions Samples/SextantSample.Maui/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="SextantSample.Maui.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SextantSample.Maui"
Shell.FlyoutBehavior="Disabled"
Title="SextantSample.Maui">

<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

</Shell>
10 changes: 10 additions & 0 deletions Samples/SextantSample.Maui/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace SextantSample.Maui
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
}
File renamed without changes.
36 changes: 36 additions & 0 deletions Samples/SextantSample.Maui/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SextantSample.Maui.MainPage">

<ScrollView>
<VerticalStackLayout
Padding="30,0"
Spacing="25">
<Image
Source="dotnet_bot.png"
HeightRequest="185"
Aspect="AspectFit"
SemanticProperties.Description="dot net bot in a race car number eight" />

<Label
Text="Hello, World!"
Style="{StaticResource Headline}"
SemanticProperties.HeadingLevel="Level1" />

<Label
Text="Welcome to &#10;.NET Multi-platform App UI"
Style="{StaticResource SubHeadline}"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I" />

<Button
x:Name="CounterBtn"
Text="Click me"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Fill" />
</VerticalStackLayout>
</ScrollView>

</ContentPage>
25 changes: 25 additions & 0 deletions Samples/SextantSample.Maui/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace SextantSample.Maui
{
public partial class MainPage : ContentPage
{
int count;

public MainPage()
{
InitializeComponent();
}

private void OnCounterClicked(object sender, EventArgs e)
{
count++;

if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";

SemanticScreenReader.Announce(CounterBtn.Text);
}
}

}
38 changes: 38 additions & 0 deletions Samples/SextantSample.Maui/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Microsoft.Extensions.Logging;

namespace SextantSample.Maui
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
RxApp.DefaultExceptionHandler = new SextantDefaultExceptionHandler();
var resolver = Locator.CurrentMutable;
resolver.InitializeSplat();
resolver.InitializeReactiveUI();
////Instance.InitializeMaui();
Locator
.CurrentMutable
.RegisterViewForNavigation<HomeView, HomeViewModel>()
.RegisterViewForNavigation<FirstModalView, FirstModalViewModel>(() => new(), () => new(Locator.Current.GetService<IViewStackService>()))
.RegisterViewForNavigation<SecondModalView, SecondModalViewModel>(() => new(), () => new(Locator.Current.GetService<IViewStackService>()))
.RegisterViewForNavigation<RedView, RedViewModel>(() => new(), () => new(Locator.Current.GetService<IViewStackService>()))
.RegisterViewForNavigation<GreenView, GreenViewModel>(() => new(), () => new(Locator.Current.GetService<IViewStackService>()))
.RegisterNavigationView(() => new BlueNavigationView());

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
}
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:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
11 changes: 11 additions & 0 deletions Samples/SextantSample.Maui/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

namespace SextantSample.Maui
{
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
}
16 changes: 16 additions & 0 deletions Samples/SextantSample.Maui/Platforms/Android/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Android.App;
using Android.Runtime;

namespace SextantSample.Maui
{
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
10 changes: 10 additions & 0 deletions Samples/SextantSample.Maui/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Foundation;

namespace SextantSample.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
Loading

0 comments on commit 476a93f

Please sign in to comment.