Skip to content

Commit

Permalink
Net Core - Ensure project build order and copy browsersubprocess files.
Browse files Browse the repository at this point in the history
- Add new CefSharp.AfterBuild.targets to copy the cefsharp redist files and
- BrowserSubPorcess is now a build dependency of the Example projects
  • Loading branch information
amaitland committed Jul 24, 2020
1 parent 857cfce commit 4505fdf
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
28 changes: 28 additions & 0 deletions CefSharp.AfterBuild.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
Used the the NetCore projects
The file is split from the CefSharp.Native.props file which is used by the NetFull
projects as it's likely a new set of packages for distributing the CEF files will
be used.
-->
<Target Name="CefSharpCopyBrowserSubprocess" AfterTargets="AfterBuild">
<ItemGroup>
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
<SubProcessFiles Include="$(SolutionDir)CefSharp.BrowserSubprocess\bin.netcore\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.*" />
</ItemGroup>
<Message Importance="high" Text="Copying $(SolutionDir)CefSharp.BrowserSubprocess\bin.netcore\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.* to $(TargetDir)" />
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(TargetDir)" />
</Target>

<Target Name="CefSharpCopyLibs86" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'x86'">
<Message Importance="high" Text="Copying cef.redist x86 files to $(TargetDir)" />
<Copy SourceFiles="@(CefRedist32)" DestinationFiles="@(CefRedist32->'$(TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
</Target>

<Target Name="CefSharpCopyLibs64" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'x64'">
<Message Importance="high" Text="Copying cef.redist x64 files to $(TargetDir)" />
<Copy SourceFiles="@(CefRedist64)" DestinationFiles="@(CefRedist64->'$(TargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
</Target>
</Project>
18 changes: 0 additions & 18 deletions CefSharp.Example/CefSharp.Example.netcore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,6 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<!-- Copy the CEF redist files. -->
<ItemGroup Condition="'$(PlatformTarget)' == 'x86'">
<Content Include="@(CefRedist32)">
<Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<PublishState>Included</PublishState>
</Content>
</ItemGroup>
<ItemGroup Condition="'$(PlatformTarget)' == 'x64'">
<Content Include="@(CefRedist64)">
<Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<PublishState>Included</PublishState>
</Content>
</ItemGroup>

<ItemGroup>
<!-- Don't include items from the "bin" and "obj" folders used by the .NET Framework projects. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
<Compile Remove="obj/**/*.*" />
</ItemGroup>

<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
<Compile Remove="obj/**/*.*" />
</ItemGroup>

<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
</Project>
2 changes: 1 addition & 1 deletion CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
<Compile Remove="obj/**/*.*" />
</ItemGroup>

<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
</Project>
14 changes: 13 additions & 1 deletion CefSharp3.netcore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
appveyor.yml = appveyor.yml
CefSharp.Native.props = CefSharp.Native.props
CefSharp.AfterBuild.targets = CefSharp.AfterBuild.targets
CefSharp.props = CefSharp.props
CONTRIBUTING.md = CONTRIBUTING.md
ISSUE_TEMPLATE.md = ISSUE_TEMPLATE.md
Expand All @@ -44,12 +44,24 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.Example.netcore", "CefSharp.Example\CefSharp.Example.netcore.csproj", "{89540209-0C6D-4387-BE8A-7593B8D7784A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.WinForms.Example.netcore", "CefSharp.WinForms.Example\CefSharp.WinForms.Example.netcore.csproj", "{64E47346-0BB1-4DF7-B135-12D70E1F2F32}"
ProjectSection(ProjectDependencies) = postProject
{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C} = {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}
{FBFBD752-467C-444F-93E4-80D6242E8513} = {FBFBD752-467C-444F-93E4-80D6242E8513}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.BrowserSubprocess.netcore", "CefSharp.BrowserSubprocess\CefSharp.BrowserSubprocess.netcore.csproj", "{FBFBD752-467C-444F-93E4-80D6242E8513}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.Wpf.Example.netcore", "CefSharp.Wpf.Example\CefSharp.Wpf.Example.netcore.csproj", "{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}"
ProjectSection(ProjectDependencies) = postProject
{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C} = {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}
{FBFBD752-467C-444F-93E4-80D6242E8513} = {FBFBD752-467C-444F-93E4-80D6242E8513}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.OffScreen.Example.netcore", "CefSharp.OffScreen.Example\CefSharp.OffScreen.Example.netcore.csproj", "{A430C9D4-0952-44A2-989A-23C476B7A1F0}"
ProjectSection(ProjectDependencies) = postProject
{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C} = {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}
{FBFBD752-467C-444F-93E4-80D6242E8513} = {FBFBD752-467C-444F-93E4-80D6242E8513}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit 4505fdf

Please sign in to comment.