Skip to content

Commit 5ae9554

Browse files
authored
Merge pull request #12 from yurkinh/net10_migration
Migrate project to .NET 10 and refactor for improved structure
2 parents c20d2a2 + a1d7aa8 commit 5ae9554

24 files changed

+518
-471
lines changed

.github/workflows/code_cov.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/release-nuget.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,20 @@ jobs:
1111
runs-on: windows-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
15+
- name: Setup .NET 10
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: '10.0.x'
1519
- name: Verify commit exists in origin/main
1620
run: |
1721
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
1822
git branch --remote --contains | grep origin/main
19-
- name: Set VERSION variable from tag
20-
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
21-
- name: Install .NET MAUI
23+
- name: Install .NET MAUI workload
2224
run: dotnet workload install maui
23-
- name: Add msbuild to PATH
24-
uses: microsoft/setup-msbuild@v1.1
25-
- name: Get version information from tag
26-
id: get_version
27-
uses: battila7/get-version-action@v2
28-
- name: Pack
29-
run: msbuild -t:pack -r src/Plugin.Maui.SegmentedControl/Plugin.Maui.SegmentedControl.sln -property:Configuration=Release
30-
- name: Push
31-
run: dotnet nuget push src\Plugin.Maui.SegmentedControl\bin\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}
25+
- name: Restore dependencies
26+
run: dotnet restore src/Plugin.Maui.SegmentedControl/Plugin.Maui.SegmentedControl.csproj
27+
- name: Build and Pack
28+
run: dotnet pack src/Plugin.Maui.SegmentedControl/Plugin.Maui.SegmentedControl.csproj -c Release --no-restore
29+
- name: Push to NuGet
30+
run: dotnet nuget push src\Plugin.Maui.SegmentedControl\bin\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"dotrush.roslyn.projectOrSolutionFiles": [
3+
"src/Plugin.Maui.SegmentedControl/Plugin.Maui.SegmentedControl.slnx",
4+
"samples/SegmentedControlSamples/SegmentedControlSamples.slnx",
5+
"samples/Test.SegmentedControl/Test.SegmentedControl.slnx",
6+
"src/Plugin.Maui.SegmentedControl/Plugin.Maui.SegmentedControl.csproj",
7+
"samples/SegmentedControlSamples/SegmentedControlSamples.csproj",
8+
"samples/Test.SegmentedControl/Test.SegmentedControl.csproj"
9+
]
10+
}

samples/SegmentedControlSamples/App.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<?xml version = "1.0" encoding = "UTF-8" ?>
2-
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4-
xmlns:local="clr-namespace:SegmentedControlSamples"
5-
x:Class="SegmentedControlSamples.App">
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Application
3+
x:Class="SegmentedControlSamples.App"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:local="clr-namespace:SegmentedControlSamples">
67
<Application.Resources>
78
<ResourceDictionary>
89
<ResourceDictionary.MergedDictionaries>

samples/SegmentedControlSamples/MainPage.xaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22
<ContentPage
33
x:Class="SegmentedControlSamples.MainPage"
44
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5-
xmlns:local="clr-namespace:SegmentedControlSamples"
6-
x:DataType="local:MainPage"
75
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
8-
xmlns:controls="clr-namespace:Plugin.Maui.SegmentedControl;assembly=Plugin.Maui.SegmentedControl">
6+
xmlns:controls="clr-namespace:Plugin.Maui.SegmentedControl;assembly=Plugin.Maui.SegmentedControl"
7+
xmlns:local="clr-namespace:SegmentedControlSamples"
8+
x:DataType="local:MainPage">
99

10-
<Grid x:Name="segContainer"
11-
HorizontalOptions="Fill" >
10+
<Grid x:Name="segContainer" HorizontalOptions="Fill">
1211
<Grid.RowDefinitions>
1312
<RowDefinition Height="Auto" />
1413
<RowDefinition Height="*" />
1514
</Grid.RowDefinitions>
1615
<controls:SegmentedControl
17-
Grid.Row="0"
1816
x:Name="SegControl"
17+
Grid.Row="0"
1918
HorizontalOptions="Fill"
2019
SelectedTextColor="White"
2120
TextColor="Black"
2221
TintColor="Red"
2322
ValueChanged="Handle_ValueChanged">
2423
<controls:SegmentedControl.Children>
25-
<controls:SegmentedControlOption Text="Tab1"/>
26-
<controls:SegmentedControlOption Text="Tab2"/>
27-
<controls:SegmentedControlOption Text="Tab3"/>
28-
<controls:SegmentedControlOption Text="Attachments"/>
24+
<controls:SegmentedControlOption Text="Tab1" />
25+
<controls:SegmentedControlOption Text="Tab2" />
26+
<controls:SegmentedControlOption Text="Tab3" />
27+
<controls:SegmentedControlOption Text="Attachments" />
2928
</controls:SegmentedControl.Children>
3029
</controls:SegmentedControl>
31-
<ScrollView VerticalOptions="Start" x:Name="SegContent" Grid.Row="1" >
32-
</ScrollView>
30+
<ScrollView
31+
x:Name="SegContent"
32+
Grid.Row="1"
33+
VerticalOptions="Start" />
3334
</Grid>
3435

3536
</ContentPage>

samples/SegmentedControlSamples/Resources/Styles/Colors.xaml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<?xaml-comp compile="true" ?>
3-
<ResourceDictionary
4-
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5-
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
3+
<ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
64

75
<Color x:Key="Primary">#512BD4</Color>
86
<Color x:Key="Secondary">#DFD8F7</Color>
@@ -17,19 +15,19 @@
1715
<Color x:Key="Gray600">#404040</Color>
1816
<Color x:Key="Gray900">#212121</Color>
1917
<Color x:Key="Gray950">#141414</Color>
20-
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/>
21-
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/>
22-
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/>
23-
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/>
24-
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/>
25-
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}"/>
26-
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}"/>
27-
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}"/>
28-
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}"/>
29-
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}"/>
30-
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}"/>
31-
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}"/>
32-
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}"/>
18+
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}" />
19+
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}" />
20+
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}" />
21+
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}" />
22+
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}" />
23+
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}" />
24+
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}" />
25+
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}" />
26+
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}" />
27+
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}" />
28+
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}" />
29+
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}" />
30+
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}" />
3331

3432
<Color x:Key="Yellow100Accent">#F7B548</Color>
3533
<Color x:Key="Yellow200Accent">#FFD590</Color>

0 commit comments

Comments
 (0)