Skip to content

Full interactive mode (ask for target) #1436

@Danielku15

Description

@Danielku15

Description

Nuke is great and very flexible when it comes to CLI usage and is very flexible in the usage from CI/CD systems. What I am missing a bit, is a modern user experience when developers use the "_build" project locally.

If the project/build is started without any input, and we detect a "Terminal" host, we enter an interactive mode to ask the user what to do. e.g. we have 5 different entry points to our build depending on what you want to do.

Usage Example

When I launch the "_build.exe" (or dotnet run) Nuke should prompt the user:

​
███╗   ██╗██╗   ██╗██╗  ██╗███████╗
████╗  ██║██║   ██║██║ ██╔╝██╔════╝
██╔██╗ ██║██║   ██║█████╔╝ █████╗  
██║╚██╗██║██║   ██║██╔═██╗ ██╔══╝  
██║ ╚████║╚██████╔╝██║  ██╗███████╗
╚═╝  ╚═══╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝
​
NUKE Execution Engine version 8.1.2 (Windows,.NETCoreApp,Version=v8.0)
​
Targets (with their direct dependencies):

  > PrepareEnviroment
      Checks for any missing environment configurations on your machine and sets up whatever is needed.
    Build
      Compile the whole project.
    Test
      Run the tests of this project 

Select which target you want to run with the arrow keys and run it with [ENTER].

Then it starts the respective target just as if nuke --target PrepareEnvironment is called. The way of asking could be either fully interactive like very modern console apps, or simply asking for the user to type it.

​
███╗   ██╗██╗   ██╗██╗  ██╗███████╗
████╗  ██║██║   ██║██║ ██╔╝██╔════╝
██╔██╗ ██║██║   ██║█████╔╝ █████╗  
██║╚██╗██║██║   ██║██╔═██╗ ██╔══╝  
██║ ╚████║╚██████╔╝██║  ██╗███████╗
╚═╝  ╚═══╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝
​
NUKE Execution Engine version 8.1.2 (Windows,.NETCoreApp,Version=v8.0)
​
Targets (with their direct dependencies):

  PrepareEnviroment
    Checks for any missing environment configurations on your machine and sets up whatever is needed.
  Build
    Compile the whole project.
  Test
    Run the tests of this project 

Which target do you want to run (default: PrepareEnvironment): _

Alternative

I thought of making some unlisted target "interactive" the default one. Then I do any console interactivity myself (by loading the targets and stuff myself).

After the user has chosen the target, I would launch the target.

a) I cannot directly trigger another target within the same process. But it would be nice if I can have a dynamic "Triggers" in this target.
b) I trigger the target via DotNetTasks.DotNetRun(<current assembly, target and parameters>)

Could you help with a pull-request?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions