Skip to content

Commit c219229

Browse files
committed
Make inbox P2Ps not reference their output assembly
1 parent 06fc0d5 commit c219229

File tree

10 files changed

+24
-19
lines changed

10 files changed

+24
-19
lines changed

eng/references.targets

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,20 @@
4242
</ItemGroup>
4343
</Target>
4444

45-
<!-- Make shared framework assemblies not app-local (non private). -->
45+
<!-- Make shared framework assemblies not app-local (non private) and don't reference them. -->
4646
<Target Name="UpdateProjectReferencesWithPrivateAttribute"
4747
AfterTargets="AssignProjectConfiguration"
4848
BeforeTargets="PrepareProjectReferences"
4949
Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
5050
('$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true') and
5151
'@(ProjectReferenceWithConfiguration)' != ''">
5252
<ItemGroup>
53-
<ProjectReferenceWithConfiguration PrivateAssets="all"
54-
Private="false"
55-
Condition="$(NetCoreAppLibrary.Contains('%(Filename);'))" />
53+
<ProjectReferenceWithConfiguration Condition="$(NetCoreAppLibrary.Contains('%(Filename);'))">
54+
<PrivateAssets>all</PrivateAssets>
55+
<Private>false</Private>
56+
<ReferenceOutputAssembly Condition="!$(NetCoreAppLibraryNoReference.Contains('%(Filename);')) and
57+
'%(ProjectReferenceWithConfiguration.SkipUseReferenceAssembly)' != 'true'">false</ReferenceOutputAssembly>
58+
</ProjectReferenceWithConfiguration>
5659
</ItemGroup>
5760
</Target>
5861

eng/targetingpacks.targets

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
</Reference>
3030
</ItemGroup>
3131

32-
<ItemGroup Condition="'@(ProjectReference)' != '' and '$(IsTestProject)' == 'true'">
33-
<ProjectReference Update="@(ProjectReference->WithMetadataValue('ReferenceOutputAssembly', 'false')->WithMetadataValue('OutputItemType', ''))"
34-
OutputItemType="_UnresolvedTargetingPackExclusion" />
35-
</ItemGroup>
36-
3732
<!-- .NETCoreApp > 2.x DisableImplicitAssemblyReferences support. -->
3833
<Target Name="RemoveFrameworkReferences"
3934
BeforeTargets="_HandlePackageFileConflicts"
@@ -100,7 +95,6 @@
10095
<_targetingPackReferenceExclusion Include="$(TargetName)" />
10196
<_targetingPackReferenceExclusion Include="@(_ResolvedProjectReferencePaths->'%(Filename)')" />
10297
<_targetingPackReferenceExclusion Include="@(DefaultReferenceExclusion)" />
103-
<_targetingPackReferenceExclusion Include="@(_UnresolvedTargetingPackExclusion->'%(Filename)')" />
10498
</ItemGroup>
10599

106100
<ItemGroup>

src/libraries/System.Diagnostics.Debug/tests/System.Diagnostics.Debug.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\src\System.Runtime.csproj;
2424
$(LibrariesProjectRoot)System.Threading\src\System.Threading.csproj"
2525
SkipUseReferenceAssembly="true" />
26+
<ProjectReference Include="..\src\System.Diagnostics.Debug.csproj" />
2627
<!-- Do not reference since we build part of the source code for tests. -->
27-
<ProjectRefence Include="..\src\System.Diagnostics.Debug.csproj" ReferenceOutputAssembly="false" />
28+
<DefaultReferenceExclusion Include="System.Diagnostics.Debug" />
2829
<DefaultReferenceExclusion Include="System.Runtime.Extensions" />
2930
</ItemGroup>
3031
</Project>

src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@
112112
<Compile Include="XunitTestAssemblyAtrributes.cs" />
113113
</ItemGroup>
114114
<ItemGroup>
115+
<ProjectReference Include="..\..\src\System.Net.Http.WinHttpHandler.csproj" />
115116
<!-- Do not reference since we build part of the source code for tests. -->
116-
<ProjectReference Include="..\..\src\System.Net.Http.WinHttpHandler.csproj" ReferenceOutputAssembly="false"/>
117+
<DefaultReferenceExclusion Include="System.Net.Http.WinHttpHandler" />
117118
</ItemGroup>
118119
</Project>

src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,10 @@
403403
<Compile Include="..\..\..\System.Net.Http.WinHttpHandler\tests\UnitTests\TestServer.cs"
404404
Link="WinHttpHandler\UnitTests\TestServer.cs" />
405405
</ItemGroup>
406-
<!-- Do not reference since we build part of the source code for tests. -->
407406
<ItemGroup>
408-
<ProjectReference Include="..\..\src\System.Net.Http.csproj" ReferenceOutputAssembly="false" />
407+
<ProjectReference Include="..\..\src\System.Net.Http.csproj" />
408+
<!-- Do not reference since we build part of the source code for tests. -->
409+
<DefaultReferenceExclusion Include="System.Net.Http" />
409410
<DefaultReferenceExclusion Include="System.Net.Mail" />
410411
</ItemGroup>
411412
</Project>

src/libraries/System.Net.Mail/tests/Unit/System.Net.Mail.Unit.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@
274274
</ItemGroup>
275275
<ItemGroup>
276276
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Principal.Windows\src\System.Security.Principal.Windows.csproj" />
277+
<ProjectReference Include="..\..\src\System.Net.Mail.csproj" />
277278
<!-- Do not reference since we build part of the source code for tests. -->
278-
<ProjectReference Include="..\..\src\System.Net.Mail.csproj" ReferenceOutputAssembly="false"/>
279+
<DefaultReferenceExclusion Include="System.Net.Mail" />
279280
</ItemGroup>
280281
</Project>

src/libraries/System.Net.NameResolution/tests/PalTests/System.Net.NameResolution.Pal.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
Link="Common\Interop\Unix\System.Native\Interop.SocketAddress.cs" />
107107
</ItemGroup>
108108
<ItemGroup>
109+
<ProjectReference Include="..\..\src\System.Net.NameResolution.csproj" />
109110
<!-- Do not reference since we build part of the source code for tests. -->
110-
<ProjectReference Include="..\..\src\System.Net.NameResolution.csproj" ReferenceOutputAssembly="false"/>
111+
<DefaultReferenceExclusion Include="System.Net.NameResolution" />
111112
</ItemGroup>
112113
</Project>

src/libraries/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
Link="Common\Extensions\ValueStopwatch\ValueStopwatch.cs" />
4242
</ItemGroup>
4343
<ItemGroup>
44+
<ProjectReference Include="..\..\src\System.Net.NameResolution.csproj" />
4445
<!-- Do not reference since we build part of the source code for tests. -->
45-
<ProjectReference Include="..\..\src\System.Net.NameResolution.csproj" ReferenceOutputAssembly="false" />
46+
<DefaultReferenceExclusion Include="System.Net.NameResolution" />
4647
</ItemGroup>
4748
</Project>

src/libraries/System.Net.Primitives/tests/PalTests/System.Net.Primitives.Pal.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
Link="ProductionCode\Common\System\Net\NetworkInformation\InterfaceInfoPal.Browser.cs" />
120120
</ItemGroup>
121121
<ItemGroup>
122+
<ProjectReference Include="..\..\src\System.Net.Primitives.csproj" />
122123
<!-- Do not reference since we build part of the source code for tests. -->
123-
<ProjectReference Include="..\..\src\System.Net.Primitives.csproj" ReferenceOutputAssembly="false" />
124+
<DefaultReferenceExclusion Include="System.Net.Primitives" />
124125
</ItemGroup>
125126
</Project>

src/libraries/System.Net.Primitives/tests/UnitTests/System.Net.Primitives.UnitTests.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@
107107
Link="ProductionCode\Common\Interop\Unix\System.Native\Interop.InterfaceNameToIndex.cs" />
108108
</ItemGroup>
109109
<ItemGroup>
110+
<ProjectReference Include="..\..\src\System.Net.Primitives.csproj" />
110111
<!-- Do not reference since we build part of the source code for tests. -->
111-
<ProjectReference Include="..\..\src\System.Net.Primitives.csproj" ReferenceOutputAssembly="false" />
112+
<DefaultReferenceExclusion Include="System.Net.Primitives" />
112113
</ItemGroup>
113114
</Project>

0 commit comments

Comments
 (0)