Skip to content

Commit

Permalink
make.fsx: implement the 'reinstall' target in Win
Browse files Browse the repository at this point in the history
For easier development experience.

TODO: implement same for unix, but maybe when we get rid of
legacy framework support, so that we can just adopt make.fsx
(instead of having install.sh for mac/linux like it's
happening now).
  • Loading branch information
knocte committed Aug 18, 2023
1 parent 190356d commit 7bd612a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ release:
install: release
./scripts/install.sh

reinstall:
echo "'reinstall' target not supported yet in Unix, uninstall manually and use 'install' for now" >> /dev/stderr
exit 1

check:
./scripts/runTests.fsx
34 changes: 20 additions & 14 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,17 @@ let finalReleaseFolderPath = Path.Combine(releaseFolderPath, "net6.0")
let finalReleaseFolderPath = releaseFolderPath
#endif

match maybeTarget with

| None
| Some "all" -> MakeAll() |> ignore

| Some "release" ->
let buildConfig = BinaryConfig.Release
JustBuild buildConfig

| Some "install" ->
let Install(isReinstall: bool) =
let buildConfig = BinaryConfig.Release
JustBuild buildConfig

if fsxInstallationDir.Exists then
// TODO
failwithf
"Existing installation found in '%s'. This script can't overwrite an existing installation yet"
fsxInstallationDir.FullName
if not isReinstall then
failwithf
"Existing installation found in '%s'. Consider using the target 'reinstall' instead of 'install'."
fsxInstallationDir.FullName
else
fsxInstallationDir.Delete true

Console.WriteLine "Installing..."
Console.WriteLine()
Expand Down Expand Up @@ -322,6 +315,19 @@ match maybeTarget with
sprintf "Successfully installed in %s" fsxInstallationDir.FullName
)

match maybeTarget with

| None
| Some "all" -> MakeAll() |> ignore

| Some "release" ->
let buildConfig = BinaryConfig.Release
JustBuild buildConfig

| Some "reinstall" -> Install true

| Some "install" -> Install false

| Some "check" ->

// FIXME: contributor should be able to run 'make check' before 'make install'
Expand Down

0 comments on commit 7bd612a

Please sign in to comment.