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

Running target issue #28

Closed
constructor-igor opened this issue Oct 9, 2016 · 4 comments
Closed

Running target issue #28

constructor-igor opened this issue Oct 9, 2016 · 4 comments

Comments

@constructor-igor
Copy link

Please, could you help me to understand: I defined default target "Report", but when I run the script (see below) Powershell shows error:
image

var target = Argument("Target", "Report");

Task("Start")
  .Does(() =>
{
  Information("Hello World!");
});

Task("Tests")
    .IsDependentOn("Start")
    .Does(()=>
{
    Information("Tests!");
});

Task("Report")
    .IsDependentOn("Tests")
    .Does(()=>
{
    Information("Report!");
});

RunTarget(target);
@gep13
Copy link
Member

gep13 commented Oct 9, 2016

@constructor-igor have a look here:

https://github.com/cake-build/example/blob/master/build.ps1#L44

If you don't specify a target argument for the build.ps1 the default is Default. As a result, there is not a target called that in your script. Normally, I leave the Default task in place, but instead use an IsDependentOn method call to specify which Target should be invoked when calling Default.

@constructor-igor
Copy link
Author

but what does it mean var target = Argument("Target", "Report"); ?
I thought it defines default "Report"

@gep13
Copy link
Member

gep13 commented Oct 9, 2016

It does, when there is no target being passed in. However, the bootstrapper is always passing a target, I.e. Default 🙂

@constructor-igor
Copy link
Author

ok. understood ;)
thank you,
Igor.

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

No branches or pull requests

2 participants