Skip to content

avoid warning for importing pack targets twice - #1185

Merged
rohit21agrawal merged 1 commit into
masterfrom
ragrawal-avoiddupimportforpack
May 9, 2017
Merged

rohit21agrawal merged 1 commit into
masterfrom
ragrawal-avoiddupimportforpack

Conversation

@rohit21agrawal

Copy link
Copy Markdown
Contributor

The fix for #888 was incomplete in the sense that if $(NuGetBuildTasksPackTargets) is defined in a target contained via the nupkg, it is already imported as a result of restore. SDK shouldn't be trying to import those targets again.

@dsplaisted @nguerrera

CC: @kzu to make sure it doesn't break nugetizer's behavior since he did the original fix.

@dsplaisted

Copy link
Copy Markdown
Member

So to clarify, the NuGet package sets the ImportNuGetBuildTasksPackTargets property? So this change means that if the property is set, it won't be used to import anything?

@rohit21agrawal

Copy link
Copy Markdown
Contributor Author

@dsplaisted no, the NuGet package sets the NuGetBuildTasksPackTargets property. If that property is not set, then sdk targets evaluate ImportNuGetBuildTasksPackTargets to true (https://github.com/dotnet/sdk/pull/1185/files#diff-0f39add6afb079d5b2b9c0af850df7d7R49) and import the targets that are baked in with the sdk.

@dsplaisted

Copy link
Copy Markdown
Member

It seems a bit backwards that if you set the property, that causes it not to get used.

Could the NuGet package set ImportNuGetBuildTasksPackTargets to false instead of setting the NuGetBuildTasksPackTargets property, and then could this PR be updated to only set the ImportNuGetBuildTasksPackTargets property if it's not already defined?

@rohit21agrawal
rohit21agrawal force-pushed the ragrawal-avoiddupimportforpack branch from 4d71f3c to 20f3c6f Compare May 6, 2017 02:14
@rohit21agrawal

Copy link
Copy Markdown
Contributor Author

@dsplaisted have made the suggested changes. here is corresponding PR for the nuget side changes:

NuGet/NuGet.Client#1368

@kzu

kzu commented May 6, 2017

Copy link
Copy Markdown
Contributor

Doesn't make sense to set the NuGetBuildTasksPackTargets at all if the ImportNuGetBuildTasksPackTargets controls whether it's used or not, @rohit21agrawal

Makes it very confusing to set it and not see it imported explicitly anywhere. Better just leave it unassigned

@rohit21agrawal
rohit21agrawal force-pushed the ragrawal-avoiddupimportforpack branch from 20f3c6f to a866098 Compare May 8, 2017 19:10
@rohit21agrawal

Copy link
Copy Markdown
Contributor Author

@dotnet-bot test Windows_NT_FullFramework Release please.

@rohit21agrawal

Copy link
Copy Markdown
Contributor Author

CC: @livarcocc @dsplaisted @nguerrera ..all tests passed, can we merge this?

@rohit21agrawal
rohit21agrawal merged commit 1796999 into master May 9, 2017
@nguerrera
nguerrera deleted the ragrawal-avoiddupimportforpack branch October 17, 2017 16:10
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.

5 participants