-
Notifications
You must be signed in to change notification settings - Fork 344
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
OnlyWhenStatic does not skip dependencies #1296
Labels
Comments
I'm expecting a complete sample. |
all right: class Build : NukeBuild
{
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode
public static int Main () => Execute<Build>(x => x.Compile);
Target Restore => _ => _
.Executes(() =>
{
Log.Error("this should not run");
});
Target Compile => _ => _
.OnlyWhenStatic(()=>IsServerBuild)
.DependsOn(Restore)
.Executes(() =>
{
Log.Warning("this shouldn't run either");
});
} I would expect both targets to be skipped if I run but what I get is:
|
strangely, it worked on our gitlab runner as expected:
will test locally again and close if confirmed fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage Information
7.0.6 / 8.0.100 / Net. 7.0 / Windows
Description
according to documentation
OnlyWhenStatic
should by default skip a task and all it's dependencies.Reproduction Steps
Create a task like in the documentation, without the
WhenSkipped
declaration or with it set to skipWhenSkipped(DependencyBehavior.Skip)
.Expected Behavior
No Task should run
Actual Behavior
Task A is run
Regression?
No response
Known Workarounds
No response
Could you help with a pull-request?
No
The text was updated successfully, but these errors were encountered: