diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2b7f1c492..60de62e8b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,8 +32,6 @@ jobs: run: ./configure.sh - name: build in DEBUG mode run: make - - name: Build Maui Android frontend - run: dotnet build src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj --framework=net8.0-android - name: Build Android APK run: dotnet publish src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj --framework net8.0-android --configuration Release # Upload artifact fails with "permission denied" error without this diff --git a/scripts/make.fsx b/scripts/make.fsx index 5e70e4395..14213c73a 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -53,14 +53,17 @@ type FrontendProject = type FrontendApp = | Console | Gtk + | Maui member self.GetProjectName() = match self with | Console -> CONSOLE_FRONTEND_APP | Gtk -> GTK_FRONTEND_APP + | Maui -> MAUI_FRONTEND_APP member self.GetExecutableName() = match self with | Console -> CONSOLE_FRONTEND_APP | Gtk -> UNIX_NAME + | Maui -> MAUI_FRONTEND_APP override self.ToString() = sprintf "%A" self @@ -310,13 +313,9 @@ let DotNetBuild () | _ -> () -// We have to build Maui project for android twice because the first time we get -// an error about Resource file not found. The second time it works. -// https://github.com/fabulous-dev/FSharp.Mobile.Templates/tree/55a1f3a0fd5cc397e48677ef4ff9241b360b0e84 -let BuildMauiProject binaryConfig = +let BuildMauiProject (binaryConfig: BinaryConfig) (frameworkIdentifier: string) = let mauiProjectFilePath = FrontendProject.Maui.GetProjectFile().FullName - DotNetBuild mauiProjectFilePath binaryConfig "--framework net8.0-android" true - DotNetBuild mauiProjectFilePath binaryConfig "--framework net8.0-android" false + DotNetBuild mauiProjectFilePath binaryConfig (sprintf "--framework %s" frameworkIdentifier) true let JustBuild binaryConfig maybeConstant: FrontendApp*FileInfo = let maybeBuildTool = Map.tryFind "BuildTool" buildConfigContents @@ -381,7 +380,6 @@ let JustBuild binaryConfig maybeConstant: FrontendApp*FileInfo = // somehow, msbuild doesn't restore the frontend dependencies (e.g. Xamarin.Forms) when targetting // the {LINUX|MAC}_SOLUTION_FILE below, so we need this workaround. TODO: just finish migrating to MAUI(dotnet restore) NugetRestore solution - CopyXamlFiles() MSBuildRestoreAndBuild solution FrontendApp.Console @@ -421,6 +419,13 @@ let JustBuild binaryConfig maybeConstant: FrontendApp*FileInfo = FrontendApp.Gtk else FrontendApp.Console + | Some buildTool, None when buildTool = "dotnet" -> + if Misc.GuessPlatform() = Misc.Platform.Linux && FsxHelper.AreGtkLibsPresent Echo.All then + BuildMauiProject binaryConfig "net6.0-gtk" + else + BuildMauiProject binaryConfig "net8.0-android" + + FrontendApp.Maui | _ -> FrontendApp.Console let scriptName = sprintf "%s-%s" UNIX_NAME (frontend.ToString().ToLower()) @@ -480,8 +485,8 @@ let MakeAll (maybeConstant: Option) = Network.DownloadNugetExe FsxHelper.NugetExe #endif let buildConfig = BinaryConfig.Debug - let frontend,_ = JustBuild buildConfig maybeConstant CopyXamlFiles() + let frontend,_ = JustBuild buildConfig maybeConstant frontend,buildConfig let RunFrontend (frontend: FrontendApp) (buildConfig: BinaryConfig) (maybeArgs: Option) =