-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ensure Build target isn't invoked when NoBuild is set. #2938
Conversation
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
Outdated
Show resolved
Hide resolved
I think it would be good to look at https://github.com/dotnet/cli/issues/9656 together with/soon after this to make sure we're on solid footing with NoBuild. |
It would obviously be a breaking change to have a I'd be happy to include that fix with this PR if we feel that's wise. |
I meant we should try to find a way to fix the issue without giving up on NoBuild everywhere. I just meant we should look at that while we’re looking at this. May require coordinated changes with NuGet. |
We should test this with GeneratePackageOnBuild |
Good catch. It fails with It seems wrong for Now I remember why I had the I'll have to replace the |
What do you mean by giving up on NoBuild? Ah, I think you mean fixing it without having an additional property in the publish targets? |
I think I get what you're saying. How about this: we keep this commit, change the I'll add a TODO comment linked to the issue with these changes. With both fixes in place (and a follow-up change from us to remove the |
Let me step back:
But we still need to fix (1) somehow and I’m saying that we should look at this while we’re adding more NoBuild functionality. |
Typed that without seeing recent replies. Thumbs up on plan above. |
For `dotnet pack --nobuild` and `dotnet publish --nobuild`, if a target inadvertently triggers the `Build` target, the build proceeds despite the user explicitly requesting no build takes place. This commit ensures the SDK errors if the `Build` target gets invoked when `NoBuild` is true. Fixes dotnet/cli#9581.
I've filed NuGet/Home#7801 and amended the commit as stated. |
…build 20190919.9 (dotnet#2938) - Microsoft.NET.Sdk.Razor - 3.1.0-preview1.19469.9
For
dotnet pack --nobuild
anddotnet publish --nobuild
, if a targetinadvertently triggers the
Build
target, the build proceeds despite the userexplicitly requesting no build takes place.
This commit ensures the SDK errors if the
Build
target gets invoked whenNoBuild
is true.Fixes dotnet/cli#9581.