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

List targets quietly #1953

Merged
merged 4 commits into from
May 21, 2018
Merged

Conversation

baronfel
Copy link
Contributor

This PR fixes a build break I got while building the repo, and silences the output of the warnings if the RunContext verbosity is set to Silent.

@baronfel
Copy link
Contributor Author

Result after this change:

bash-3.2$ dotnet ~/oss/FAKE/src/app/Fake.netcore/bin/Debug/netcoreapp2.0/fake.dll -s build --list
The following targets are available:
   AssemblyInfo
   KillStarted
   Clean
   YarnInstall
   DotnetRestore
   DotnetBuild
   DotnetTest
   WatchUnitTests
   BrunchProduction
   DotnetPublish
   BuildWebsiteDebug
   BuildCollectorDebug
   BuildBrunch
   WatchWebsite
   RunWebsite
   CheckGitlab
   ReleaseGitlab
   DebianPackage
   CopyDeployScripts
   CopyDeployScriptsDebug
   CreateUpdatePackage
   CreateUpdatePackageDebug
   UploadToUpdateServer
   Debug
   Release
   JavascriptBuild
   Build
   RunTests
   Version
   Xml
   BuildProduction

which any completion script could easily skip the first line of.
I'd looked at disabling that first line of output as well, but the RunContext isn't something that Targets have access to from what I can tell?

@baronfel
Copy link
Contributor Author

Added sorting of the target names, but it's harder to test that because my script is using proper nugets.

@@ -611,7 +611,8 @@ let prepareAndRunScript (config:FakeConfig) : RunResult =
let retrieveHints (config:FakeConfig) (runResult:Runners.RunResult) =
match runResult with
| Runners.RunResult.SuccessRun _ -> []
| Runners.RunResult.CompilationError err -> [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that syntax will no longer yield a warning with next F# version ;)

@@ -156,7 +156,7 @@ let runOrBuild (args : RunArguments) =
let result =
match runResult with
| Runners.RunResult.SuccessRun warnings ->
if warnings <> "" then
if warnings <> "" && args.VerboseLevel.PrintNormal then
traceFAKE "%O" warnings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually shouldn't this print into standard-error anyway? So your tool can just ignore stderr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point, let me try redirection and see what I get

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right of course :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can roll back this change then, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this basically means it already works are you are not blocked, correct (besides the sort)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and I may not even need that (in zsh's completion, see image below). So maybe just rollback the whole thing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove that line change, please

@matthid matthid changed the base branch from master to release/rc May 21, 2018 17:09
@baronfel
Copy link
Contributor Author

we may not even need the sorting, at least for zsh, because it seems to have sorted it itself:
image

@matthid
Copy link
Member

matthid commented May 21, 2018

Thanks! I think travis is just choking right now as all builds seem to be red right now.

@matthid matthid merged commit 8640251 into fsprojects:release/rc May 21, 2018
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.

2 participants