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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH1383: Add command line option to display build target graph #2248

Merged
merged 1 commit into from Sep 3, 2018

Conversation

Projects
None yet
4 participants
@andrewlock
Contributor

andrewlock commented Aug 22, 2018

First off, thanks for Cake - I use it for all my personal projects and in my day job, so really appreciate the work you guys have put into it 馃檪

I've put together a PR for #1383 as it's something I'd find pretty useful. I made the command line option --showtree or --tree. Most of the implementation is pretty straight forward, but there's one point in particular I'm not sure about.

The existing CakeGraph is one of the easiest ways to get the "top level" tasks. However, currently the CakeGraph and CakeGraphBuilder are internal classes of Cake.Core. In order to make it available to Cake, we could either

  • Make CakeGraphBuilder, CakeGraph, and CakeGraphEdge public
  • Add [InternalsVisibleTo("Cake")] to the Cake.Core project

I went for the latter, as it seemed the easiest!

The other point of interest is a MaxDepth constant that could be used to limit how deep the tree is. At the moment it's just "hidden" functionality (a constant set to 0) as I wasn't sure whether it was worth exposing it.

@patriksvensson

LGTM! 馃憤

@patriksvensson

This comment has been minimized.

Show comment
Hide comment
@patriksvensson

patriksvensson Aug 22, 2018

Member

@andrewlock Really cool and useful feature!

Would it be possible to use different foreground colors for delegating tasks (tasks without actions) and top level tasks? Perhaps gray for delegating and cyan for root tasks? I've already approved this PR, so if you feel like moving on, we can revisit this at a later point.

Great job! 馃憤

@cake-build/cake-team Any additional feedback?

Member

patriksvensson commented Aug 22, 2018

@andrewlock Really cool and useful feature!

Would it be possible to use different foreground colors for delegating tasks (tasks without actions) and top level tasks? Perhaps gray for delegating and cyan for root tasks? I've already approved this PR, so if you feel like moving on, we can revisit this at a later point.

Great job! 馃憤

@cake-build/cake-team Any additional feedback?

@andrewlock

This comment has been minimized.

Show comment
Hide comment
@andrewlock

andrewlock Aug 23, 2018

Contributor

Good idea - I've added this to the PR. It now displays top-level tasks in Cyan, delegating in Gray, and standard in Green (similar to report output).

The Actions and DelayedActions properties aren't exposed in ICakeTaskInfo, so I had to cast them to a CakeTask to find out if it's a delegating task. A bit hacky, but the other option of modifying the ICakeTaskInfo interface, or adding a new interface to CakeTask seemed too heavy-handed for a small feature.

The output from the command line now looks something like this:

image

Or with inverted colours (the console in VS Code):

image

Contributor

andrewlock commented Aug 23, 2018

Good idea - I've added this to the PR. It now displays top-level tasks in Cyan, delegating in Gray, and standard in Green (similar to report output).

The Actions and DelayedActions properties aren't exposed in ICakeTaskInfo, so I had to cast them to a CakeTask to find out if it's a delegating task. A bit hacky, but the other option of modifying the ICakeTaskInfo interface, or adding a new interface to CakeTask seemed too heavy-handed for a small feature.

The output from the command line now looks something like this:

image

Or with inverted colours (the console in VS Code):

image

@patriksvensson

LGTM! 馃憤

@pascalberger

This comment has been minimized.

Show comment
Hide comment
@pascalberger

pascalberger Aug 23, 2018

Member

LGTM and I think fixes also the use case of #1506

Member

pascalberger commented Aug 23, 2018

LGTM and I think fixes also the use case of #1506

@devlead devlead changed the title from Add command line option to display build target graph to GH1383: Add command line option to display build target graph Sep 3, 2018

@devlead devlead merged commit f0f3b59 into cake-build:develop Sep 3, 2018

6 checks passed

Build Cake #631 succeeded
Details
Cake Develop (Cake) TeamCity build finished
Details
ci/bitrise/7a9d707b00881436/pr Passed - OSX Cake
Details
ci/bitrise/b811c91a26b1ea80/pr Passed - Ubuntu Cake
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details
@devlead

This comment has been minimized.

Show comment
Hide comment
@devlead

devlead Sep 3, 2018

Member

@andrewlock your changes have been merged, thanks for your contribution 馃憤

Member

devlead commented Sep 3, 2018

@andrewlock your changes have been merged, thanks for your contribution 馃憤

@andrewlock andrewlock deleted the andrewlock:tree-command-line branch Sep 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment