Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@ Copyright (c) .NET Foundation. All rights reserved.
RuntimeIdentifier="$(RuntimeIdentifier)"
PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
CompilerOptions="@(DependencyFileCompilerOptions)">

<Output TaskParameter="FilesWritten" ItemName="FileWrites" />
</GenerateDepsFile>

<ItemGroup>
<!-- Do this in an ItemGroup instead of as an output parameter of the GenerateDepsFile task so that it still gets added to the item set
during incremental builds when the task is skipped -->
<FileWrites Include="$(ProjectDepsFilePath)" Condition="Exists('$(ProjectDepsFilePath)')"/>
Copy link
Member

Choose a reason for hiding this comment

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

Don't put this in a separate target, add it to GenerateBuildDependencyFile.

MSBuild will manipulate items that it can statically understand even when it skips a target for being up to date. It wasn't doing that before because it can't predict what the task would have output.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rainersigwald Thanks for clarifying, I've updated the PR accordingly.

</ItemGroup>
</Target>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,38 @@ public void It_builds_the_project_successfully()
testAsset.Restore("TestApp");
testAsset.Restore("TestLibrary");

VerifyAppBuilds(testAsset);
}

[Fact]
public void It_builds_the_project_successfully_twice()
{
var testAsset = _testAssetsManager
.CopyTestAsset("AppWithLibrary")
.WithSource();

testAsset.Restore("TestApp");
testAsset.Restore("TestLibrary");


for (int i = 0; i < 2; i++)
{
VerifyAppBuilds(testAsset);
}
}

void VerifyAppBuilds(TestAsset testAsset)
{
var appProjectDirectory = Path.Combine(testAsset.TestRoot, "TestApp");

var buildCommand = new BuildCommand(Stage0MSBuild, appProjectDirectory);
var outputDirectory = buildCommand.GetOutputDirectory("netcoreapp1.0");

buildCommand
.Execute()
.Should()
.Pass();

var outputDirectory = buildCommand.GetOutputDirectory("netcoreapp1.0");

outputDirectory.Should().OnlyHaveFiles(new[] {
"TestApp.dll",
"TestApp.pdb",
Expand Down