Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Context.setExecutionContextFromCommandLineArgs #2750

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cataggar
Copy link
Contributor

This moves this boilerplate into a function. A minimal build script that works on .NET 6 & .NET 7 with Visual Studio IntelliSense and works with private NuGet feeds will now be:

#!/usr/bin/env -S dotnet fsi
#r "nuget: Fake.Core.Target"

Fake.Core.Context.setExecutionContextFromCommandLineArgs __SOURCE_FILE__

open Fake.Core

Target.create "clean" (fun _ ->
  Trace.log "Cleaning stuff"
)

Target.create "build" (fun _ ->
  Trace.log "Building the app"
)

Target.create "deploy" (fun _ ->
  Trace.log "Deploying app"
)

open Fake.Core.TargetOperators

"clean"
  ==> "build"
  ==> "deploy"

Target.runOrList()

This can be run with dotnet fsi build.fsx. On Linux or Mac OSX, this can be run with ./buid.fsx as well.

xperiandri
xperiandri previously approved these changes Oct 29, 2023
@xperiandri
Copy link
Collaborator

What if executed not from the script?

@xperiandri
Copy link
Collaborator

Maybe it must be in the separate package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants