Run target according to NoBuild flag#2140
Conversation
| <!-- Ensure there is minimal verbosity output pointing to the publish directory and not just the | ||
| build step's minimal output. Otherwise there is no indication at minimal verbosity of where | ||
| the published assets were copied. --> | ||
| Condition="$(IsPublishable) == 'true' and '$(NoBuild)' != 'true'" |
There was a problem hiding this comment.
@nguerrera Only add an extra condition is added based on the "WIP" and let PackTool depends on both of them. But only one of them will be run according to the flag at that time
There was a problem hiding this comment.
I don't really understand what you wrote here. We can't condition Publish on NoBuild because we need /t:Publish /p:NoBuild=true to work. I think you're acknowledging that and that this isn't final, but I'm not entirely sure. ;)
There was a problem hiding this comment.
Ah... you are right. I still need a target to "re direct"
| </_CorePublishTargets> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="PublishBuild" |
There was a problem hiding this comment.
These should be _ ("private") and still thinking about the names.
There was a problem hiding this comment.
_PublishBuildAlternative _PublishNoBuildAlternative ?? So people look at the following line will know only one of them will be run. And by appending alternative, it looks pretty internal
<Target Name="Publish"
Condition="$(IsPublishable) == 'true'"
DependsOnTargets="$(_PublishBuildAlternative);$(_PublishNoBuildAlternative)" |
@nguerrera added test, and ready |
| { | ||
| public class GivenThatWeWantToPackAToolProjectWithGeneratePackageOnBuild : SdkTest | ||
| { | ||
|
|
|
|
||
| result.StdOut.Should().NotContain("There is a circular dependency"); | ||
| result.ExitCode.Should().Be(0); | ||
|
|
| CommandResult result = buildCommand.Execute(); | ||
|
|
||
| result.StdOut.Should().NotContain("There is a circular dependency"); | ||
| result.ExitCode.Should().Be(0); |
There was a problem hiding this comment.
This is written elsewhere as Should().Pass().And.NotHaveStdOutContaining("...");
NuGet will set No Build flag in their target to avoid circular dependency. However, Publish evulate NoBuild during evaluation time.
* master: (26 commits) Honor NoBuild flag in target (#2140) Support uppercase 'V' in TargetFrameworkVersion Prevent test MSBuild nodes from persisting LOC CHECKIN | dotnet/sdk master | 20180409 (#2120) Update expected NETStandard.Library package version Update Stage 0 .NET CLI and sync NuGet version Disable multilevel lookup in more cases when running tests Add support for InvariantGlobalization MSBuild property Don't include .resx files in None item Enable nupkg signing Don't include files with source extension in None item by default Fixing a grammar issue Add support for /t:Publish /p:NoBuild=true Feedback Pin the FSharp.Core package version Fix F# typo, add smoke tests, Fix behaviour for implicit defines Adding satellite assembly tests for transitive direct references Responding to PR feedback. Adding some basic tests ensuring direct references are transitive Updating GenerateDepsFile so that direct references of referenced projects appear in the deps.json ...
fix #2114