Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Mar 10, 2024
1 parent 6300893 commit 517d672
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let GTK_FRONTEND_APP = sprintf "%s.Frontend.XF.Gtk" PASCALCASE_NAME
let CONSOLE_FRONTEND_APP = sprintf "%s.Frontend.ConsoleApp" PASCALCASE_NAME
let BACKEND_LIB = sprintf "%s.Backend" PASCALCASE_NAME

let currentVersion = (Misc.GetCurrentVersion FsxHelper.RootDir).ToString()
let currentVersion = Misc.GetCurrentVersion FsxHelper.RootDir

type FrontendProject =
| XF
Expand Down Expand Up @@ -477,7 +477,7 @@ match maybeTarget with
let binDir = "bin"
Directory.CreateDirectory(binDir) |> ignore

let zipNameWithoutExtension = sprintf "%s-v%s" script.Name currentVersion
let zipNameWithoutExtension = sprintf "%s-v%s" script.Name (currentVersion.ToString())
let zipName = sprintf "%s.zip" zipNameWithoutExtension
let pathToZip = Path.Combine(binDir, zipName)
if (File.Exists (pathToZip)) then
Expand Down Expand Up @@ -696,10 +696,15 @@ match maybeTarget with
BinaryConfig.Debug
let buildFlags = GetBuildFlags "dotnet" binaryConfig None
let allBuildFlags = sprintf "%s -property:Version=%s" buildFlags versionToPack
let maybeWarnAsError =
if currentVersion.Minor % 2 = 0 then
"-warnaserror"
else
String.Empty
Process.Execute(
{
Command = "dotnet"
Arguments = sprintf "pack -warnaserror %s %s" allBuildFlags backendProj
Arguments = sprintf "pack %s %s %s" maybeWarnAsError allBuildFlags backendProj
},
Echo.All
).UnwrapDefault() |> ignore<string>
Expand All @@ -708,7 +713,7 @@ match maybeTarget with
|> Seq.tryExactlyOne

// try first to create a non-prerelease package (as we want to fail fast instead of just fail at git tag push)
let maybeNupkg = createNugetPackageFile currentVersion
let maybeNupkg = createNugetPackageFile (currentVersion.ToString())
let nupkg =
match maybeNupkg with
| None -> failwith "File *.nupkg not found, did `dotnet pack` work properly?"
Expand All @@ -717,7 +722,7 @@ match maybeTarget with
nupkg
else
File.Delete nupkg
let nugetVersion = Network.GetNugetPrereleaseVersionFromBaseVersion currentVersion
let nugetVersion = Network.GetNugetPrereleaseVersionFromBaseVersion (currentVersion.ToString())
match createNugetPackageFile nugetVersion with
| None ->
failwith "File *.nupkg not found (prerelease), did `dotnet pack` work properly?"
Expand Down

0 comments on commit 517d672

Please sign in to comment.