|
126 | 126 | <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(Prefer32Bit)' == 'true' AND '$(CefSharpAnyCpuSupport)' == ''">x86</CefSharpPlatformTarget> |
127 | 127 | <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTargetOverride)' != ''">$(CefSharpPlatformTargetOverride)</CefSharpPlatformTarget> |
128 | 128 |
|
129 | | - <!-- |
130 | | - For PackageReference library projects where buildTransitive is supported we'll default to setting CefSharpAnyCpuSupport to true |
131 | | - This should only require WinExe and Exe projects to specify CefSharpAnyCpuSupport rather than every project in a solution. |
132 | | - Only for PackageReference projects where NuGetToolVersion > 5.0 and OutputType is library. |
133 | | - Defaulting CefSharpAnyCpuSupport to true is simpler than modifying the already complex Condition for the CefSharpPlatformCheck |
134 | | - target below. |
135 | | - https://github.com/cefsharp/CefSharp/issues/3622 |
136 | | - --> |
137 | | - <CefSharpAnyCpuSupport Condition="'$(CefSharpAnyCpuSupport)' != 'true' AND '$(NuGetProjectStyle)' == 'PackageReference' AND $(NuGetToolVersion) > '5.0' AND '$(OutputType)' == 'Library'">true</CefSharpAnyCpuSupport> |
| 129 | + <!-- |
| 130 | + For PackageReference library projects where buildTransitive is supported we'll default to setting CefSharpAnyCpuSupport to true |
| 131 | + This should only require WinExe and Exe projects to specify CefSharpAnyCpuSupport rather than every project in a solution. |
| 132 | + Only for PackageReference projects where NuGetToolVersion > 5.0 and OutputType is library. |
| 133 | + Defaulting CefSharpAnyCpuSupport to true is simpler than modifying the already complex Condition for the CefSharpPlatformCheck |
| 134 | + target below. |
| 135 | + https://github.com/cefsharp/CefSharp/issues/3622 |
| 136 | + --> |
| 137 | + <CefSharpAnyCpuSupport Condition="'$(CefSharpAnyCpuSupport)' != 'true' AND '$(NuGetProjectStyle)' == 'PackageReference' AND $(NuGetToolVersion) > '5.0' AND '$(OutputType)' == 'Library'">true</CefSharpAnyCpuSupport> |
138 | 138 | </PropertyGroup> |
139 | 139 |
|
140 | 140 | <Choose> |
|
376 | 376 | <!-- |
377 | 377 | Issue https://github.com/dotnet/project-system/issues/4158 |
378 | 378 | The None/Content entries aren't picked up as the .targets file doesn't exist before the Nuget restore (only when using packages.config) |
379 | | - So in that scenario we display a message to the user. Close/reopen the project and the None/Content entries will work as above. |
380 | | - I have attempted to copy the files via a Copy Task, unfortunately the .props entries aren't accessible either so that's not feasible. |
| 379 | + As a workaround we manually copy the files using a series of Targets and private itemgroup/propertygroups. |
| 380 | + Accessing the ItemGroups that exist in the .props files isn't possible, the Targets are handled differently by msbuild/VS2017/VS2019 (worked previous in VS2015) |
| 381 | + so we duplicate the entries private to these tasks. Must be kept in sync with the .props files |
381 | 382 | --> |
382 | 383 | <Target Name="CefSharpCopyFilesAfterNugetRestore32" AfterTargets="Build" Condition="'$(NuGetProjectStyle)' != 'PackageReference' AND !Exists('$(TargetDir)$(CefSharpTargetDir)libcef.dll') AND '$(CefSharpBuildAction)' != 'NoAction' AND '$(CefSharpPlatformTarget)' == 'x86'"> |
383 | 384 | <PropertyGroup> |
384 | 385 | <CefRedist32TargetDir Condition="'$(CefRedist32TargetDir)' == ''">$(TargetDir)$(CefSharpTargetDir)</CefRedist32TargetDir> |
385 | 386 | </PropertyGroup> |
386 | | - <Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Manually copying files to $(CefRedist32TargetDir) as workaround. Please close and re-open $(MSBuildProjectFile)." /> |
387 | | - <CallTarget Targets="CefRedist32CopyResources"/> |
| 387 | + <ItemGroup> |
| 388 | + <_CefSharpCommonManagedDll Include="$(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll" /> |
| 389 | + <_CefSharpCommonBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" /> |
| 390 | + </ItemGroup> |
| 391 | + <Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Manually copying files to $(CefRedist32TargetDir) as workaround. Please close and re-open $(MSBuildProjectFile)." /> |
| 392 | + <CallTarget Targets="CefRedist32CopyResources"/> |
| 393 | + |
| 394 | + <Message Importance="high" Text="Copying CefSharp Common x86 files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefRedist32TargetDir)" /> |
| 395 | + <Copy SourceFiles="@(_CefSharpCommonBinaries32)" DestinationFiles="@(_CefSharpCommonBinaries32->'$(CefRedist32TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
| 396 | + |
| 397 | + <Message Importance="high" Text="Copying CefSharp.dll from $(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll to $(CefRedist32TargetDir)" /> |
| 398 | + <Copy SourceFiles="@(_CefSharpCommonManagedDll)" DestinationFiles="@(_CefSharpCommonManagedDll->'$(CefRedist32TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
388 | 399 | </Target> |
389 | 400 |
|
390 | 401 | <Target Name="CefSharpCopyFilesAfterNugetRestore64" AfterTargets="Build" Condition="'$(NuGetProjectStyle)' != 'PackageReference' AND !Exists('$(TargetDir)$(CefSharpTargetDir)libcef.dll') AND '$(CefSharpBuildAction)' != 'NoAction' AND '$(CefSharpPlatformTarget)' == 'x64'"> |
391 | 402 | <PropertyGroup> |
392 | 403 | <CefRedist64TargetDir Condition="'$(CefRedist64TargetDir)' == ''">$(TargetDir)$(CefSharpTargetDir)</CefRedist64TargetDir> |
393 | 404 | </PropertyGroup> |
394 | | - <Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Manually copying files to $(CefRedist64TargetDir) as workaround. Please close and re-open $(MSBuildProjectFile)." /> |
395 | | - <CallTarget Targets="CefRedist64CopyResources"/> |
| 405 | + <ItemGroup> |
| 406 | + <_CefSharpCommonManagedDll Include="$(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll" /> |
| 407 | + <_CefSharpCommonBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" /> |
| 408 | + </ItemGroup> |
| 409 | + |
| 410 | + <Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Manually copying files to $(CefRedist64TargetDir) as workaround. Please close and re-open $(MSBuildProjectFile)." /> |
| 411 | + <CallTarget Targets="CefRedist64CopyResources"/> |
| 412 | + |
| 413 | + <Message Importance="high" Text="Copying CefSharp Common x64 files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefRedist64TargetDir)" /> |
| 414 | + <Copy SourceFiles="@(_CefSharpCommonBinaries64)" DestinationFiles="@(_CefSharpCommonBinaries64->'$(CefRedist64TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
| 415 | + |
| 416 | + <Message Importance="high" Text="Copying CefSharp.dll from $(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll to $(CefRedist64TargetDir)" /> |
| 417 | + <Copy SourceFiles="@(_CefSharpCommonManagedDll)" DestinationFiles="@(_CefSharpCommonManagedDll->'$(CefRedist64TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
396 | 418 | </Target> |
397 | 419 |
|
398 | 420 | <Target Name="CefSharpCopyFilesAfterNugetRestoreAnyCPU" AfterTargets="Build" Condition="'$(NuGetProjectStyle)' != 'PackageReference' AND !Exists('$(TargetDir)$(CefSharpTargetDirAnyCpu32)libcef.dll') AND '$(CefSharpBuildAction)' != 'NoAction' AND '$(CefSharpPlatformTarget)' == 'AnyCPU'"> |
399 | 421 | <PropertyGroup> |
400 | 422 | <CefRedist32TargetDir Condition="'$(CefRedist32TargetDir)' == ''">$(TargetDir)$(CefSharpTargetDirAnyCpu32)</CefRedist32TargetDir> |
401 | | - <CefRedist64TargetDir Condition="'$(CefRedist64TargetDir)' == ''">$(TargetDir)$(CefSharpTargetDirAnyCpu64)</CefRedist64TargetDir> |
| 423 | + <CefRedist64TargetDir Condition="'$(CefRedist64TargetDir)' == ''">$(TargetDir)$(CefSharpTargetDirAnyCpu64)</CefRedist64TargetDir> |
402 | 424 | </PropertyGroup> |
403 | | - <Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Manually copying files to output folder as workaround. Please close and re-open $(MSBuildProjectFile)." /> |
404 | | - <CallTarget Targets="CefRedist32CopyResources"/> |
405 | | - <CallTarget Targets="CefRedist64CopyResources"/> |
| 425 | + <ItemGroup> |
| 426 | + <_CefSharpCommonManagedDll Include="$(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll" /> |
| 427 | + <_CefSharpCommonBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" /> |
| 428 | + <_CefSharpCommonBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" /> |
| 429 | + </ItemGroup> |
| 430 | + <Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Manually copying files to output folder as workaround. Please close and re-open $(MSBuildProjectFile)." /> |
| 431 | + <CallTarget Targets="CefRedist32CopyResources"/> |
| 432 | + <CallTarget Targets="CefRedist64CopyResources"/> |
| 433 | + |
| 434 | + <Message Importance="high" Text="Copying CefSharp Common x86 files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefRedist32TargetDir)" /> |
| 435 | + <Copy SourceFiles="@(_CefSharpCommonBinaries32)" DestinationFiles="@(_CefSharpCommonBinaries32->'$(CefRedist32TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
| 436 | + |
| 437 | + <Message Importance="high" Text="Copying CefSharp Common x64 files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefRedist64TargetDir)" /> |
| 438 | + <Copy SourceFiles="@(_CefSharpCommonBinaries64)" DestinationFiles="@(_CefSharpCommonBinaries64->'$(CefRedist64TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
| 439 | + |
| 440 | + <Message Importance="high" Text="Copying CefSharp.dll from $(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll to $(CefRedist32TargetDir)" /> |
| 441 | + <Copy SourceFiles="@(_CefSharpCommonManagedDll)" DestinationFiles="@(_CefSharpCommonManagedDll->'$(CefRedist32TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
| 442 | + |
| 443 | + <Message Importance="high" Text="Copying CefSharp.dll from $(MSBuildThisFileDirectory)..\lib\net452\CefSharp.dll to $(CefRedist64TargetDir)" /> |
| 444 | + <Copy SourceFiles="@(_CefSharpCommonManagedDll)" DestinationFiles="@(_CefSharpCommonManagedDll->'$(CefRedist64TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> |
406 | 445 | </Target> |
407 | 446 |
|
408 | 447 | <!-- |
|
0 commit comments