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

Cake.Tool - How in the world do I run a specific task? #2585

Closed
VictorioBerra opened this issue Jul 26, 2019 · 5 comments

Comments

@VictorioBerra
Copy link

commented Jul 26, 2019

PS C:\Source\Templates> dotnet cake --help

Usage: Cake.exe [script] [--verbosity=value]
                [--showdescription] [--dryrun] [..]

Example: Cake.exe
Example: Cake.exe build.cake --verbosity=quiet
Example: Cake.exe build.cake --showdescription

Options:
    --verbosity=value    Specifies the amount of information to be displayed.
                         (Quiet, Minimal, Normal, Verbose, Diagnostic)
    --debug              Performs a debug.
    --showdescription    Shows description about tasks.
    --showtree           Shows the task dependency tree.
    --dryrun             Performs a dry run.
    --exclusive          Execute a single task without any dependencies.
    --bootstrap          Download/install modules defined by #module directives
    --version            Displays version information.
    --info               Displays additional information about Cake execution.
    --help               Displays usage information.

I see no way here on how I can specify the task to run.

Not mentioned here either https://cakebuild.net/blog/2018/08/cake-v0.30.0-released

@VictorioBerra

This comment has been minimized.

Copy link
Author

commented Jul 26, 2019

I just answered my question, I had to open the build.ps1 file and find the -target="whatever" which worked. Should this be documented somewhere at least?

@Insire

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

it is here

@VictorioBerra

This comment has been minimized.

Copy link
Author

commented Jul 26, 2019

@Insire Yes but the dotnet CLI global tool Cake.Tool bootstrap wrapper for cake does not have any documentation on those.

@Roadrunner67

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2019

I've just made a PR #2605

@Roadrunner67

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2019

@VictorioBerra The answer you should have had to your issue post is something like this:

Target is a term unknown to Cake itself.

It is something we usually build into our Cake scripts, beginning with:
var target = Argument("target", "Default");
..and ending with:

RunTarget(target);
So you can choose the target from outside by adding -target=value to your command line.
If you don't, the target 'Default' will be executed (where you can place your own instruction to the user to select a specific target, if there is no logical default).

build.ps1/build.sh should only in very rare cases need modification.

@devlead devlead added the Improvement label Sep 8, 2019
@devlead devlead added this to the v0.35.0 milestone Sep 8, 2019
@devlead devlead closed this in 89bcd68 Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.