Commit Graph

72 Commits

Author SHA1 Message Date
Alex Maitland 8e2d66b0b2 Nuget - FIX Change default CefSharpBuildAction for Exe/WinExe projects when using packages.config
- Reorder statements
- Original testing was misleading, the MinimalExample already has CefSharpBuildAction set to true

Resolves #4062
2022-05-09 10:22:27 +10:00
Alex Maitland 59f9608034 Nuget - Update build diagnostics to output CefSharpAnyCpuSupport 2022-04-13 09:17:19 +10:00
Alex Maitland 8a6241c9ce Nuget - Change default CefSharpBuildAction for Exe/WinExe projects when using packages.config
- For Non library projects that use packages.config the default is now Content which should simplify clickonce support
  For libraries the default will remain as None
- For NetCore projects CefSharpBuildAction Content is mapped to default to support upgrading users

Technically this is a breaking change, user impact is expected to be low and can be overridden to restore
the previous behaviour in the edge cases.

Issue #4062
2022-04-12 12:20:13 +10:00
Alex Maitland ad41e1d6aa Nuget - Add CefSharpTransformXmlDllPathOverride
Allow for setting a custom location for CefSharpTransformXmlDllPath
2022-02-14 13:59:02 +10:00
Alex Maitland 5447c8d904 Nuget - Set IncludeInVsix = true for <Content/> entries 2021-11-18 13:28:37 +10:00
Alex Maitland c3f48fef3d Nuget - VS2022 remove extra CefSharp.Core.Runtime.dll copy from bin folder
VS2022 differs from previous versions in how the file paths appear to work. Use a filter to match based on filename + extension
rather than an exact file path match.

I've also updated the CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest target to include a similar filter.
Leaving CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest as is because it's only for VS2017

In VS2019:

C:\Projects\CefSharp.MinimalExample\packages\CefSharp.Common.94.4.50\buildTransitive\..\CefSharp\x86\CefSharp.Core.Runtime.dll;
C:\Projects\CefSharp.MinimalExample\packages\CefSharp.Common.94.4.50\buildTransitive\..\CefSharp\x86\CefSharp.Core.Runtime.pdb;
C:\Projects\CefSharp.MinimalExample\packages\CefSharp.Common.94.4.50\buildTransitive\..\CefSharp\x86\CefSharp.Core.Runtime.xml

In VS2022:
C:\Projects\CefSharp.MinimalExample\packages\CefSharp.Common.94.4.50\CefSharp\x86\CefSharp.Core.Runtime.dll;
C:\Projects\CefSharp.MinimalExample\packages\CefSharp.Common.94.4.50\CefSharp\x86\CefSharp.Core.Runtime.pdb;
C:\Projects\CefSharp.MinimalExample\packages\CefSharp.Common.94.4.50\CefSharp\x86\CefSharp.Core.Runtime.xml

Issue #3854
2021-10-22 10:04:46 +10:00
Alex Maitland f8b96ecf5d Nuget - Fix formatting 2021-10-22 09:42:11 +10:00
Alex Maitland 66bb6c0f68 Nuget - Remove netcoreapp3.0 hacks
For those unable to upgrade to .Net Core 3.1 then the old packages should still be usable by specifying AssetTargetFallback as detailed in https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#assettargetfallback

Resolves #3444
2021-10-13 11:50:00 +10:00
Alex Maitland 4cc758029b Nuget - Simplify CefSharpCopyFilesAfterNugetRestore targets
- Now there are just two targets that actually copy files as the AnyCPU was just a duplicate of
  the x86/x64 ones.
- Remove file exists checks and just rely on the CefSharpPropertiesLoaded not being set
- Added a duplicate copy of CefSharpPlatformTarget (as _CefSharpPlatformTarget) to make
  sure we copy the correct files.
2021-09-24 11:52:44 +10:00
Alex Maitland db6e118cbc Nuget - Use PlatformTarget instead of CefSharpPlatformTarget for copy targets
CefSharpPlatformTarget isn't defined on initial load
2021-09-10 15:59:36 +10:00
Alex Maitland 8fb2e414b6 Nuget - Manually copy CefSharp Common files after initial Nuget restore
Follow up to https://github.com/cefsharp/CefSharp/commit/24d64c427e8d41709230baf460cb8c803048dc54
2021-07-24 16:13:10 +10:00
Alex Maitland 47f3bcd468 Nuget - Only run CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest for packages.config projects
When using Non SDK Stlye project with PackageReference and publishing with ClickOnce the CefSharp.Core.Runtime.*
files were missing from the installer.

Far as I can tell ClickOnce publishing isn't supported for SDK Style projects so just disable for PackageReference for now

https://github.com/cefsharp/CefSharp/discussions/3613#discussioncomment-913061
2021-06-25 14:29:52 +10:00
Alex Maitland 42e9433fdd Nuget - Disable AnyCPU check for BuildTransitive Library Projects
Issue #3622
2021-06-18 15:54:01 +10:00
Alex Maitland 24d64c427e Nuget - Manually copy files after initial Nuget restore
One final attempt to workaround https://github.com/dotnet/project-system/issues/4158

The None/Content entries aren't picked up as the .targets file doesn't exist before the Nuget restore (only when using packages.config)
Attempt to copy the files via calling CefRedist32CopyResources/CefRedist64CopyResources tasks.
Properties aren't accessible, I believe that tasks should be, so hopefully this copies the files.

Build actions like Publish are very unlikely to work correctly as the files won't have been included via the <Content/> entries.
2021-06-18 15:48:06 +10:00
Alex Maitland 325c083b94 Nuget - Exclude CefSharp.Core.Runtime.dll from bin when CefSharpTargetDir and targeting x64
See comments for details

Fix formatting

Issue #3319
2021-04-08 10:47:52 +10:00
Alex Maitland bff3768f51 Nuget - TargetPlatform Map Win32 to x86 (VC++ projects) 2021-03-23 15:19:11 +10:00
Alex Maitland 0c6268f940 Nuget - Improvements and formatting fixes
- Remove CefSharpBuildAction default to NoAction when Nuget 5.0 and Library
  For those writing plugins this would have resulted in no files being copied, will rely on users setting
  to NoAction themselves when required
- When $PlatformTarget is empty default to $Platform as the fallback, older Non SDK Style library projects
  are known to not set PlatformTarget when Platform is AnyCPU which would have resulted in only the x86 files being copied.
- Fix formatting of CefSharp.Common.NETCore.targets
2021-03-23 10:49:14 +10:00
Alex Maitland 7950640bd8 Nuget - Sdk Style Project targeting AnyCPU generate error when PlatformTarget not set
When targeting AnyCPU with an SDK Style project PlatformTarget will default to x86 before build
and after build it will have been correctly updated to AnyCPU. This is too late for our purpose as we
have already copied the x86 files resulting in a build that won't run on an an x64 machine.

Issue https://github.com/dotnet/sdk/issues/1560

Disable an error to the user. Add <PlatformTarget>AnyCPU</PlatformTarget> as simple workaround to proj file.

See also https://github.com/cefsharp/CefSharp/discussions/3430 for background.

Release #3446
2021-03-16 15:27:24 +10:00
Alex Maitland e7d59c928e Revert "Nuget - Remove netcoreapp3.0 hacks"
This reverts commit 005f5c8862.
2021-03-14 19:41:28 +10:00
Alex Maitland 005f5c8862 Nuget - Remove netcoreapp3.0 hacks
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
2021-03-12 13:35:47 +10:00
Alex Maitland c13e2eea5e Nuget - Remove SDK Style project workaround for not PlatformTarget specified
- Remove the workound as it's not working (behaviour is different depending on the SDK version installed)
- Add Prefer32Bit to diag output

For SDK style projects the $(PlatformTarget) is incorrectly set by default
Issue https://github.com/dotnet/sdk/issues/1560

Explicitly setting $(PlatformTarget) in your project file is the recommended solution until the above issue is fixed.
2021-03-09 15:04:37 +10:00
Alex Maitland ba44f6ffce Nuget - Fix formatting 2021-03-09 15:04:37 +10:00
Jozef Izso 7e6e15af88 Fix typos in CefSharp.Common.targets (#3426) 2021-03-08 09:09:33 +10:00
Alex Maitland be58e78fc7 Nuget - CefSharpAfterBuildDiagnostic add extra properties 2021-03-06 13:41:24 +10:00
Alex Maitland c6dc9ebde9 Nuget - Default CefSharpBuildAction to NoAction when Library project PackageRef Nuget > 5.0
- NoAction should now disable AnyCPU checks
- Default to NoAction when Library and Nuget 5.0 when using PackageReference, the Transitive references should flow through to the consuming
projects.
2021-03-06 13:37:01 +10:00
Alex Maitland f8e07de1a3 Nuget - When CefSharpTargetDir set remove the duplicate CefSharp.Core.Runtime.dll file from the bin folder
- Extra copy of CefSharp.Core.Runtime.dll when setting CefSharpTargetDir (see https://github.com/cefsharp/CefSharp/discussions/3371#discussioncomment-416961)
- Fix formatting (tabs to spaces, should change this to tabs at some point)
2021-03-02 10:35:53 +10:00
Alex Maitland 639bd6382f Nuget - Default AnyCPU Prefer32Bit to x86 when CefSharpAnyCpuSupport is not set
Can be overridden using CefSharpPlatformTargetOverride
2021-02-27 14:47:26 +10:00
Alex Maitland 2b18d60c90 Nuget - VS2017 ClickOnce publish workaround
- Remove the duplicate CefSharp.Core.Runtime.dll entry from the manifest
- Switch to CefSharpCommonManagedDll as we only need CefSharp.dll and not CefSharp.Core.dll for the BrowserSubProcess
2021-02-23 10:28:15 +10:00
Alex Maitland 9e1d05ec57 Nuget - Add CefSharpPlatformTargetOverride
Allow for specifying custom CefSharpPlatformTarget

For AnyCPU with Prefer32Bit set this <CefSharpPlatformTargetOverride>x86</CefSharpPlatformTargetOverride>
and the x86 binaries will be used, no need to performing any AnyCPU steps like adding a private probing path
2021-02-20 19:46:47 +10:00
Alex Maitland eb70af9173 Nuget - Move the CefSharpCopyFilesAfterNugetRestore Targets to after AfterBuild 2021-02-15 15:38:58 +10:00
Alex Maitland 7c4148af03 Nuget - Remove CefSharp.Core.Runtime.dll from ReferenceCopyLocalPaths for AnyCPU
https://thomasfreudenberg.com/archive/2012/11/21/dont-copy-my-referenced-assemblies/

Details at https://github.com/cefsharp/CefSharp/issues/3319#issuecomment-777949648
2021-02-12 16:30:41 +10:00
Daniel Bitterlich d36c0bceb3 Add app.config file check to CefSharpPlatformCheck target.
Fixed #3390 - Resolves build issues for projects where app.config transformation would fail, because app.config doesn't exists.
2021-02-08 17:23:12 +10:00
Alex Maitland 9aac37090a Nuget - Re-Add CefSharpDeleteCoreRuntimeAfterCopyFilesToOutputDirectory target
For Non SDK Style projects CefSharp.Core.Runtime.dll is copied by the _CopyFilesMarkedCopyLocal
MSBuild target.
2021-02-08 17:12:42 +10:00
Alex Maitland 088df55173 Nuget - Add CefSharpTargetPlatform property
As MSBuild doesn't always set PlatformTarget correctly for SDK style projects we have to add some extra checks
2021-02-08 16:33:37 +10:00
Alex Maitland b485198298 Nuget - Non-SDK Projects when targeting AnyCPU delete CefSharp.Core.Runtime.dll
Nuget/Msbuild is copying the CefSharp.Core.Runtime.dll into the output folder as part of the build
process (not sure which bitness it's actually copying).

This breaks `AnyCPU` as the dll won't work when using Assembly.Resolve
2021-02-08 09:19:57 +10:00
Alex Maitland cde3c3f862 Nuget - Switch from using UsingMicrosoftNETSdk to NuGetProjectStyle
To detect PackageReference vs packages.config we now use NuGetProjectStyle which is more accurate.
This should allow us to support Paket (not tested)
2021-02-04 15:06:36 +10:00
Alex Maitland ea578aed32 Nuget - Formating (tabs to spaces) 2021-02-04 10:55:30 +10:00
Alex Maitland 9d7cf7fcbb Nuget - Add support for buildTransitive
- Add support for buildTransitive folder
- Show error when MSBuild didn't copy files (unable to use a Copy Task as props files aren't imported at that point)
- Remove FrameworkVersionCheck (we now have our dlls in a lib\net452) folder so nuget should complain without our custom check)

Issue #3319
2021-01-29 15:05:20 +10:00
Alex Maitland f092f2a398 Nuget - Improve package.config support
- Add debugging target (optional)
- Add check for file exists on disk to perform copy if required
2021-01-29 15:05:19 +10:00
Alex Maitland 3d70e6d6a8 Nuget - ReEnable AfterBuild Targets when CefSharpResourceFilesCopied false 2021-01-16 10:50:34 +10:00
Alex Maitland 92f39e421b Nuget - Fix formatting 2021-01-15 13:40:35 +10:00
Alex Maitland 2a90150078 Nuget - When CefSharpTargetDir set copy CefSharp.dll to subfolder
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
2021-01-14 15:02:11 +10:00
Alex Maitland 332d2d8728 Nuget - SdkStyle(PackageReference) default to Content and adjust CefSharpTargetDir path
- SdkStyle(PackageReference) projects now default to CefSharpBuildAction Content
- CefSharpTargetDir is now empty by default instead of a `.` and a trailing slash appended if required
2021-01-14 12:47:26 +10:00
Alex Maitland 9c09932e7d Nuget - Tabs to spaces 2021-01-09 16:17:20 +10:00
Alex Maitland a29a1df414 Nuget - Copy files on Nuget install/restore
Adding a PropertyGroup to each Chose/When block appears to be enough to get the files copied successfully.

Still needs more testing

Issue #3319
2021-01-09 16:00:14 +10:00
Alex Maitland 27c53ea513 Nuget - Add Build Action option (default Build Action None)
For ClickOnce specifying <CefSharpBuildAction>Content</CefSharpBuildAction> in your project file
before the .targets file should allow for resources to be included in your ClickOnce installer.
The default None copies files to a dependant project, say you have CefSharp installed in your
Class library, the files will be included in projects that directly reference this project file
(Only one level deep).

Same as the Content/None options listed at
https://docs.microsoft.com/en-us/visualstudio/ide/build-actions?view=vs-2019#build-action-values

Issue #3319
2021-01-08 15:09:37 +10:00
Alex Maitland 8a367fbdc4 Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
* Net Core - Rename CefSharp.Core.dll to CefSharp.Core.Runtime.dll

Partial rename, only Net Core, folder not renamed

* Net Core - Rename CefSharp.Core.RefAssembly to CefSharp.Core.netcore

Remove GenApi

* Core - Rename CefDragDataWrapper to DragData

Move into CefSharp.Core namespace

* WinForms/WPF/OffScreen - Migrate from GitLink command line to Nuget package

* Net Core - Refactor to have CefSharp.Core.dll contain only public Api

* Net Core - Remove CefSharp.Core.RefAssembly

* Net Core - Change CefSharp.Core.netcore output folder

* Net Core - Restructure nuget packages

* Net Core - Add Cefsharp.Core.Runtime.RefAssembly

* Net Core - Hide CLI/C++ classes from intellisense

Make sure users don't attempt to load them directly

* Rename CefSharp.Core to CefSharp.Core.Runtime

* Core - Restructure Net 4.5.2 packages to use CefSharp.Core.dll anycpu variant

Attempt to load CefSharp.Core.Runtime at runtime rather than having to use msbuild to copy the correct version

* Rename CefSharp.Core.netcore to CefSharp.Core

* WPF/WinForms/OffScreen - Change from x86/64 to AnyCPU

As they are all managed assemblies they can target AnyCPU.
Includes CefSharp.dll

* Convert RequestContextBuilder from C++ to C#

Now part of the CefSharp.Core PublicApi

* Update version number to 87.1.11

* Migrate more of the public Api to C#

* Net Core - Basic restructure complete

* Net Core - ModuleInitializer (Doesn't work yet)

* Remove direct references to BrowserSettings

* Net Core - ModuleInitializer load CefShar.Core.Runtime.dl

* Net Core - Load libcef.dll via CLR Module initializer

If no RID is specified then we can load libcef.dll using the module initializer

* Add version to CefSharp.Core

* Remove dependency on CefSharp.Core.Runtime
Rewrite common targets

* AnyCPU app.config transform

Improve AnyCPU support

* Improve Net Core 3 support
Only delete CefSharp.Core.Runtime.dll when AnyCPU

* Nuget - Add CefSharp.Core.Runtime reference when TargetFramework = NetCore

* Fix Typos

Based on #3306

* Net Core - Rename CefSharp.Core.Runtime RefAssembly source file

* Net Full - Generate CefSharp.Core.Runtime Ref Assembly

For now the powershell build script generates the .cs file based on a x86 release build.ps1
It's not possible to directly install GenApi as it requires a Sdk style project

* Net Core - Old packages copy files to required folders

* Test - Install newer .Net Compiler and set Lang Version to 7.3

* Net Core - Exclude Net 452 Runtime generated reference source

* Core - Add Refactoring TODO

* Ref Assembly - Generate source as part of build

- Move ref assembly source generate into GenerateRefAssemblySource.ps1
- Call before project build

Runs locally, see if Appveyor has a problem with the powershell script execution

* Core - Add more factory methods to create instances of managed wrappers

* Net Core - Make Initialzier properties internal

Not quite sure what the public API should look like as yet, so making internal for now.
2020-12-16 10:47:34 +10:00
Alex Maitland 63a422835c Nuget - Fix Publish state property in .targets files
Follow up to commit https://github.com/cefsharp/CefSharp/commit/f8ffbc7aa5dc58a667a6a6f29d0553a14027b5ff#diff-0d9b4a8f1ae31c93f5bfdfe571baf089b5126c437989baf70010d8c631d3385b

https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2019#content

Technically it's only documented for <Content/> and not <None/> targets, so this is just to see if it actually works by magic.
Fixed my mistake previously.
2020-11-06 14:44:03 +10:00
Jozef Izso e0e23be25e Fix whitespace in .targets files (#3156) 2020-06-21 07:00:06 +10:00
amaitland f8ffbc7aa5 Nuget - Set PublishState Include for <None/> entries
Hopefully this will allow support for ClickOnce installer
2020-05-21 20:11:38 +10:00