Skip to content

Commit

Permalink
Add workaround for NuGet/Home/5894 so source packages get included
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilchie committed Jan 17, 2018
1 parent 17b0cb7 commit 6715843
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\VisualStudio.props" />

<PropertyGroup>
<!-- workaround for https://github.com/NuGet/Home/issues/5894 -->
<OriginalProjectName>Microsoft.VisualStudio.ProjectSystem.Managed.VS</OriginalProjectName>
<RootMSBuildProjectExtensionsPath>C:\Code\project-system\artifacts\Debug\obj\$(OriginalProjectName)\</RootMSBuildProjectExtensionsPath>

This comment has been minimized.

Copy link
@tmat

tmat Jan 17, 2018

Member

This path is probably not right :)

This comment has been minimized.

Copy link
@Pilchie

Pilchie Jan 17, 2018

Author Member

Oh, right - I was going to come back and find the right variable names to use :)

This comment has been minimized.

Copy link
@Pilchie

Pilchie Jan 17, 2018

Author Member

I'm copying from the NuGet issue above:

<RootMSBuildProjectExtensionsPath>$(RepoRoot)obj\$(BuildSubPath)$(OriginalProjectName)\</RootMSBuildProjectExtensionsPath>

Any idea on RepoToolset equivalent to get the obj path?

This comment has been minimized.

Copy link
@tmat

tmat Jan 17, 2018

Member

$(ArtifactsObjDir)$(OriginalProjectName)\

<LangVersion>7.1</LangVersion>

This comment has been minimized.

Copy link
@tmat

tmat Jan 17, 2018

Member

Do we need to set LangVersion?

This comment has been minimized.

Copy link
@Pilchie

Pilchie Jan 17, 2018

Author Member

Yes, it fails without it because the included files depend on 7.1 features.

This comment has been minimized.

Copy link
@tmat

tmat Jan 17, 2018

Member

Setting this property somewhere here https://github.com/dotnet/project-system/blob/master/src/Directory.Build.props#L14 would be better, so that the entire repo uses the same lang version.

</PropertyGroup>
<Import Project="$(RootMSBuildProjectExtensionsPath)$(OriginalProjectName).*.props"
Condition=" '$(MSBuildProjectName)' != '$(OriginalProjectName)' and '$(ImportProjectExtensionProps)' != 'false' and exists('$(RootMSBuildProjectExtensionsPath)')" />

This comment has been minimized.

Copy link
@tmat

tmat Jan 17, 2018

Member

What's ImportProjectExtensionProps variable?

This comment has been minimized.

Copy link
@Pilchie

Pilchie Jan 17, 2018

Author Member

NuGet seems to condition things on it (basically, they allow it as a way to prevent pulling in props and targets from packages). Following the pattern at NuGet/Home#5894 (comment)

This comment has been minimized.

Copy link
@tmat

tmat Jan 17, 2018

Member

I see. Thanks.


<PropertyGroup>
<RootNamespace>Microsoft.VisualStudio</RootNamespace>

Expand Down Expand Up @@ -239,5 +249,7 @@
<Compile Update="@(Compile)">
<Link Condition="'%(NuGetPackageId)' != ''">%(NuGetPackageId)\%(Link)</Link>
</Compile>
</ItemGroup>
</Project>
</ItemGroup>
<Import Project="$(RootMSBuildProjectExtensionsPath)$(OriginalProjectName).*.targets"
Condition=" '$(MSBuildProjectName)' != '$(OriginalProjectName)' and '$(ImportProjectExtensionProps)' == 'true' and exists('$(RootMSBuildProjectExtensionsPath)')" />
</Project>

0 comments on commit 6715843

Please sign in to comment.