Skip to content
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

Suppress assets messages for Clean target. #1821

Merged
merged 2 commits into from
Feb 6, 2018

Conversation

peterhuene
Copy link
Contributor

@peterhuene peterhuene commented Dec 15, 2017

This commit ensures that messages from project.assets.json aren't logged for
the Clean target. If a project is cleaned that has diagnostic messages
stored from a previous restore operation, the Clean target would previously
log the messages via the ReportAssetsLogMessages target.

Since a clean operation does not perform a restore, this is confusing to users.
The fix is to set the EmitAssetsLogMessages property to false for the
Clean target.

Fixes dotnet/cli#8027.

<PropertyGroup>
<CoreCleanDependsOn>
SuppressAssetsLogMessages;
$(CoreCleanDependsOn);
Copy link
Contributor

Choose a reason for hiding this comment

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

We likely need to turn it back on after Clean because Rebuild is Clean;Rebuild

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I'll fix that.

Copy link
Contributor

@nguerrera nguerrera Dec 19, 2017

Choose a reason for hiding this comment

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

I wonder if we can use $(BuildingProject) != "true" instead. It is flipped to true before CoreBuild. cc @davkean, @rainersigwald

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not because that will break design-time builds from getting the diagnostics (I think).

@peterhuene peterhuene force-pushed the clean-suppress-asset-messages branch 2 times, most recently from 65c0b74 to 0d7dc1e Compare December 20, 2017 22:33
@peterhuene
Copy link
Contributor Author

@nguerrera I've pushed up the fix to the rebuild target so that it continues to log assets messages.

We can't currently use $(BuildingProject) because the target that sets it to true (BuildOnlySettings) runs after the clean target for rebuild. Rather than change the rebuild target to depend on BuildOnlySettings before the clean target, I added a more explicit "unsupress asset messages" target.

I'm completely open to a better way of accomplishing this than what I have here; this feels kludgy.

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

@dsplaisted @tannergooding do we really need the test projects in the SDK repo to be as explicit as it is below?

@livarcocc
Copy link
Contributor

ping @dotnet/dotnet-cli to get a code review here.

@peterhuene peterhuene requested a review from a team February 6, 2018 00:18
@@ -108,10 +108,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{529365
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Build.Tests", "src\Tests\Microsoft.NET.Build.Tests\Microsoft.NET.Build.Tests.csproj", "{52CB4546-DD2D-4207-B6E1-494C9506D1C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Clean.Tests", "src\Tests\Microsoft.NET.Clean.Tests\Microsoft.NET.Clean.Tests.csproj", "{5CBFF0EE-71EA-49CC-8369-34A9A62C8116}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we need the overhead of two more test projects for these. I'd be fine cheating and putting them in the build.tests project.

Copy link
Contributor

@nguerrera nguerrera Feb 6, 2018

Choose a reason for hiding this comment

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

(I don't have a strong opinion on this I requested changes based on another part that I misunderstood.)

Peter Huene added 2 commits February 6, 2018 12:35
This commit adds macOS `.DS_Store` files to .gitignore.
This commit ensures that messages from `project.assets.json` aren't logged for
the `Clean` target.  If a project is cleaned that has diagnostic messages
stored from a previous restore operation, the Clean target would previously
log the messages via the `ReportAssetsLogMessages` target.

Since a clean operation does not perform a restore, this is confusing to users.
The fix is to set the `EmitAssetsLogMessages` property to `false` for the
`Clean` target, but not the `Rebuild` target that depends on the `Clean`
target.

Fixes dotnet/cli#8027.
@peterhuene peterhuene merged commit 23f91e8 into dotnet:master Feb 6, 2018
JL03-Yue pushed a commit that referenced this pull request Mar 19, 2024
Enable source-build prebuilt detection
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.

'dotnet clean' seems to ignore project NU1603 warning suppression
3 participants