diff --git a/scripts/fsx b/scripts/fsx index 2268d5059..5488853b1 160000 --- a/scripts/fsx +++ b/scripts/fsx @@ -1 +1 @@ -Subproject commit 2268d505970604f38738bda758ffac44a2a77e54 +Subproject commit 5488853b17fedb44707e8459480297b618cffad0 diff --git a/scripts/make.fsx b/scripts/make.fsx index cd3bb551e..b659279f7 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -14,7 +14,7 @@ open System.Xml.Linq open System.Xml.XPath #if !LEGACY_FRAMEWORK -#r "nuget: Fsdk, Version=0.6.0--date20230812-0646.git-2268d50" +#r "nuget: Fsdk, Version=0.6.0--date20230818-1152.git-83d671b" #else #r "System.Configuration" open System.Configuration @@ -53,6 +53,18 @@ let GetSolution (solType: SolutionFile) = Path.Combine("src", solFileName) +type ProjectFile = + | XFFrontend + | GtkFrontend + +let GetProject (projFile: ProjectFile) = + let projFileName = + match projFile with + | GtkFrontend -> Path.Combine("GWallet.Frontend.XF.Gtk", "GWallet.Frontend.XF.Gtk.fsproj") + | XFFrontend -> Path.Combine("GWallet.Frontend.XF", "GWallet.Frontend.XF.fsproj") + + Path.Combine("src", projFileName) + let BACKEND = "GWallet.Backend" type Frontend = @@ -142,7 +154,6 @@ FRONTEND_PATH="$DIR_OF_THIS_SCRIPT/../lib/$UNIX_NAME/$GWALLET_PROJECT.exe" exec mono "$FRONTEND_PATH" "$@" """ -#if LEGACY_FRAMEWORK let NugetRestore projectOrSolutionRelativePath = let nugetArgs = sprintf @@ -180,9 +191,8 @@ let PrintNugetVersion () = Console.WriteLine() Console.Out.Flush() failwith "nuget process' output contained errors ^" -#endif -let BuildSolution +let BuildSolutionOrProject (buildToolAndBuildArg: string*string) (solutionFileName: string) (binaryConfig: BinaryConfig) @@ -296,7 +306,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = #endif Console.WriteLine (sprintf "Building in %s mode..." (binaryConfig.ToString())) - BuildSolution + BuildSolutionOrProject (buildTool, buildArg) solutionFileName binaryConfig @@ -309,9 +319,9 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = if buildTool = "msbuild" then let MSBuildRestoreAndBuild solutionFile = - BuildSolution ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "/t:Restore" + BuildSolutionOrProject ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "/t:Restore" // TODO: report as a bug the fact that /t:Restore;Build doesn't work while /t:Restore and later /t:Build does - BuildSolution ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "/t:Build" + BuildSolutionOrProject ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "/t:Build" match Misc.GuessPlatform () with | Misc.Platform.Mac -> @@ -342,7 +352,32 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = Frontend.Console | _ -> Frontend.Console + elif buildTool.StartsWith "dotnet" then + match maybeLegacyBuildTool with + | Some legacyBuildTool when legacyBuildTool = "xbuild" -> + if FsxHelper.AreGtkLibsPresent Echo.All then + BuildSolutionOrProject + (buildTool, buildArg) + (GetProject ProjectFile.XFFrontend) + binaryConfig + maybeConstant + String.Empty + + let buildSeparateNetStandardFlag = "/p:SeparateNetStandardBuildEngine=true" + + let gtkFrontendProject = GetProject ProjectFile.GtkFrontend + NugetRestore gtkFrontendProject + BuildSolutionOrProject + (legacyBuildTool, buildSeparateNetStandardFlag) + gtkFrontendProject + binaryConfig + maybeConstant + "/t:Build" + Frontend.Gtk + else + Frontend.Console + | _ -> Frontend.Console else Frontend.Console