Skip to content

Commit

Permalink
.NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
dhindrik committed Nov 25, 2024
1 parent 5c64b87 commit 3abdcf8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 28 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: CI

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]


branches: [main]

jobs:
# This workflow contains a single job called "build"
Expand All @@ -21,15 +19,14 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: "8.0.x"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-version: "9.0.x"

- name: Install maui
run: dotnet workload install maui


- name: Run the Cake script
uses: cake-build/cake-action@v1
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ jobs:
# The type of runner that the job will run on
runs-on: macos-latest


# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: "8.0.x"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-version: "9.0.x"

- name: Install maui
run: dotnet workload install maui

Expand Down
5 changes: 3 additions & 2 deletions src/TinyMvvm.Maui.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 25.0.1703.0
# Visual Studio Version 17
VisualStudioVersion = 17.12.35514.174 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMvvm.Maui", "TinyMvvm.Maui\TinyMvvm.Maui.csproj", "{1E75EB2D-80A6-42E1-A581-DEA1BA7A7A8A}"
EndProject
Expand All @@ -19,6 +19,7 @@ Global
{1E75EB2D-80A6-42E1-A581-DEA1BA7A7A8A}.Release|Any CPU.Build.0 = Release|Any CPU
{A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
2 changes: 1 addition & 1 deletion src/TinyMvvm.Maui/TinyMvvm.Maui.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseMaui>true</UseMaui>
Expand Down
8 changes: 3 additions & 5 deletions src/TinyMvvm.Sample/Services/CityService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json;
using TinyMvvm.Sample.Models;

namespace TinyMvvm.Sample.Services;
Expand Down Expand Up @@ -28,7 +26,7 @@ public async Task<City> Get(string city)

var cities = await Load();

var result = cities.Single(x => x.Name == lowerText);
var result = cities.Single(x => x.Name.ToLower() == lowerText);

return result;
}
Expand All @@ -40,7 +38,7 @@ public Task<List<City>> GetAll()

private async Task<List<City>> Load()
{
if(cities != null)
if (cities != null)
{
return cities;
}
Expand Down
6 changes: 3 additions & 3 deletions src/TinyMvvm.Sample/TinyMvvm.Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.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> -->
<OutputType>Exe</OutputType>
Expand Down Expand Up @@ -36,7 +36,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LangVersion>latestmajor</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
Expand Down
7 changes: 3 additions & 4 deletions src/TinyMvvm.Sample/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using TinyMvvm.Sample.Models;
using TinyMvvm.Sample.Services;

Expand Down Expand Up @@ -47,7 +46,7 @@ public MainViewModel(ICityService cityService)
private ICommand show;
public ICommand Show => show ??= new RelayCommand<City>(async (city) =>
{
await Navigation.NavigateTo($"{nameof(DetailsViewModel)}", city.Name);
await Navigation.NavigateTo($"{nameof(DetailsViewModel)}", city);
});

[ObservableProperty]
Expand Down

0 comments on commit 3abdcf8

Please sign in to comment.