cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.79k stars 2.92k forks source link

Enhancement - Update build.ps1/build.netcore.ps1 to allow for building/packaging for subset of architectures #3706

Closed amaitland closed 2 years ago

amaitland commented 3 years ago

When building custom version of CefSharp it maybe desirable to only build/package a subset of the x86/x86/arm64 architectures. e.g. You may only wish to build x86/x64 for your custom version.

The nupkg process will fail if the files don't exist, so we need to perform some modifications dynamically.

To simplify this issue #3444 should likely be resolved first. I'm adding the breaking-change label, whilst this change in itself isn't breaking, the changes in #3444 will be.

Related issue https://github.com/cefsharp/cef-binary/issues/98

amaitland commented 2 years ago

To simplify this the remaining c# projects have been migrated to the newer SDK Style project format in commit https://github.com/cefsharp/CefSharp/commit/67a08c47eedf0bb76493a63e99a467f23cf7cf73

amaitland commented 2 years ago

Tests are now failing when run via AppVeyor

https://ci.appveyor.com/project/cefsharp/cefsharp/builds/41113154

campersau commented 2 years ago

It looks like the cef dependencies aren't copied to the output directory anymore (I can reproduce it by deleting the bin/obj folders before duing a build).

Adding the following lines to https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Test/CefSharp.Test.csproj fixes it:

    <Target Name="CefCopy" AfterTargets="Build">
        <CallTarget Targets="CefRedist32CopyResources" Condition="'$(Platform)' == 'x86'"/>
        <CallTarget Targets="CefRedist64CopyResources" Condition="'$(Platform)' == 'x64'"/>
    </Target>

Looks like this got removed here: https://github.com/cefsharp/CefSharp/commit/67a08c47eedf0bb76493a63e99a467f23cf7cf73#diff-b6fc1d6d9c3d3eff95f339ef0f4455fbf23bf9bcb59d53500632de453f4f676dL11-L13 https://github.com/cefsharp/CefSharp/commit/67a08c47eedf0bb76493a63e99a467f23cf7cf73#diff-b6fc1d6d9c3d3eff95f339ef0f4455fbf23bf9bcb59d53500632de453f4f676dL16-L19

amaitland commented 2 years ago

I'll fix the errors shortly.

amaitland commented 2 years ago

The chromiumembeddedframework.runtime package is now used internally. Tests should now be passing again.

amaitland commented 2 years ago

It should now be possible to compile only a subset of architectures

.\build.ps1 -BuildArches "x64"
.\build.ps1 -BuildArches "x64 x86"

.\build.ps1 -BuildArches "x64" -TargetFramework NetCore
.\build.ps1 -BuildArches "x64 x86" -TargetFramework NetCore