From 36415203b8c4b452fc38065143feb0ed7b543fa4 Mon Sep 17 00:00:00 2001 From: Parham Saremi Date: Sun, 15 Jan 2023 07:36:10 +0330 Subject: [PATCH 01/39] Add Maui base project Used the template in [1] for Maui. Install JDK 11 to fix error "Java SDK 11.0 or above is required when using .NET 6 or higher" when building MAUI Android frontend [2]. Disable checking of out-of-support workloads in Frontend.Maui.fsproj so that project can be built because it still uses .NET6 workloads. [1] https://github.com/fabulous-dev/FSharp.Mobile.Templates/tree/stable-net6.0/templates/Maui [2] https://stackoverflow.com/a/77519085/544947 --- .github/workflows/CI.yml | 11 +- global.json | 6 + gwallet.maui.sln | 33 + src/GWallet.Frontend.Maui/App.xaml | 14 + src/GWallet.Frontend.Maui/App.xaml.fs | 10 + src/GWallet.Frontend.Maui/AppShell.xaml | 14 + src/GWallet.Frontend.Maui/AppShell.xaml.fs | 9 + .../GWallet.Frontend.Maui.fsproj | 131 + src/GWallet.Frontend.Maui/MainPage.xaml | 67 + src/GWallet.Frontend.Maui/MainPage.xaml.fs | 11 + src/GWallet.Frontend.Maui/MauiProgram.fs | 17 + .../Platforms/Android/AndroidManifest.xml | 6 + .../Platforms/Android/MainActivity.fs | 13 + .../Platforms/Android/MainApplication.fs | 12 + .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.fs | 10 + .../Platforms/MacCatalyst/Info.plist | 30 + .../Platforms/MacCatalyst/Program.fs | 9 + .../Platforms/Tizen/Main.fs | 16 + .../Platforms/Tizen/tizen-manifest.xml | 15 + .../Platforms/Windows/App.xaml | 8 + .../Platforms/Windows/App.xaml.fs | 18 + .../Platforms/Windows/Package.appxmanifest | 43 + .../Platforms/Windows/app.manifest | 15 + .../Platforms/iOS/AppDelegate.fs | 10 + .../Platforms/iOS/Info.plist | 32 + .../Platforms/iOS/Program.fs | 9 + .../Properties/launchSettings.json | 8 + .../Resources/AppIcon/appicon.svg | 4 + .../Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107140 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111028 bytes .../Resources/Images/dotnet_bot.svg | 93 + .../Resources/Raw/AboutAssets.txt | 15 + .../Resources/Resource.designer.cs | 22035 ++++++++++++++++ .../Resources/Splash/splash.svg | 8 + .../Resources/Styles/Colors.xaml | 45 + .../Resources/Styles/Styles.fs | 39 + .../Resources/Styles/Styles.xaml | 363 + src/GWallet.Frontend.Maui/global.json | 6 + 40 files changed, 23198 insertions(+), 1 deletion(-) create mode 100644 global.json create mode 100644 gwallet.maui.sln create mode 100644 src/GWallet.Frontend.Maui/App.xaml create mode 100644 src/GWallet.Frontend.Maui/App.xaml.fs create mode 100644 src/GWallet.Frontend.Maui/AppShell.xaml create mode 100644 src/GWallet.Frontend.Maui/AppShell.xaml.fs create mode 100644 src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj create mode 100644 src/GWallet.Frontend.Maui/MainPage.xaml create mode 100644 src/GWallet.Frontend.Maui/MainPage.xaml.fs create mode 100644 src/GWallet.Frontend.Maui/MauiProgram.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/Android/AndroidManifest.xml create mode 100644 src/GWallet.Frontend.Maui/Platforms/Android/MainActivity.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/Android/MainApplication.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/Android/Resources/values/colors.xml create mode 100644 src/GWallet.Frontend.Maui/Platforms/MacCatalyst/AppDelegate.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/MacCatalyst/Info.plist create mode 100644 src/GWallet.Frontend.Maui/Platforms/MacCatalyst/Program.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/Tizen/Main.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/Tizen/tizen-manifest.xml create mode 100644 src/GWallet.Frontend.Maui/Platforms/Windows/App.xaml create mode 100644 src/GWallet.Frontend.Maui/Platforms/Windows/App.xaml.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/Windows/Package.appxmanifest create mode 100644 src/GWallet.Frontend.Maui/Platforms/Windows/app.manifest create mode 100644 src/GWallet.Frontend.Maui/Platforms/iOS/AppDelegate.fs create mode 100644 src/GWallet.Frontend.Maui/Platforms/iOS/Info.plist create mode 100644 src/GWallet.Frontend.Maui/Platforms/iOS/Program.fs create mode 100644 src/GWallet.Frontend.Maui/Properties/launchSettings.json create mode 100644 src/GWallet.Frontend.Maui/Resources/AppIcon/appicon.svg create mode 100644 src/GWallet.Frontend.Maui/Resources/AppIcon/appiconfg.svg create mode 100644 src/GWallet.Frontend.Maui/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 src/GWallet.Frontend.Maui/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 src/GWallet.Frontend.Maui/Resources/Images/dotnet_bot.svg create mode 100644 src/GWallet.Frontend.Maui/Resources/Raw/AboutAssets.txt create mode 100644 src/GWallet.Frontend.Maui/Resources/Resource.designer.cs create mode 100644 src/GWallet.Frontend.Maui/Resources/Splash/splash.svg create mode 100644 src/GWallet.Frontend.Maui/Resources/Styles/Colors.xaml create mode 100644 src/GWallet.Frontend.Maui/Resources/Styles/Styles.fs create mode 100644 src/GWallet.Frontend.Maui/Resources/Styles/Styles.xaml create mode 100644 src/GWallet.Frontend.Maui/global.json diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 75830f541..0b8be4545 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -139,7 +139,16 @@ jobs: - name: Setup .NET SDK 6.0.x uses: actions/setup-dotnet@v1.7.2 with: - dotnet-version: '6.0.113' + dotnet-version: '6.0.x' + - name: Install JDK 21 + # needed for MAUI Android build + run: | + Invoke-WebRequest -Uri https://aka.ms/download-jdk/microsoft-jdk-11-windows-x64.msi -OutFile jdk-11.msi -UseBasicParsing + Start-Process msiexec.exe -Wait -ArgumentList '/I jdk-11.msi /quiet' + - name: Build Maui Frontend + run: | + dotnet workload install maui + dotnet build src\GWallet.Frontend.Maui\GWallet.Frontend.Maui.fsproj --framework net6.0-android || dotnet build src\GWallet.Frontend.Maui\GWallet.Frontend.Maui.fsproj --framework net6.0-android - name: configure run: .\configure.bat - name: build in DEBUG mode diff --git a/global.json b/global.json new file mode 100644 index 000000000..d8781bd10 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "6.0.113", + "rollForward": "latestMinor" + } + } \ No newline at end of file diff --git a/gwallet.maui.sln b/gwallet.maui.sln new file mode 100644 index 000000000..729ba1294 --- /dev/null +++ b/gwallet.maui.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Frontend.Maui", "src\GWallet.Frontend.Maui\GWallet.Frontend.Maui.fsproj", "{D6C1C0C8-FD57-476F-8A60-BA99D8346045}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Backend", "src\GWallet.Backend\GWallet.Backend.fsproj", "{DA2EFDCB-1A3B-4057-ADAE-3831DCFA4056}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D6C1C0C8-FD57-476F-8A60-BA99D8346045}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6C1C0C8-FD57-476F-8A60-BA99D8346045}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6C1C0C8-FD57-476F-8A60-BA99D8346045}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {D6C1C0C8-FD57-476F-8A60-BA99D8346045}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6C1C0C8-FD57-476F-8A60-BA99D8346045}.Release|Any CPU.Build.0 = Release|Any CPU + {D6C1C0C8-FD57-476F-8A60-BA99D8346045}.Release|Any CPU.Deploy.0 = Release|Any CPU + {DA2EFDCB-1A3B-4057-ADAE-3831DCFA4056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA2EFDCB-1A3B-4057-ADAE-3831DCFA4056}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA2EFDCB-1A3B-4057-ADAE-3831DCFA4056}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA2EFDCB-1A3B-4057-ADAE-3831DCFA4056}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/src/GWallet.Frontend.Maui/App.xaml b/src/GWallet.Frontend.Maui/App.xaml new file mode 100644 index 000000000..bf7134f3d --- /dev/null +++ b/src/GWallet.Frontend.Maui/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/GWallet.Frontend.Maui/App.xaml.fs b/src/GWallet.Frontend.Maui/App.xaml.fs new file mode 100644 index 000000000..a10d7d4a6 --- /dev/null +++ b/src/GWallet.Frontend.Maui/App.xaml.fs @@ -0,0 +1,10 @@ +namespace GWallet.Frontend.Maui + +open Microsoft.Maui.Controls +open Microsoft.Maui.Controls.Xaml + +type App() as this = + inherit Application() + + do this.LoadFromXaml typeof |> ignore + do this.MainPage <- AppShell() diff --git a/src/GWallet.Frontend.Maui/AppShell.xaml b/src/GWallet.Frontend.Maui/AppShell.xaml new file mode 100644 index 000000000..c8b5443cd --- /dev/null +++ b/src/GWallet.Frontend.Maui/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/src/GWallet.Frontend.Maui/AppShell.xaml.fs b/src/GWallet.Frontend.Maui/AppShell.xaml.fs new file mode 100644 index 000000000..7b87b4790 --- /dev/null +++ b/src/GWallet.Frontend.Maui/AppShell.xaml.fs @@ -0,0 +1,9 @@ +namespace GWallet.Frontend.Maui + +open Microsoft.Maui.Controls +open Microsoft.Maui.Controls.Xaml + +type AppShell() as this = + inherit Shell() + + do this.LoadFromXaml(typeof) |> ignore \ No newline at end of file diff --git a/src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj b/src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj new file mode 100644 index 000000000..2f0d6ef7c --- /dev/null +++ b/src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj @@ -0,0 +1,131 @@ + + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + + + Exe + GWallet.Frontend.Maui + true + true + false + true + + + geewallet + + + com.geewallet + 2F160DBF-529A-4906-A490-C58F706241BF + + + 1.0 + 1 + + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + false + + + + + + MainPage.xaml + + + + AppShell.xaml + + + + App.xaml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + $(DefaultXamlRuntime) + + + $(WindowsProjectFolder)App.xaml + + + + + + + + + + + + + diff --git a/src/GWallet.Frontend.Maui/MainPage.xaml b/src/GWallet.Frontend.Maui/MainPage.xaml new file mode 100644 index 000000000..e0004495a --- /dev/null +++ b/src/GWallet.Frontend.Maui/MainPage.xaml @@ -0,0 +1,67 @@ + + + +