Skip to content

Commit 2691fc8

Browse files
authored
Remove RefOnly optional msbuild switch (#106482)
This changes removes support for the /p:RefOnly=true msbuild switch and the libs.ref and the libs.src subsets. The former allowed to only build the reference assemblies of the sfx and/or oob libraries. This isn't possible anymore now that we remove reference source projects for libraries that don't need them anymore. This switch was never documented and isn't used afaik. The removal of the two libs subsets is happening for the same reason. Now that projects start removing the reference source projects, the split between and ref and src doesn't work anymore. Those subsets were listed by the subsets help description but aren't used anymore.
1 parent c5c5551 commit 2691fc8

File tree

4 files changed

+8
-34
lines changed

4 files changed

+8
-34
lines changed

eng/Subsets.props

+4-10
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@
196196
<SubsetName Include="Libs.Native" Description="The native libraries used in the shared framework." />
197197
<SubsetName Include="Libs.Sfx" Description="The managed shared framework libraries." />
198198
<SubsetName Include="Libs.Oob" Description="The managed out-of-band libraries." />
199-
<SubsetName Include="Libs.Ref" OnDemand="true" Description="The managed reference libraries." />
200-
<SubsetName Include="Libs.Src" OnDemand="true" Description="The managed implementation libraries." />
201199
<SubsetName Include="Libs.PreTest" Description="Test assets which are necessary to run tests." />
202200
<SubsetName Include="Libs.Tests" OnDemand="true" Description="The test projects. Note that building this doesn't execute tests: you must also pass the '-test' argument." />
203201

@@ -481,20 +479,16 @@
481479
<ProjectToBuild Include="$(SharedNativeRoot)libs\build-native.proj" Category="libs" />
482480
</ItemGroup>
483481

484-
<ItemGroup Condition="$(_subset.Contains('+libs.ref+')) or $(_subset.Contains('+libs.src+')) or $(_subset.Contains('+libs.sfx+'))">
482+
<ItemGroup Condition="$(_subset.Contains('+libs.sfx+'))">
485483
<ProjectToBuild Include="$(LibrariesProjectRoot)sfx.proj"
486484
Category="libs"
487485
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or
488486
'$(BuildTargetFramework)' == '' or
489-
'$(BuildAllConfigurations)' == 'true'">
490-
<AdditionalProperties Condition="$(_subset.Contains('+libs.ref+'))">%(AdditionalProperties);RefOnly=true</AdditionalProperties>
491-
</ProjectToBuild>
487+
'$(BuildAllConfigurations)' == 'true'" />
492488
</ItemGroup>
493489

494-
<ItemGroup Condition="$(_subset.Contains('+libs.ref+')) or $(_subset.Contains('+libs.src+')) or $(_subset.Contains('+libs.oob+'))">
495-
<ProjectToBuild Include="$(LibrariesProjectRoot)oob.proj" Category="libs">
496-
<AdditionalProperties Condition="$(_subset.Contains('+libs.ref+'))">%(AdditionalProperties);RefOnly=true</AdditionalProperties>
497-
</ProjectToBuild>
490+
<ItemGroup Condition="$(_subset.Contains('+libs.oob+'))">
491+
<ProjectToBuild Include="$(LibrariesProjectRoot)oob.proj" Category="libs" />
498492
</ItemGroup>
499493

500494
<ItemGroup Condition="$(_subset.Contains('+mono.wasmruntime+'))">

src/libraries/oob.proj

+1-8
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
<ProjectReference Include="oob-gen.proj" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
2323
</ItemGroup>
2424

25-
<!-- Support building reference projects only. -->
26-
<ItemGroup Condition="'$(RefOnly)' == 'true'">
27-
<ProjectReference Remove="@(ProjectReference)" />
28-
<ProjectReference Include="sfx-ref.proj" OutputItemType="SharedFrameworkAssembly" />
29-
<ProjectReference Include="oob-ref.proj" />
30-
</ItemGroup>
31-
3225
<Target Name="GetTrimOOBAssembliesInputs"
3326
DependsOnTargets="ResolveProjectReferences">
3427
<PropertyGroup>
@@ -47,7 +40,7 @@
4740

4841
<Target Name="TrimOOBAssemblies"
4942
AfterTargets="Build"
50-
Condition="'$(RefOnly)' != 'true' and '@(OOBAssembly)' != ''"
43+
Condition="'@(OOBAssembly)' != ''"
5144
DependsOnTargets="GetTrimOOBAssembliesInputs;PrepareForAssembliesTrim"
5245
Inputs="$(ILLinkTasksAssembly);@(OOBAssemblyToTrim);@(OOBAssemblyReference);@(OOBLibrarySuppressionsXml)"
5346
Outputs="$(OOBAssembliesTrimMarkerFile)">

src/libraries/sfx-ref.proj

-8
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,4 @@
1717
System.Private.CoreLib\ref\System.Private.CoreLib.csproj" />
1818
</ItemGroup>
1919

20-
<ItemGroup Condition="'$(RefOnly)' == 'true'">
21-
<ProjectReference Include="shims\*\src\*.csproj" />
22-
<ReferenceShimProject Include="shims\*\ref\*.csproj" />
23-
<ProjectReference Include="@(ReferenceShimProject)" />
24-
<!-- Omit projects which depend on source projects to be built. -->
25-
<ProjectReference Remove="@(ReferenceShimProject->'shims\%(Filename)\src\%(Filename)%(Extension)')" />
26-
</ItemGroup>
27-
2820
</Project>

src/libraries/sfx.proj

+3-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
<ItemGroup>
1515
<!-- The sfx ref projects must be built first as sfx src projects don't use P2Ps to reference each other. Instead the
1616
references are defined manually via Reference items, therefore the reference assemblies must exist before that. -->
17-
<ProjectReference Include="sfx-ref.proj">
18-
<OutputItemType Condition="'$(RefOnly)' == 'true'">SharedFrameworkAssembly</OutputItemType>
19-
</ProjectReference>
20-
<!-- The RefOnly condition exists to support building the reference source projects only. -->
21-
<ProjectReference Include="sfx-src.proj" OutputItemType="SharedFrameworkAssembly" Condition="'$(RefOnly)' != 'true'" />
17+
<ProjectReference Include="sfx-ref.proj" />
18+
<ProjectReference Include="sfx-src.proj" OutputItemType="SharedFrameworkAssembly" />
2219
<ProjectReference Include="sfx-gen.proj" OutputItemType="SharedFrameworkAnalyzerAssembly" />
2320
</ItemGroup>
2421

@@ -61,8 +58,7 @@
6158

6259
<!-- Copy the intellisense file to the targeting pack directory. -->
6360
<Target Name="CopyDocumentationFiles"
64-
AfterTargets="Build"
65-
Condition="'$(RefOnly)' != 'true'">
61+
AfterTargets="Build">
6662
<ItemGroup>
6763
<DocumentationFileToCopy Include="@(SharedFrameworkAssembly->WithMetadataValue('IsPrivateAssembly', 'false')->Metadata('DocFileItem'))" />
6864
</ItemGroup>
@@ -89,7 +85,6 @@
8985
<Target Name="TrimSharedFrameworkAssemblies"
9086
AfterTargets="Build"
9187
DependsOnTargets="ResolveProjectReferences;GetTrimSharedFrameworkAssembliesInputs;PrepareForAssembliesTrim"
92-
Condition="'$(RefOnly)' != 'true'"
9388
Inputs="@(SharedFrameworkAssembly);@(SharedFrameworkSuppressionsXml);$(ILLinkTasksAssembly)"
9489
Outputs="$(SharedFrameworkAssembliesTrimMarkerFile)">
9590
<Message Text="$(MSBuildProjectName) -> Trimming $(OutputRID) shared framework assemblies with ILLinker..." Importance="high" />

0 commit comments

Comments
 (0)