Skip to content

Commit

Permalink
Nuget - Remove netcoreapp3.0 hacks
Browse files Browse the repository at this point in the history
To continue using these packages you can specify AssetTargetFallback
https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#assettargetfallback

Resolves #3444
  • Loading branch information
amaitland committed Mar 12, 2021
1 parent 38dc00d commit 005f5c8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 63 deletions.
26 changes: 0 additions & 26 deletions NuGet/CefSharp.Common.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,6 @@
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.xml" target="lib\net452"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.pdb" target="lib\net452"/>

<!-- Net Core Libs -->
<!-- These are actually our net452 libs, we just put them in the netcoreapp3 folder for better support -->
<file src="..\CefSharp\bin\Release\CefSharp.dll" target="ref\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.dll" target="ref\netcoreapp3.0"/>

<file src="..\CefSharp\bin\Release\CefSharp.dll" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp\bin\Release\CefSharp.xml" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp\bin\Release\CefSharp.pdb" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.dll" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.xml" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.pdb" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core.Runtime\bin\Win32\Release\CefSharp.Core.Runtime.dll" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core.Runtime\bin\Win32\Release\CefSharp.Core.Runtime.xml" target="runtimes\win-x86\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core.Runtime\bin\Win32\Release\CefSharp.Core.Runtime.pdb" target="runtimes\win-x86\lib\netcoreapp3.0"/>

<file src="..\CefSharp\bin\Release\CefSharp.dll" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp\bin\Release\CefSharp.xml" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp\bin\Release\CefSharp.pdb" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.dll" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.xml" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core\bin\Release\CefSharp.Core.pdb" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core.Runtime\bin\x64\Release\CefSharp.Core.Runtime.dll" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core.Runtime\bin\x64\Release\CefSharp.Core.Runtime.xml" target="runtimes\win-x64\lib\netcoreapp3.0"/>
<file src="..\CefSharp.Core.Runtime\bin\x64\Release\CefSharp.Core.Runtime.pdb" target="runtimes\win-x64\lib\netcoreapp3.0"/>


<!-- Cannot put these inside lib\net452 etc, since there are both x86 and x64 versions which we must distinguish between. We
solve this using a .targets file instead to copy them based on PlatformTarget -->

Expand Down
32 changes: 4 additions & 28 deletions NuGet/CefSharp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
We manually remove CefSharp.Core.Runtime.dll from ReferenceCopyLocalPaths
https://thomasfreudenberg.com/archive/2012/11/21/dont-copy-my-referenced-assemblies/
-->
<Target Name="CefSharpExcludeCoreRuntimeAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="('$(CefSharpPlatformTarget)' == 'AnyCPU' OR '$(CefSharpTargetDir)' != '') AND $(TargetFrameworkVersion.StartsWith('v4.'))">
<Target Name="CefSharpExcludeCoreRuntimeAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="('$(CefSharpPlatformTarget)' == 'AnyCPU' OR '$(CefSharpTargetDir)' != '')">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" />
<ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" />
Expand All @@ -18,7 +18,7 @@
For VS2017 when publishing x86/x64 there's CefSharp.Core.Runtime.dll references in both _DeploymentManifestDependencies and _DeploymentManifestFiles
This causes an Error occurred writing to hard disk exception, so we remove one (we leave the dependency and just remove the file reference).
-->
<Target Name="CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' != 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))">
<Target Name="CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' != 'AnyCPU'">
<ItemGroup>
<_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.dll" />
<_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.pdb" />
Expand All @@ -30,7 +30,7 @@
For AnyCPU ClickOnce Publish Remove CefSharp.Core.Runtime.dll for being included in the bin folder
TODO: Publish AnyCPU still not working, requires some tweaking as CefSharp.dll file isn't being copied to the x64 folder.
-->
<Target Name="CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))">
<Target Name="CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU'">
<ItemGroup>
<_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" />
<_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" />
Expand Down Expand Up @@ -117,36 +117,12 @@
</PropertyGroup>

<Choose>
<!--
For .Net Core/Net5 when there's no runtime identifier specified then our lib files will be in the runtimes folders
we copy our unmanaged resources into the sub folder when required
-->
<When Condition="'$(RuntimeIdentifier)' == '' AND ($(TargetFramework.StartsWith('netcoreapp3')) OR $(TargetFramework.StartsWith('net5')))">
<Choose>
<When Condition="'$(CefSharpPlatformTarget)' == 'x64'">
<PropertyGroup>
<CefSharpTargetDir>runtimes\win-x64\lib\netcoreapp3.0\</CefSharpTargetDir>
</PropertyGroup>
</When>
<When Condition="'$(CefSharpPlatformTarget)' == 'x86'">
<PropertyGroup>
<CefSharpTargetDir>runtimes\win-x86\lib\netcoreapp3.0\</CefSharpTargetDir>
</PropertyGroup>
</When>
<When Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU'">
<PropertyGroup>
<CefSharpTargetDirAnyCpu32>runtimes\win-x86\lib\netcoreapp3.0\</CefSharpTargetDirAnyCpu32>
<CefSharpTargetDirAnyCpu64>runtimes\win-x64\lib\netcoreapp3.0\</CefSharpTargetDirAnyCpu64>
</PropertyGroup>
</When>
</Choose>
</When>
<!--
When CefSharpTargetDir is specified for x86/x64 platforms the files are included in a sub directory,
The CefSharp.dll file required by the BrowserSubProcess isn't copied by default and won't start, so we include an extra
copy.
-->
<When Condition="'$(CefSharpTargetDir)' != '' AND $(TargetFrameworkVersion.StartsWith('v4.')) AND '$(CefSharpPlatformTarget)' != 'AnyCPU'">
<When Condition="'$(CefSharpTargetDir)' != '' AND '$(CefSharpPlatformTarget)' != 'AnyCPU'">
<Choose>
<When Condition="'$(CefSharpBuildAction)' == 'None'">
<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions NuGet/CefSharp.OffScreen.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<group targetFramework=".NETFramework4.5.2">
<dependency id="CefSharp.Common" version="[$version$]" />
</group>
<group targetFramework=".NETCoreApp3.0">
<dependency id="CefSharp.Common" version="[$version$]" />
</group>
</dependencies>
<releaseNotes>
<![CDATA[
Expand Down
3 changes: 0 additions & 3 deletions NuGet/CefSharp.WinForms.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<group targetFramework=".NETFramework4.5.2">
<dependency id="CefSharp.Common" version="[$version$]" />
</group>
<group targetFramework=".NETCoreApp3.0">
<dependency id="CefSharp.Common" version="[$version$]" />
</group>
</dependencies>
<releaseNotes>
<![CDATA[
Expand Down
3 changes: 0 additions & 3 deletions NuGet/CefSharp.Wpf.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<group targetFramework=".NETFramework4.5.2">
<dependency id="CefSharp.Common" version="[$version$]" />
</group>
<group targetFramework=".NETCoreApp3.0">
<dependency id="CefSharp.Common" version="[$version$]" />
</group>
</dependencies>
<releaseNotes>
<![CDATA[
Expand Down

0 comments on commit 005f5c8

Please sign in to comment.