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

Explicitly import NuGet.targets #2663

Merged
merged 3 commits into from
Oct 25, 2017

Conversation

AndyGerlicher
Copy link
Contributor

@AndyGerlicher AndyGerlicher commented Oct 24, 2017

NuGet.targets was added as a hard dependency in #2595, this change will
explicitly import it in Microsoft.Common.CurrentVersion.targets.

NuGet change: dotnet/NuGet.BuildTasks#44

NuGet.targets was added as a hard dependency in dotnet#2595, this change will
explicitly import it in Microsoft.Common.CurrentVersion.targets.
<!-- Import NuGet.targets (required for GetReferenceNearestTargetFrameworkTask and used for Restore functionality) -->
<PropertyGroup>
<NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'=='' and '$([MSBuild]::IsRunningFromVisualStudio())'=='true'">$(MSBuildToolsPath32)\..\..\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets</NuGetRestoreTargets>
<NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'==''">$(MSBuildToolsPath)\NuGet.targets</NuGetRestoreTargets>
Copy link
Member

Choose a reason for hiding this comment

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

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, thanks! This shouldn't be needed at all anymore. This file was just because that was the way we imported NuGet.targets and on .NET Core we didn't have the file locally to copy it. Now that the import is explicit this file isn't needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And to the location, it should be either in the VS install location (when IsRunningFromVisualStudio is true) or next to MSBuild in the .NET Core case ($(MSBuildToolsPath)). It should be the case that MSBuildToolsPath and MSBuildExtensionsPath are the same, but not necessarily. This work ok with mono?

Copy link
Member

@radical radical Oct 24, 2017

Choose a reason for hiding this comment

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

We deploy to MSBuildExtensionsPath. And that differs from MSBuildToolsPath on Mono. If the two are the same for netcore, then we can change it to use MSBuildExtensionsPath, I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it possible to change? Prefer to not use MSBuildExtensionsPath. Since they're fully required now, it's not really an extension. More like Roslyn is:

https://github.com/Microsoft/msbuild/blob/master/src/MSBuild/app.config#L101

The checked in file was just to get tests working not for any deployment strategy.

Copy link
Member

Choose a reason for hiding this comment

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

re:change, sure, I'll do that. I am wondering if I should be removing it from MSBuildExtensionsPath or have it in both locations (it doesn't import anything, currently!).

:: warning MSB4011: Imported target already imported. This will happen when Microsoft.NuGet.ImportAfter.targets installed on the local
:: machine still has the import to NuGet.targets which is now in Microsoft.Common.CurrentVersion.targets. This can be
:: removed when we want to require VS15.5+ to build locally.
SET _NOWARN=MSB3277;MSB3026;MSB3073;AL1053;MSB4011
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to add the code to cibuild.sh as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Or not, on cross plat I guess we won't get a double import warning?

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.

4 participants