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

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?

@xperiandri xperiandri force-pushed the setExecutionContextFromCommandLineArgs branch 2 times, most recently from c04fd5f to 89d9376 Compare July 14, 2024 22:01
@xperiandri
Copy link
Collaborator

Will we add the line about this to the release notes?
https://github.com/fsprojects/FAKE/pull/2778/files

@xperiandri xperiandri force-pushed the setExecutionContextFromCommandLineArgs branch from 89d9376 to 9f1f7bb Compare July 15, 2024 11:59
@Numpsy
Copy link
Contributor

Numpsy commented Jul 15, 2024

Looks like the build failures for this one are because Fantomas wants the code to be formatted

@xperiandri
Copy link
Collaborator

Completed in #2785

@xperiandri xperiandri closed this Jul 27, 2024
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.

3 participants