Skip to content

Commit

Permalink
make.fsx: GTK front on dotnet6+xbuild build lanes
Browse files Browse the repository at this point in the history
  • Loading branch information
aarani committed Aug 22, 2023
1 parent a73308f commit 79296b3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/fsx
49 changes: 42 additions & 7 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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 ->
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 79296b3

Please sign in to comment.