-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
CefSharp.Common.NETCore.targets
228 lines (217 loc) · 12.9 KB
/
CefSharp.Common.NETCore.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Map RuntimeIdentifier e.g. converts from win10-x64 to win-x64 -->
<CefSharpRuntimeIdentifier>$(RuntimeIdentifier)</CefSharpRuntimeIdentifier>
<CefSharpRuntimeIdentifier Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-x86'))">win-x86</CefSharpRuntimeIdentifier>
<CefSharpRuntimeIdentifier Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-x64'))">win-x64</CefSharpRuntimeIdentifier>
<CefSharpRuntimeIdentifier Condition="$(RuntimeIdentifier.StartsWith('win')) and $(RuntimeIdentifier.Contains('-arm64'))">win-arm64</CefSharpRuntimeIdentifier>
<CefSharpRuntimeIdentifier Condition="'$(CefSharpRuntimeIdentifierOverride)' != ''">$(CefSharpRuntimeIdentifierOverride)</CefSharpRuntimeIdentifier>
<!--
For SelfContained and SingleFile under .Net 5+ we don't include a default BrowserSubprocess files
SelfHosting of the BrowserSubprocess is required
Issue https://github.com/cefsharp/CefSharp/issues/3407
-->
<CefSharpExcludeSubProcessExe Condition="'$(CefSharpExcludeSubProcessExe)' == '' AND '$(_TargetFrameworkVersionWithoutV)' >= '5.0' AND '$(PublishSingleFile)' == 'true' AND '$(SelfContained)' == 'true'">true</CefSharpExcludeSubProcessExe>
<!--
For Library projects we don't include our additional files and packages, the transitive reference should flow directly to the consuming projects.
For class libraries that are often AnyCPU and consuming Exe/WinExe projects that are often win-x64 or win-x86 the resuiling build output
is polluted with extra copies in sub folders.
If EnableDynamicLoading = true then CefSharpBuildAction will be Default unless otherwise specified
https://docs.microsoft.com/en-us/dotnet/core/tutorials/creating-app-with-plugin-support#plugin-with-library-dependencies
-->
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(OutputType)' == 'Library' AND '$(EnableDynamicLoading)' != 'true'">NoAction</CefSharpBuildAction>
<!--
Current supported values are Default, Content, and NoAction (this target doesn't copy any files.)
For backwards compatability for the older nuget packages Content will be mapped to Default
-->
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == ''">Default</CefSharpBuildAction>
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == 'Content'">Default</CefSharpBuildAction>
</PropertyGroup>
<ItemGroup>
<_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(CefSharpRuntimeIdentifier)\native\CefSharp.BrowserSubprocess.runtimeconfig.json'))"/>
<_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(CefSharpRuntimeIdentifier)\native\CefSharp.BrowserSubprocess.exe'))" Condition="'$(CefSharpExcludeSubProcessExe)' == 'true'"/>
<_CefSharpBrowserSubProcessFiles Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\runtimes\$(CefSharpRuntimeIdentifier)\native\CefSharp.BrowserSubprocess.dll'))" Condition="'$(CefSharpExcludeSubProcessExe)' == 'true'"/>
</ItemGroup>
<!--
For SelfContained and PublishSingleFile we remove the CefSharp.BrowserSubprocess.runtimeconfig.json file so
the BrowserSubprocess runs using the packaged .net runtime
Issue https://github.com/cefsharp/CefSharp/issues/3407
-->
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(_CefSharpBrowserSubProcessFiles)" />
</ItemGroup>
</Target>
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigAfterComputeFilesToPublish" AfterTargets="ComputeFilesToPublish" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
<ItemGroup>
<ResolvedFileToPublish Remove="@(_CefSharpBrowserSubProcessFiles)" />
</ItemGroup>
</Target>
<!--
For SelfContained and SingleFile under .Net 5+ we don't include a default BrowserSubprocess files
SelfHosting of the BrowserSubprocess is required
Issue https://github.com/cefsharp/CefSharp/issues/3407
-->
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeComputeFilesToBundle" BeforeTargets="_ComputeFilesToBundle" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
<ItemGroup>
<ResolvedFileToPublish Remove="@(_CefSharpBrowserSubProcessFiles)" />
</ItemGroup>
</Target>
<!--
Remove from $(project).deps.json (sometimes the main deps file is reused)
-->
<Target Name="CefSharpExcludeBrowserSubprocessRuntimeConfigBeforeGenerateDependencyFile" BeforeTargets="GenerateBuildDependencyFile;GeneratePublishDependencyFile" Condition="'$(CefSharpRuntimeIdentifier)' != '' AND '$(SelfContained)' == 'true'">
<ItemGroup>
<NativeCopyLocalItems Remove="@(_CefSharpBrowserSubProcessFiles)" />
</ItemGroup>
</Target>
<!--
Add to project file for debuggint purposes
<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
<CallTarget Targets="CefSharpAfterBuildDiagnostic"/>
</Target>
-->
<Target Name="CefSharpAfterBuildDiagnostic">
<Message Importance="high" Text="CefSharp After Build Diagnostic" />
<Message Importance="high" Text="CefSharpBuildAction = $(CefSharpBuildAction)" />
<Message Importance="high" Text="CefSharpExcludeSubProcessExe = $(CefSharpExcludeSubProcessExe)" />
<Message Importance="high" Text="RuntimeIdentifier = $(RuntimeIdentifier)" />
<Message Importance="high" Text="CefSharpRuntimeIdentifier = $(CefSharpRuntimeIdentifier)" />
<Message Importance="high" Text="Platform = $(Platform)" />
<Message Importance="high" Text="PlatformName = $(PlatformName)" />
<Message Importance="high" Text="Platforms = $(Platforms)" />
<Message Importance="high" Text="PlatformTarget = $(PlatformTarget)" />
<Message Importance="high" Text="PlatformTargetAsMSBuildArchitecture = $(PlatformTargetAsMSBuildArchitecture)" />
<Message Importance="high" Text="TargetFramework = $(TargetFramework)" />
<Message Importance="high" Text="TargetFrameworkVersion = $(TargetFrameworkVersion)" />
<Message Importance="high" Text="NuGetProjectStyle = $(NuGetProjectStyle)" />
<Message Importance="high" Text="SelfContained = $(SelfContained)" />
<Message Importance="high" Text="PublishSingleFile = $(PublishSingleFile)" />
<Message Importance="high" Text="OutDir = $(OutDir)" />
<Message Importance="high" Text="_CefSharpBrowserSubProcessFiles = @(_CefSharpBrowserSubProcessFiles)" />
<Message Importance="high" Text="IncludeAllContentForSelfExtract = $(IncludeAllContentForSelfExtract)" />
<Message Importance="high" Text="IncludeNativeLibrariesForSelfExtract = $(IncludeNativeLibrariesForSelfExtract)" />
</Target>
<Choose>
<When Condition="'$(CefSharpBuildAction)' == 'NoAction'">
<!-- Do nothing -->
</When>
<When Condition="'$(CefSharpRuntimeIdentifier)' == 'win-x64'">
<ItemGroup>
<Content Include="@(CefRuntimeWin64Locales)">
<Link>locales\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
</ItemGroup>
</When>
<When Condition="'$(CefSharpRuntimeIdentifier)' == 'win-x86'">
<ItemGroup>
<Content Include="@(CefRuntimeWin32Locales)">
<Link>locales\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
</ItemGroup>
</When>
<When Condition="'$(CefSharpRuntimeIdentifier)' == 'win-arm64'">
<ItemGroup>
<Content Include="@(CefRuntimeWinArm64Locales)">
<Link>locales\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
</ItemGroup>
</When>
<Otherwise>
<Choose>
<When Condition="'$(ManagePackageVersionsCentrally)' == 'true'">
<ItemGroup>
<PackageReference Include="chromiumembeddedframework.runtime.win-x64" VersionOverride="131.3.1" />
<PackageReference Include="chromiumembeddedframework.runtime.win-x86" VersionOverride="131.3.1" />
<PackageReference Include="chromiumembeddedframework.runtime.win-arm64" VersionOverride="131.3.1" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="chromiumembeddedframework.runtime.win-x64" Version="131.3.1" />
<PackageReference Include="chromiumembeddedframework.runtime.win-x86" Version="131.3.1" />
<PackageReference Include="chromiumembeddedframework.runtime.win-arm64" Version="131.3.1" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Content Include="@(CefRuntimeWin32Locales)">
<Link>runtimes\win-x86\native\locales\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="$(MSBuildThisFileDirectory)..\runtimes\win-x86\lib\netcoreapp3.1\CefSharp.dll">
<Link>runtimes\win-x86\native\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="$(MSBuildThisFileDirectory)..\runtimes\win-x86\lib\netcoreapp3.1\Ijwhost.dll">
<Link>runtimes\win-x86\native\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="@(CefRuntimeWin64Locales)">
<Link>runtimes\win-x64\native\locales\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="$(MSBuildThisFileDirectory)..\runtimes\win-x64\lib\netcoreapp3.1\CefSharp.dll">
<Link>runtimes\win-x64\native\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="$(MSBuildThisFileDirectory)..\runtimes\win-x64\lib\netcoreapp3.1\Ijwhost.dll">
<Link>runtimes\win-x64\native\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="@(CefRuntimeWinArm64Locales)">
<Link>runtimes\win-arm64\native\locales\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="$(MSBuildThisFileDirectory)..\runtimes\win-arm64\lib\netcoreapp3.1\CefSharp.dll">
<Link>runtimes\win-arm64\native\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
<Content Include="$(MSBuildThisFileDirectory)..\runtimes\win-arm64\lib\netcoreapp3.1\Ijwhost.dll">
<Link>runtimes\win-arm64\native\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
<IncludeInVsix>true</IncludeInVsix>
</Content>
</ItemGroup>
</Otherwise>
</Choose>
</Project>