|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | 3 | <PropertyGroup> |
4 | | - <!-- Current supported values are Default, and NoAction (this target doesn't copy any files.) --> |
| 4 | + <!-- Map RuntimeIdentifier e.g. converts from win10-x64 to win-x64 --> |
| 5 | + <CefSharpRuntimeIdentifier>$(RuntimeIdentifier)</CefSharpRuntimeIdentifier> |
| 6 | + <CefSharpRuntimeIdentifier Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-x86'))">win-x86</CefSharpRuntimeIdentifier> |
| 7 | + <CefSharpRuntimeIdentifier Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-x64'))">win-x64</CefSharpRuntimeIdentifier> |
| 8 | + <CefSharpRuntimeIdentifier Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-arm64'))">win-arm64</CefSharpRuntimeIdentifier> |
| 9 | + <CefSharpRuntimeIdentifier Condition="'$(CefSharpRuntimeIdentifierOverride)' != ''">$(CefSharpRuntimeIdentifierOverride)</CefSharpRuntimeIdentifier> |
| 10 | + |
| 11 | + <!-- Current supported values are Default, and NoAction (this target doesn't copy any files.) --> |
5 | 12 | <CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == ''">Default</CefSharpBuildAction> |
6 | 13 | <!-- |
7 | 14 | For Library projects with no RuntimeIdentifier we don't include our additional files and packages, the transitive reference should flow directly to the consuming projects. |
8 | 15 | For class libraries that are often AnyCPU and consuming Exe/WinExe projects that are often win-x64 or win-x86 the resuiling build output |
9 | 16 | is polluted with extra copies in sub folders. |
10 | 17 | --> |
11 | | - <CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(OutputType)' == 'Library' AND '$(RuntimeIdentifier)' == ''">NoAction</CefSharpBuildAction> |
| 18 | + <CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(OutputType)' == 'Library' AND '$(CefSharpRuntimeIdentifier)' == ''">NoAction</CefSharpBuildAction> |
12 | 19 | </PropertyGroup> |
13 | 20 | <ItemGroup> |
14 | | - <_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.runtimeconfig.json'))"/> |
15 | | - <_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.exe'))" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'"/> |
16 | | - <_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(RuntimeIdentifier)\native\CefSharp.BrowserSubprocess.dll'))" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'"/> |
| 21 | + <_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(CefSharpRuntimeIdentifier)\native\CefSharp.BrowserSubprocess.runtimeconfig.json'))"/> |
| 22 | + <_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(CefSharpRuntimeIdentifier)\native\CefSharp.BrowserSubprocess.exe'))" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'"/> |
| 23 | + <_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(CefSharpRuntimeIdentifier)\native\CefSharp.BrowserSubprocess.dll'))" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'"/> |
17 | 24 | </ItemGroup> |
18 | 25 |
|
19 | 26 | <!-- |
20 | 27 | For SelfContained and PublishSingleFile we remove the CefSharp.BrowserSubprocess.runtimeconfig.json file so |
21 | 28 | the BrowserSubprocess runs using the packaged .net runtime |
22 | 29 | Issue https://github.com/cefsharp/CefSharp/issues/3407 |
23 | 30 | --> |
24 | | - <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
| 31 | + <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
25 | 32 | <ItemGroup> |
26 | 33 | <ReferenceCopyLocalPaths Remove="@(_CefSharpBrowserSubProcessFiles)" /> |
27 | 34 | </ItemGroup> |
28 | 35 | </Target> |
29 | 36 |
|
30 | | - <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterComputeFilesToPublish" AfterTargets="ComputeFilesToPublish" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
| 37 | + <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterComputeFilesToPublish" AfterTargets="ComputeFilesToPublish" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
31 | 38 | <ItemGroup> |
32 | 39 | <ResolvedFileToPublish Remove="@(_CefSharpBrowserSubProcessFiles)" /> |
33 | 40 | </ItemGroup> |
|
38 | 45 | SelfHosting of the BrowserSubprocess is required |
39 | 46 | Issue https://github.com/cefsharp/CefSharp/issues/3407 |
40 | 47 | --> |
41 | | - <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeComputeFilesToBundle" BeforeTargets="_ComputeFilesToBundle" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
| 48 | + <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeComputeFilesToBundle" BeforeTargets="_ComputeFilesToBundle" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
42 | 49 | <ItemGroup> |
43 | 50 | <ResolvedFileToPublish Remove="@(_CefSharpBrowserSubProcessFiles)" /> |
44 | 51 | </ItemGroup> |
|
47 | 54 | <!-- |
48 | 55 | Remove from $(project).deps.json (sometimes the main deps file is reused) |
49 | 56 | --> |
50 | | - <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeGenerateDependencyFile" BeforeTargets="GenerateBuildDependencyFile;GeneratePublishDependencyFile" Condition="'$(RuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
| 57 | + <Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeGenerateDependencyFile" BeforeTargets="GenerateBuildDependencyFile;GeneratePublishDependencyFile" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'"> |
51 | 58 | <ItemGroup> |
52 | 59 | <NativeCopyLocalItems Remove="@(_CefSharpBrowserSubProcessFiles)" /> |
53 | 60 | </ItemGroup> |
|
63 | 70 | <Message Importance="high" Text="CefSharp After Build Diagnostic" /> |
64 | 71 | <Message Importance="high" Text="CefSharpBuildAction = $(CefSharpBuildAction)" /> |
65 | 72 | <Message Importance="high" Text="RuntimeIdentifier = $(RuntimeIdentifier)" /> |
| 73 | + <Message Importance="high" Text="CefSharpRuntimeIdentifier = $(CefSharpRuntimeIdentifier)" /> |
66 | 74 | <Message Importance="high" Text="Platform = $(Platform)" /> |
67 | 75 | <Message Importance="high" Text="PlatformName = $(PlatformName)" /> |
68 | 76 | <Message Importance="high" Text="Platforms = $(Platforms)" /> |
|
83 | 91 | <When Condition="'$(CefSharpBuildAction)' == 'NoAction'"> |
84 | 92 | <!-- Do nothing --> |
85 | 93 | </When> |
86 | | - <When Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-x64'))"> |
| 94 | + <When Condition="'$(CefSharpRuntimeIdentifier)' == 'win-x64'"> |
87 | 95 | <ItemGroup> |
88 | 96 | <Content Include="@(CefRuntimeWin64Locales)"> |
89 | 97 | <Link>locales\%(RecursiveDir)%(FileName)%(Extension)</Link> |
|
101 | 109 | </Content> |
102 | 110 | </ItemGroup> |
103 | 111 | </When> |
104 | | - <When Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-x86'))"> |
| 112 | + <When Condition="'$(CefSharpRuntimeIdentifier)' == 'win-x86'"> |
105 | 113 | <ItemGroup> |
106 | 114 | <Content Include="@(CefRuntimeWin32Locales)"> |
107 | 115 | <Link>locales\%(RecursiveDir)%(FileName)%(Extension)</Link> |
|
119 | 127 | </Content> |
120 | 128 | </ItemGroup> |
121 | 129 | </When> |
122 | | - <When Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-arm64'))"> |
| 130 | + <When Condition="'$(CefSharpRuntimeIdentifier)' == 'win-arm64'"> |
123 | 131 | <ItemGroup> |
124 | 132 | <Content Include="@(CefRuntimeWinArm64Locales)"> |
125 | 133 | <Link>locales\%(RecursiveDir)%(FileName)%(Extension)</Link> |
|
0 commit comments