Skip to content

Commit

Permalink
PR feedback: Switch the CefSharp.*.Example.netcore and CefSharp.Test.…
Browse files Browse the repository at this point in the history
…netcore projects from cef.redist to chromiumembeddedframework.runtime.

Note: These projects are excluded for build when platform is 'arm64', as otherwise the build fails as WinForms and WPF are not yet available for ARM64 in .NET 5.0.
  • Loading branch information
kpreisser committed Jan 21, 2021
1 parent 74e9f78 commit 5787ca6
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 25 deletions.
7 changes: 4 additions & 3 deletions CefSharp.Example/CefExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser

if (DebuggingSubProcess)
{
var architecture = Environment.Is64BitProcess ? "x64" : "x86";
#if NETCOREAPP
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe");
var architecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe");
#else
var architecture = Environment.Is64BitProcess ? "x64" : "x86";
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe");
#endif
}
Expand Down Expand Up @@ -210,7 +211,7 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser
#if !NETCOREAPP
@"..\..\..\..\CefSharp.Example\Resources";
#else
@"..\..\..\..\..\CefSharp.Example\Resources";
@"..\..\..\..\..\..\CefSharp.Example\Resources";
#endif

settings.RegisterScheme(new CefCustomScheme
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Example/Handlers/BrowserProcessHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void IBrowserProcessHandler.OnContextInitialized()
#if !NETCOREAPP
@"..\..\..\..\CefSharp.Example\Resources";
#else
@"..\..\..\..\..\CefSharp.Example\Resources";
@"..\..\..\..\..\..\CefSharp.Example\Resources";
#endif
var folderSchemeHandlerExample = new FolderSchemeHandlerFactory(rootFolder: cefSharpExampleResourcesFolder,
hostName: "cefsharp.example", //Optional param no hostname checking if null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@
https://github.com/dotnet/docs/issues/12237
-->
<RollForward>Major</RollForward>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
<ProjectReference Include="..\CefSharp.OffScreen\CefSharp.OffScreen.netcore.csproj" />
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 7 additions & 4 deletions CefSharp.Test/CefSharp.Test.netcore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<Platforms>x86;x64;arm64</Platforms>
<!-- Explicitly set the PlatformTarget for arm64, see: https://github.com/dotnet/sdk/issues/15434 -->
<PlatformTarget Condition="'$(Platform)' == 'arm64'">arm64</PlatformTarget>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand All @@ -28,10 +33,8 @@
<ProjectReference Include="..\CefSharp.OffScreen\CefSharp.OffScreen.netcore.csproj" />
<ProjectReference Include="..\CefSharp.WinForms\CefSharp.WinForms.netcore.csproj" />
<ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" />
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions CefSharp.WinForms.Example/BrowserForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public BrowserForm(bool multiThreadedMessageLoopEnabled)
{
InitializeComponent();

#if NETCOREAPP
var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
#else
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
#endif
Text = "CefSharp.WinForms.Example - " + bitness;
WindowState = FormWindowState.Maximized;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@
https://github.com/dotnet/docs/issues/12237
-->
<RollForward>Major</RollForward>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
<ProjectReference Include="..\CefSharp.WinForms\CefSharp.WinForms.netcore.csproj" />
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ public SimpleBrowserForm(bool multiThreadedMessageLoop, IFocusHandler customFocu
Text = "CefSharp";
WindowState = FormWindowState.Maximized;

#if NETCOREAPP
var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
#else
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
#endif
var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness);
DisplayOutput(version);

Expand Down
9 changes: 6 additions & 3 deletions CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@
https://github.com/dotnet/docs/issues/12237
-->
<RollForward>Major</RollForward>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
<ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" />
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions CefSharp.Wpf.Example/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ public MainWindow()

Loaded += MainWindowLoaded;

#if NETCOREAPP
var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
#else
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
#endif
Title += " - " + bitness;
}

Expand Down
8 changes: 0 additions & 8 deletions CefSharp3.netcore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,11 @@ Global
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.ActiveCfg = Release|Any CPU
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.Build.0 = Release|Any CPU
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|arm64.ActiveCfg = Debug|arm64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|arm64.Build.0 = Debug|arm64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x64.ActiveCfg = Debug|x64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x64.Build.0 = Debug|x64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x86.ActiveCfg = Debug|x86
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x86.Build.0 = Debug|x86
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|arm64.ActiveCfg = Release|arm64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|arm64.Build.0 = Release|arm64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x64.ActiveCfg = Release|x64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x64.Build.0 = Release|x64
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x86.ActiveCfg = Release|x86
Expand All @@ -192,37 +190,31 @@ Global
{FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x86.ActiveCfg = Release|x86
{FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x86.Build.0 = Release|x86
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|arm64.ActiveCfg = Debug|arm64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|arm64.Build.0 = Debug|arm64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x64.ActiveCfg = Debug|x64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x64.Build.0 = Debug|x64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x86.ActiveCfg = Debug|x86
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x86.Build.0 = Debug|x86
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|arm64.ActiveCfg = Release|arm64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|arm64.Build.0 = Release|arm64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x64.ActiveCfg = Release|x64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x64.Build.0 = Release|x64
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x86.ActiveCfg = Release|x86
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x86.Build.0 = Release|x86
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|arm64.ActiveCfg = Debug|arm64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|arm64.Build.0 = Debug|arm64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x64.ActiveCfg = Debug|x64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x64.Build.0 = Debug|x64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x86.ActiveCfg = Debug|x86
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x86.Build.0 = Debug|x86
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|arm64.ActiveCfg = Release|arm64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|arm64.Build.0 = Release|arm64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x64.ActiveCfg = Release|x64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x64.Build.0 = Release|x64
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x86.ActiveCfg = Release|x86
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x86.Build.0 = Release|x86
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|arm64.ActiveCfg = Debug|arm64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|arm64.Build.0 = Debug|arm64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x64.ActiveCfg = Debug|x64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x64.Build.0 = Debug|x64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x86.ActiveCfg = Debug|x86
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x86.Build.0 = Debug|x86
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|arm64.ActiveCfg = Release|arm64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|arm64.Build.0 = Release|arm64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|x64.ActiveCfg = Release|x64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|x64.Build.0 = Release|x64
{51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|x86.ActiveCfg = Release|x86
Expand Down

0 comments on commit 5787ca6

Please sign in to comment.