Skip to content

Run target according to NoBuild flag#2140

Merged
wli3 merged 1 commit into
dotnet:masterfrom
wli3:fix-circular
Apr 14, 2018
Merged

Run target according to NoBuild flag#2140
wli3 merged 1 commit into
dotnet:masterfrom
wli3:fix-circular

Conversation

@wli3

@wli3 wli3 commented Apr 12, 2018

Copy link
Copy Markdown

fix #2114

@wli3 wli3 requested a review from nguerrera April 12, 2018 22:53
<!-- 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'"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. ;)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... you are right. I still need a target to "re direct"

@nguerrera nguerrera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

</_CorePublishTargets>
</PropertyGroup>

<Target Name="PublishBuild"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be _ ("private") and still thinking about the names.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_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)" 

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like those names :)

@wli3 wli3 changed the title WIP Run target according to NoBuild flag Run target according to NoBuild flag Apr 13, 2018
@wli3 wli3 requested a review from a team April 13, 2018 01:15
@wli3

wli3 commented Apr 13, 2018

Copy link
Copy Markdown
Author

@nguerrera added test, and ready

{
public class GivenThatWeWantToPackAToolProjectWithGeneratePackageOnBuild : SdkTest
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: empty line


result.StdOut.Should().NotContain("There is a circular dependency");
result.ExitCode.Should().Be(0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: empty line.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

CommandResult result = buildCommand.Execute();

result.StdOut.Should().NotContain("There is a circular dependency");
result.ExitCode.Should().Be(0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is written elsewhere as Should().Pass().And.NotHaveStdOutContaining("...");

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

NuGet will set No Build flag in their target to avoid circular dependency. However, Publish evulate NoBuild during evaluation time.
@wli3 wli3 merged commit 964d734 into dotnet:master Apr 14, 2018
@wli3 wli3 deleted the fix-circular branch April 14, 2018 01:38
livarcocc added a commit that referenced this pull request Apr 16, 2018
* 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
  ...
@wli3 wli3 mentioned this pull request May 22, 2019
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

Successfully merging this pull request may close these issues.

Cannot build project with PackAsTool=true and GeneratePackageOnBuild=true

2 participants