Skip to content

Commit f63886f

Browse files
committed
Net Core - Improve Exclude BrowserSubProcess from .Net 5.0 SingleFile/SelfContained builds
Issue #3407
1 parent 06c525a commit f63886f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

NuGet/PackageReference/CefSharp.Common.NETCore.targets

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<_CefSharpBrowserSubProcessRuntimeConfig>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.runtimeconfig.json'))</_CefSharpBrowserSubProcessRuntimeConfig>
5-
<_CefSharpBrowserSubProcessExe>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.exe'))</_CefSharpBrowserSubProcessExe>
6-
<_CefSharpBrowserSubProcessDll>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.dll'))</_CefSharpBrowserSubProcessDll>
7-
</PropertyGroup>
3+
<ItemGroup>
4+
<_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.runtimeconfig.json'))"/>
5+
<_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.exe'))" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'"/>
6+
<_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.dll'))" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'"/>
7+
</ItemGroup>
88

99
<!--
1010
For SelfContained and PublishSingleFile we remove the CefSharp.BrowserSubprocess.runtimeconfig.json file so
11-
the BrowserSubprocess runs using the packages .net runtime
11+
the BrowserSubprocess runs using the packaged .net runtime
1212
Issue https://github.com/cefsharp/CefSharp/issues/3407
1313
-->
1414
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
1515
<ItemGroup>
16-
<ReferenceCopyLocalPaths Remove="$(_CefSharpBrowserSubProcessRuntimeConfig)" />
16+
<ReferenceCopyLocalPaths Remove="@(_CefSharpBrowserSubProcessFiles)" />
1717
</ItemGroup>
1818
</Target>
1919

2020
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterComputeFilesToPublish" AfterTargets="ComputeFilesToPublish" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
2121
<ItemGroup>
22-
<ResolvedFileToPublish Remove="$(_CefSharpBrowserSubProcessRuntimeConfig)" />
22+
<ResolvedFileToPublish Remove="@(_CefSharpBrowserSubProcessFiles)" />
2323
</ItemGroup>
2424
</Target>
2525

2626
<!--
27-
For SelfContained and SingleFile under .Net 5 we don't include a default BrowserSubprocess
27+
For SelfContained and SingleFile under .Net 5 we don't include a default BrowserSubprocess files
2828
SelfHosting of the BrowserSubprocess is required
2929
Issue https://github.com/cefsharp/CefSharp/issues/3407
3030
-->
31-
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeComputeFilesToBundle" BeforeTargets="_ComputeFilesToBundle" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
31+
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeComputeFilesToBundle" BeforeTargets="_ComputeFilesToBundle" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
3232
<ItemGroup>
33-
<ResolvedFileToPublish Remove="$(_CefSharpBrowserSubProcessRuntimeConfig)" />
34-
<ResolvedFileToPublish Remove="$(_CefSharpBrowserSubProcessExe)" />
35-
<ResolvedFileToPublish Remove="$(_CefSharpBrowserSubProcessDll)" />
33+
<ResolvedFileToPublish Remove="@(_CefSharpBrowserSubProcessFiles)" />
3634
</ItemGroup>
3735
</Target>
3836

@@ -41,7 +39,7 @@
4139
-->
4240
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeGenerateDependencyFile" BeforeTargets="GenerateBuildDependencyFile;GeneratePublishDependencyFile" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
4341
<ItemGroup>
44-
<NativeCopyLocalItems Remove="$(_CefSharpBrowserSubProcessRuntimeConfig)" />
42+
<NativeCopyLocalItems Remove="@(_CefSharpBrowserSubProcessFiles)" />
4543
</ItemGroup>
4644
</Target>
4745

@@ -65,6 +63,8 @@
6563
<Message Importance="high" Text="SelfContained = $(SelfContained)" />
6664
<Message Importance="high" Text="PublishSingleFile = $(PublishSingleFile)" />
6765
<Message Importance="high" Text="OutDir = $(OutDir)" />
66+
<Message Importance="high" Text="_CefSharpBrowserSubProcessFiles = @(_CefSharpBrowserSubProcessFiles)" />
67+
<Message Importance="high" Text="_TargetFrameworkVersionWithoutV = $(_TargetFrameworkVersionWithoutV)" />
6868
</Target>
6969

7070
<Choose>

0 commit comments

Comments
 (0)