Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit be34919

Browse files
committed
Make sure source isn't included in NETStandard.Library.NETFramework
Other framework packages (Microsoft.Private.*) are transport packages and need to contain source and symbols in order to flow those up to the actual framework packages that are built in core-setup. We put the source files in the sources path in our other framework pacakges because we need to workaround issues with myget assuming a symbols package when it sees a src folder. NETStandard.Library.NETFramework is not a transport package so we shouldn't put its sources in the sources folder. Instead they should be in the src folder so that pack splits them out into the symbols package.
1 parent 901af62 commit be34919

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

pkg/NETStandard.Library.NETFramework/NETStandard.Library.NETFramework.pkgproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@
132132
<!-- runs as initial target, overrides IncludeFiles in frameworkPackage.targets to define TFM-specific TargetPath
133133
under the build folder -->
134134
<Target Name="IncludeFiles" DependsOnTargets="IncludeNETStandardShims">
135+
<PropertyGroup>
136+
<_projectDirLength>$(ProjectDir.Length)</_projectDirLength>
137+
</PropertyGroup>
138+
135139
<ItemGroup>
136140
<!-- Include refs -->
137141
<File Include="@(RefFile)">
@@ -143,5 +147,13 @@
143147
<TargetPath Condition="'%(LibFile.TargetPath)' == '' ">build/%(LibFile.TargetFramework)/lib%(LibFile.SubFolder)</TargetPath>
144148
</File>
145149
</ItemGroup>
150+
151+
<ItemGroup>
152+
<!-- Set targetpath for sources to be under src so that it is excluded from the lib package -->
153+
<File Condition="'%(File.IsSourceCodeFile)' == 'true'">
154+
<TargetPath>src</TargetPath>
155+
<TargetPath Condition="$([System.String]::Copy('%(FullPath)').StartsWith('$(ProjectDir)'))">src/$([System.String]::Copy('%(FullPath)').Substring($(_projectDirLength)).Replace('\', '/'))</TargetPath>
156+
</File>
157+
</ItemGroup>
146158
</Target>
147159
</Project>

pkg/frameworkPackage.targets

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
</Target>
6565

6666
<Target Name="IncludeFiles">
67+
<PropertyGroup>
68+
<_projectDirLength>$(ProjectDir.Length)</_projectDirLength>
69+
</PropertyGroup>
70+
6771
<ItemGroup>
6872
<!-- Include refs -->
6973
<File Include="@(RefFile)">
@@ -79,6 +83,14 @@
7983
<TargetPath>$(NativeFileTargetPath)</TargetPath>
8084
</File>
8185
</ItemGroup>
86+
87+
<ItemGroup Condition="'$(IncludeSymbolsInPackage)' != 'true'">
88+
<!-- Set targetpath for sources to be under src so that it is excluded from the lib package -->
89+
<File Condition="'%(File.IsSourceCodeFile)' == 'true'">
90+
<TargetPath>src</TargetPath>
91+
<TargetPath Condition="$([System.String]::Copy('%(FullPath)').StartsWith('$(ProjectDir)'))">src/$([System.String]::Copy('%(FullPath)').Substring($(_projectDirLength)).Replace('\', '/'))</TargetPath>
92+
</File>
93+
</ItemGroup>
8294
</Target>
8395

8496
<Target Name="GetClosureFiles">

0 commit comments

Comments
 (0)