From 9e42020292698977014b09f7f73be2ba1cce0470 Mon Sep 17 00:00:00 2001 From: Wesley Ford Date: Thu, 20 Jun 2024 18:05:29 -0400 Subject: [PATCH] chore: convert all class libs to Maui class lib 1. Updated class libraries to Maui libraries. 2. Made xUnit projects Maui compatible (Source: https://github.com/xunit/xunit/discussions/2732#discussioncomment-6238237) - (Recommended by the dotnet compiler) 3. Updated all Maui `.csproj(s)` to only build for windows (this is temporary) --- .github/workflows/dotnet-build.yml | 2 -- .../Katharos.Models.Tests.csproj | 3 +- src/1-Models/Katharos.Models/Class1.cs | 2 +- .../Katharos.Models/Katharos.Models.csproj | 29 +++++++++++++++---- .../Platforms/Android/PlatformClass1.cs | 6 ++++ .../Platforms/MacCatalyst/PlatformClass1.cs | 6 ++++ .../Platforms/Tizen/PlatformClass1.cs | 9 ++++++ .../Platforms/Windows/PlatformClass1.cs | 6 ++++ .../Platforms/iOS/PlatformClass1.cs | 6 ++++ src/1-Models/Katharos.Models/User.cs | 11 ------- .../Katharos.Services.Test.csproj | 3 +- .../Katharos.Services/AccountService.cs | 11 ------- src/2-Services/Katharos.Services/Class1.cs | 6 ++++ .../Interfaces/IAccountService.cs | 9 ------ .../Katharos.Services.csproj | 29 +++++++++++++++---- .../Platforms/Android/PlatformClass1.cs | 6 ++++ .../Platforms/MacCatalyst/PlatformClass1.cs | 6 ++++ .../Platforms/Tizen/PlatformClass1.cs | 9 ++++++ .../Platforms/Windows/PlatformClass1.cs | 6 ++++ .../Platforms/iOS/PlatformClass1.cs | 6 ++++ src/3-App/Katharos.App/Katharos.App.csproj | 8 ++--- 21 files changed, 127 insertions(+), 52 deletions(-) create mode 100644 src/1-Models/Katharos.Models/Platforms/Android/PlatformClass1.cs create mode 100644 src/1-Models/Katharos.Models/Platforms/MacCatalyst/PlatformClass1.cs create mode 100644 src/1-Models/Katharos.Models/Platforms/Tizen/PlatformClass1.cs create mode 100644 src/1-Models/Katharos.Models/Platforms/Windows/PlatformClass1.cs create mode 100644 src/1-Models/Katharos.Models/Platforms/iOS/PlatformClass1.cs delete mode 100644 src/1-Models/Katharos.Models/User.cs delete mode 100644 src/2-Services/Katharos.Services/AccountService.cs create mode 100644 src/2-Services/Katharos.Services/Class1.cs delete mode 100644 src/2-Services/Katharos.Services/Interfaces/IAccountService.cs create mode 100644 src/2-Services/Katharos.Services/Platforms/Android/PlatformClass1.cs create mode 100644 src/2-Services/Katharos.Services/Platforms/MacCatalyst/PlatformClass1.cs create mode 100644 src/2-Services/Katharos.Services/Platforms/Tizen/PlatformClass1.cs create mode 100644 src/2-Services/Katharos.Services/Platforms/Windows/PlatformClass1.cs create mode 100644 src/2-Services/Katharos.Services/Platforms/iOS/PlatformClass1.cs diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index d8c30b2..6ff3b0b 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -24,8 +24,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ env.DOTNET_CORE_VERSION }} - - name: Install Maui - run: dotnet workload install maui - name: Restore dependencies run: dotnet restore "${{ env.WORKING_DIRECTORY }}" - name: Build diff --git a/src/1-Models/Katharos.Models.Tests/Katharos.Models.Tests.csproj b/src/1-Models/Katharos.Models.Tests/Katharos.Models.Tests.csproj index 9c5b30a..cd9a696 100644 --- a/src/1-Models/Katharos.Models.Tests/Katharos.Models.Tests.csproj +++ b/src/1-Models/Katharos.Models.Tests/Katharos.Models.Tests.csproj @@ -4,12 +4,13 @@ net8.0 enable enable - + true false true + diff --git a/src/1-Models/Katharos.Models/Class1.cs b/src/1-Models/Katharos.Models/Class1.cs index b3aa0cf..278d591 100644 --- a/src/1-Models/Katharos.Models/Class1.cs +++ b/src/1-Models/Katharos.Models/Class1.cs @@ -1,6 +1,6 @@ namespace Katharos.Models; +// All the code in this file is included in all platforms. public class Class1 { - } diff --git a/src/1-Models/Katharos.Models/Katharos.Models.csproj b/src/1-Models/Katharos.Models/Katharos.Models.csproj index fa71b7a..b94887b 100644 --- a/src/1-Models/Katharos.Models/Katharos.Models.csproj +++ b/src/1-Models/Katharos.Models/Katharos.Models.csproj @@ -1,9 +1,26 @@ - + - - net8.0 - enable - enable - + + + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + + true + true + enable + enable + + + 10.0.17763.0 + 10.0.17763.0 + + + + + + + diff --git a/src/1-Models/Katharos.Models/Platforms/Android/PlatformClass1.cs b/src/1-Models/Katharos.Models/Platforms/Android/PlatformClass1.cs new file mode 100644 index 0000000..9d6a56b --- /dev/null +++ b/src/1-Models/Katharos.Models/Platforms/Android/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Models; + +// All the code in this file is only included on Android. +public class PlatformClass1 +{ +} diff --git a/src/1-Models/Katharos.Models/Platforms/MacCatalyst/PlatformClass1.cs b/src/1-Models/Katharos.Models/Platforms/MacCatalyst/PlatformClass1.cs new file mode 100644 index 0000000..74824dc --- /dev/null +++ b/src/1-Models/Katharos.Models/Platforms/MacCatalyst/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Models; + +// All the code in this file is only included on Mac Catalyst. +public class PlatformClass1 +{ +} diff --git a/src/1-Models/Katharos.Models/Platforms/Tizen/PlatformClass1.cs b/src/1-Models/Katharos.Models/Platforms/Tizen/PlatformClass1.cs new file mode 100644 index 0000000..99d142f --- /dev/null +++ b/src/1-Models/Katharos.Models/Platforms/Tizen/PlatformClass1.cs @@ -0,0 +1,9 @@ +using System; + +namespace Katharos.Models +{ + // All the code in this file is only included on Tizen. + public class PlatformClass1 + { + } +} \ No newline at end of file diff --git a/src/1-Models/Katharos.Models/Platforms/Windows/PlatformClass1.cs b/src/1-Models/Katharos.Models/Platforms/Windows/PlatformClass1.cs new file mode 100644 index 0000000..fde670f --- /dev/null +++ b/src/1-Models/Katharos.Models/Platforms/Windows/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Models; + +// All the code in this file is only included on Windows. +public class PlatformClass1 +{ +} diff --git a/src/1-Models/Katharos.Models/Platforms/iOS/PlatformClass1.cs b/src/1-Models/Katharos.Models/Platforms/iOS/PlatformClass1.cs new file mode 100644 index 0000000..6900271 --- /dev/null +++ b/src/1-Models/Katharos.Models/Platforms/iOS/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Models; + +// All the code in this file is only included on iOS. +public class PlatformClass1 +{ +} diff --git a/src/1-Models/Katharos.Models/User.cs b/src/1-Models/Katharos.Models/User.cs deleted file mode 100644 index c5275e2..0000000 --- a/src/1-Models/Katharos.Models/User.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Katharos.Models -{ - public class User - { - #region Properties - - - - #endregion - } -} diff --git a/src/2-Services/Katharos.Services.Test/Katharos.Services.Test.csproj b/src/2-Services/Katharos.Services.Test/Katharos.Services.Test.csproj index 9c5b30a..cd9a696 100644 --- a/src/2-Services/Katharos.Services.Test/Katharos.Services.Test.csproj +++ b/src/2-Services/Katharos.Services.Test/Katharos.Services.Test.csproj @@ -4,12 +4,13 @@ net8.0 enable enable - + true false true + diff --git a/src/2-Services/Katharos.Services/AccountService.cs b/src/2-Services/Katharos.Services/AccountService.cs deleted file mode 100644 index a83eb4c..0000000 --- a/src/2-Services/Katharos.Services/AccountService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Katharos.Services.Interfaces; - -namespace Katharos.Services -{ - public class AccountService : IAccountService - { - public void Add() {} - public void Remove() {} - public void Update() {} - } -} diff --git a/src/2-Services/Katharos.Services/Class1.cs b/src/2-Services/Katharos.Services/Class1.cs new file mode 100644 index 0000000..dfa3322 --- /dev/null +++ b/src/2-Services/Katharos.Services/Class1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Services; + +// All the code in this file is included in all platforms. +public class Class1 +{ +} diff --git a/src/2-Services/Katharos.Services/Interfaces/IAccountService.cs b/src/2-Services/Katharos.Services/Interfaces/IAccountService.cs deleted file mode 100644 index c1e1d65..0000000 --- a/src/2-Services/Katharos.Services/Interfaces/IAccountService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Katharos.Services.Interfaces -{ - public interface IAccountService - { - void Add(); - void Remove(); - void Update(); - } -} diff --git a/src/2-Services/Katharos.Services/Katharos.Services.csproj b/src/2-Services/Katharos.Services/Katharos.Services.csproj index fa71b7a..e26887a 100644 --- a/src/2-Services/Katharos.Services/Katharos.Services.csproj +++ b/src/2-Services/Katharos.Services/Katharos.Services.csproj @@ -1,9 +1,26 @@ - + - - net8.0 - enable - enable - + + + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + + true + true + enable + enable + + + 10.0.17763.0 + 10.0.17763.0 + + + + + + + diff --git a/src/2-Services/Katharos.Services/Platforms/Android/PlatformClass1.cs b/src/2-Services/Katharos.Services/Platforms/Android/PlatformClass1.cs new file mode 100644 index 0000000..7e13283 --- /dev/null +++ b/src/2-Services/Katharos.Services/Platforms/Android/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Services; + +// All the code in this file is only included on Android. +public class PlatformClass1 +{ +} diff --git a/src/2-Services/Katharos.Services/Platforms/MacCatalyst/PlatformClass1.cs b/src/2-Services/Katharos.Services/Platforms/MacCatalyst/PlatformClass1.cs new file mode 100644 index 0000000..d6c8ed8 --- /dev/null +++ b/src/2-Services/Katharos.Services/Platforms/MacCatalyst/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Services; + +// All the code in this file is only included on Mac Catalyst. +public class PlatformClass1 +{ +} diff --git a/src/2-Services/Katharos.Services/Platforms/Tizen/PlatformClass1.cs b/src/2-Services/Katharos.Services/Platforms/Tizen/PlatformClass1.cs new file mode 100644 index 0000000..24cc4c7 --- /dev/null +++ b/src/2-Services/Katharos.Services/Platforms/Tizen/PlatformClass1.cs @@ -0,0 +1,9 @@ +using System; + +namespace Katharos.Services +{ + // All the code in this file is only included on Tizen. + public class PlatformClass1 + { + } +} \ No newline at end of file diff --git a/src/2-Services/Katharos.Services/Platforms/Windows/PlatformClass1.cs b/src/2-Services/Katharos.Services/Platforms/Windows/PlatformClass1.cs new file mode 100644 index 0000000..2f22253 --- /dev/null +++ b/src/2-Services/Katharos.Services/Platforms/Windows/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Services; + +// All the code in this file is only included on Windows. +public class PlatformClass1 +{ +} diff --git a/src/2-Services/Katharos.Services/Platforms/iOS/PlatformClass1.cs b/src/2-Services/Katharos.Services/Platforms/iOS/PlatformClass1.cs new file mode 100644 index 0000000..ca6823e --- /dev/null +++ b/src/2-Services/Katharos.Services/Platforms/iOS/PlatformClass1.cs @@ -0,0 +1,6 @@ +namespace Katharos.Services; + +// All the code in this file is only included on iOS. +public class PlatformClass1 +{ +} diff --git a/src/3-App/Katharos.App/Katharos.App.csproj b/src/3-App/Katharos.App/Katharos.App.csproj index eb1673d..2f1741a 100644 --- a/src/3-App/Katharos.App/Katharos.App.csproj +++ b/src/3-App/Katharos.App/Katharos.App.csproj @@ -1,7 +1,7 @@  - net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 @@ -31,12 +31,12 @@ 1.0 1 - 14.2 + 10.0.17763.0 10.0.17763.0 - 6.5 +