Skip to content

Commit a93ff60

Browse files
pranavkmeerhardt
andauthored
SDK fixes (dotnet#23317)
* Fix up Blazor ILLink Descriptor files 1. Add the typegranularity file to TrimmerRootDescriptor. 2. Remove the application assembly descriptor file, since the application assembly is passed in as a RootAssembly already. * Razor SDK fixups for blazor * Only include dlls when generating type granular assemblies * Write server-worker to the obj directory Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
1 parent 4465a8e commit a93ff60

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/LinkerWorkaround.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
<type fullname="System.ComponentModel.TimeSpanConverter" />
1414
</assembly>
1515

16-
<assembly fullname="System.Runtime.InteropServices.JavaScript" preserve="all" />
17-
1816
<assembly fullname="System.Text.Json">
1917
<!-- S.T.J. uses Activator.CreateInstance to instantiate converters, so we need to preserve default constructors.
2018
For safety, do this for all converter types, even though most of them are preserved anyway due to being referenced

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.ServiceWorkerAssetsManifest.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Copyright (c) .NET Foundation. All rights reserved.
121121
</PropertyGroup>
122122

123123
<ItemGroup>
124-
<_ServiceWorkerIntermediatePublishFile Include="%(ServiceWorker.IntermediateOutputPath)serviceworkers\%(FileName).publish%(Extension)">
124+
<_ServiceWorkerIntermediatePublishFile Include="$(IntermediateOutputPath)serviceworkers\%(FileName).publish%(Extension)">
125125
<ContentSourcePath Condition="'%(ServiceWorker.PublishedContent)' != ''">%(ServiceWorker.PublishedContent)</ContentSourcePath>
126126
<ContentSourcePath Condition="'%(ServiceWorker.PublishedContent)' == ''">%(ServiceWorker.Identity)</ContentSourcePath>
127127
<RelativePath>%(ServiceWorker.Identity)</RelativePath>
@@ -154,7 +154,7 @@ Copyright (c) .NET Foundation. All rights reserved.
154154
CopyToPublishDirectory="PreserveNewest"
155155
RelativePath="%(_ServiceWorkerIntermediatePublishFile.RelativePath)"
156156
ExcludeFromSingleFile="true" />
157-
157+
158158
<ResolvedFileToPublish
159159
Include="$(_ServiceWorkerAssetsManifestPublishIntermediateOutputPath)"
160160
CopyToPublishDirectory="PreserveNewest"

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,36 +307,26 @@ Copyright (c) .NET Foundation. All rights reserved.
307307

308308
<Target Name="_CreateBlazorTrimmerRootDescriptorFiles" BeforeTargets="ILLink" AfterTargets="ComputeResolvedFilesToPublishList">
309309
<PropertyGroup>
310-
<_BlazorApplicationTrimmerDescriptorFile>$(IntermediateOutputPath)default.trimmerdescriptor.xml</_BlazorApplicationTrimmerDescriptorFile>
311310
<_BlazorTypeGranularTrimmerDescriptorFile>$(IntermediateOutputPath)typegranularity.trimmerdescriptor.xml</_BlazorTypeGranularTrimmerDescriptorFile>
312311
</PropertyGroup>
313312

314313
<ItemGroup>
315314
<_BlazorTypeGranularAssembly
316315
Include="@(ResolvedFileToPublish)"
317-
Condition="$([System.String]::Copy('%(Filename)').StartsWith('Microsoft.AspNetCore.')) or $([System.String]::Copy('%(Filename)').StartsWith('Microsoft.Extensions.'))">
316+
Condition="'%(Extension)' == '.dll' AND ($([System.String]::Copy('%(Filename)').StartsWith('Microsoft.AspNetCore.')) or $([System.String]::Copy('%(Filename)').StartsWith('Microsoft.Extensions.')))">
318317
<Required>false</Required>
319318
<Preserve>all</Preserve>
320319
</_BlazorTypeGranularAssembly>
321-
322-
<_BlazorApplicationAssembly Include="@(IntermediateAssembly)">
323-
<Required>true</Required>
324-
</_BlazorApplicationAssembly>
325320
</ItemGroup>
326321

327-
<CreateBlazorTrimmerRootDescriptorFile
328-
Assemblies="@(_BlazorApplicationAssembly)"
329-
TrimmerFile="$(_BlazorApplicationTrimmerDescriptorFile)" />
330-
331322
<CreateBlazorTrimmerRootDescriptorFile
332323
Assemblies="@(_BlazorTypeGranularAssembly)"
333324
TrimmerFile="$(_BlazorTypeGranularTrimmerDescriptorFile)" />
334325

335326
<ItemGroup>
336-
<TrimmerRootDescriptor Include="$(_BlazorApplicationTrimmerDescriptorFile)" />
327+
<TrimmerRootDescriptor Include="$(_BlazorTypeGranularTrimmerDescriptorFile)" />
337328
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)LinkerWorkaround.xml" />
338329

339-
<FileWrites Include="$(_BlazorApplicationTrimmerDescriptorFile)" />
340330
<FileWrites Include="$(_BlazorTypeGranularTrimmerDescriptorFile)" />
341331
</ItemGroup>
342332
</Target>

0 commit comments

Comments
 (0)