Skip to content

Commit d67ccff

Browse files
committed
improve exclusion of workers from ReadyToRun
1 parent 46399a7 commit d67ccff

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,11 @@
88
<IsPackable Condition="'$(IsPackable)' != ''">true</IsPackable>
99
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
1010
</PropertyGroup>
11-
<ItemGroup>
12-
<PublishReadyToRunExclude Include="Microsoft.PackageManagement.dll" />
13-
<PublishReadyToRunExclude Include="Microsoft.PackageManagement.ArchiverProviders.dll" />
14-
<PublishReadyToRunExclude Include="Microsoft.PackageManagement.CoreProviders.dll" />
15-
<PublishReadyToRunExclude Include="Microsoft.PackageManagement.MetaProvider.PowerShell.dll" />
16-
<PublishReadyToRunExclude Include="Microsoft.PackageManagement.NuGetProvider.dll" />
17-
<PublishReadyToRunExclude Include="Microsoft.Management.Infrastructure.dll" />
18-
<PublishReadyToRunExclude Include="Microsoft.Management.Infrastructure.Native.dll" />
19-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.ConsoleHost.dll" />
20-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.PackageManagement.dll" />
21-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.Commands.Diagnostics.dll" />
22-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.Commands.Utility.dll" />
23-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.MarkdownRender.dll" />
24-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.Commands.Management.dll" />
25-
<PublishReadyToRunExclude Include="Microsoft.PowerShell.Security.dll" />
26-
<PublishReadyToRunExclude Include="Microsoft.CodeAnalysis.CSharp.dll" />
27-
<PublishReadyToRunExclude Include="System.Management.Automation.dll" />
28-
<PublishReadyToRunExclude Include="Microsoft.WSMan.Management.dll" />
29-
<PublishReadyToRunExclude Include="System.DirectoryServices.AccountManagement.dll" />
30-
</ItemGroup>
11+
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
12+
<PublishReadyToRun>true</PublishReadyToRun>
13+
<PublishReadyToRunEmitSymbols>true</PublishReadyToRunEmitSymbols>
14+
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
15+
</PropertyGroup>
3116
<PropertyGroup>
3217
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3318
<LangVersion>7.3</LangVersion>
@@ -123,14 +108,30 @@
123108
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
124109
</Content>
125110
</ItemGroup>
126-
127-
<!--This target copies the contract assemblies we need to reference as part of function compilation-->
128-
<!-- Temporarily commented out since we're not using contract assemblies -->
129-
<!--<Target Name="CopyCompilationReferenceFiles" AfterTargets="Build">
111+
112+
<!-- Remove all worker items from the ReadyToRun publish list -->
113+
<Target Name="ExcludeWorkersFromReadyToRun" BeforeTargets="_PrepareForReadyToRunCompilation">
114+
<CreateItem
115+
Include="@(ResolvedFileToPublish)"
116+
Condition="$([System.String]::new('%(ResolvedFileToPublish.TargetPath)').StartsWith('workers'))" >
117+
<Output
118+
TaskParameter="Include"
119+
ItemName="_ExcludeFromReadyToRun" />
120+
</CreateItem>
121+
130122
<ItemGroup>
131-
<RefSourceFiles Include="$(UserProfile)/.nuget/packages/netstandard.library/2.0.0/build/netstandard2.0/ref/*.dll" />
123+
<ResolvedFileToPublish Remove="@(_ExcludeFromReadyToRun)" />
132124
</ItemGroup>
133-
<Copy SourceFiles="@(RefSourceFiles)" DestinationFiles="@(RefSourceFiles->'$(OutDir)/compilationrefs/%(RecursiveDir)%(Filename)%(Extension)')" />
134-
</Target>-->
125+
</Target>
126+
127+
<!-- Add all worker items back to the publish list -->
128+
<Target Name="IncludeWorkersInPublish" AfterTargets="CreateReadyToRunImages">
129+
<CreateItem
130+
Include="@(_ExcludeFromReadyToRun)">
131+
<Output
132+
TaskParameter="Include"
133+
ItemName="ResolvedFileToPublish" />
134+
</CreateItem>
135+
</Target>
135136

136-
</Project>
137+
</Project>

0 commit comments

Comments
 (0)