diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index 18f80df72..c0b5a52d4 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj index 402895ec9..303e2922f 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.BrowserSubprocess.Core/Resource.rc b/CefSharp.BrowserSubprocess.Core/Resource.rc index 7226516d9..b672435cf 100644 --- a/CefSharp.BrowserSubprocess.Core/Resource.rc +++ b/CefSharp.BrowserSubprocess.Core/Resource.rc @@ -1,8 +1,8 @@ #pragma code_page(65001) 1 VERSIONINFO - FILEVERSION 156,0,150 - PRODUCTVERSION 156,0,150 + FILEVERSION 156,0,320 + PRODUCTVERSION 156,0,320 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -18,10 +18,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "CefSharp.BrowserSubprocess.Core" - VALUE "FileVersion", "156.0.150" + VALUE "FileVersion", "156.0.320" VALUE "LegalCopyright", "Copyright © 2023 The CefSharp Authors" VALUE "ProductName", "CefSharp" - VALUE "ProductVersion", "156.0.150" + VALUE "ProductVersion", "156.0.320" END END BLOCK "VarFileInfo" diff --git a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config index cf54561c9..c38f50631 100644 --- a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config +++ b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config index c2a298110..3a7511aa2 100644 --- a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config +++ b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.BrowserSubprocess/app.manifest b/CefSharp.BrowserSubprocess/app.manifest index 46c243007..9cca6a337 100644 --- a/CefSharp.BrowserSubprocess/app.manifest +++ b/CefSharp.BrowserSubprocess/app.manifest @@ -8,7 +8,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj index 5a65b40d2..ccb045ebc 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj index e70cf1c7e..2f59a3a9d 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.Core.Runtime/Resource.rc b/CefSharp.Core.Runtime/Resource.rc index 90628ad7e..e15693a36 100644 --- a/CefSharp.Core.Runtime/Resource.rc +++ b/CefSharp.Core.Runtime/Resource.rc @@ -1,8 +1,8 @@ #pragma code_page(65001) 1 VERSIONINFO - FILEVERSION 156,0,150 - PRODUCTVERSION 156,0,150 + FILEVERSION 156,0,320 + PRODUCTVERSION 156,0,320 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -18,10 +18,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "CefSharp.Core" - VALUE "FileVersion", "156.0.150" + VALUE "FileVersion", "156.0.320" VALUE "LegalCopyright", "Copyright © 2023 The CefSharp Authors" VALUE "ProductName", "CefSharp" - VALUE "ProductVersion", "156.0.150" + VALUE "ProductVersion", "156.0.320" END END BLOCK "VarFileInfo" diff --git a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config index cf54561c9..c38f50631 100644 --- a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config +++ b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config index c2a298110..3a7511aa2 100644 --- a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config +++ b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj index 01decc37c..d47b01f6b 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj index fccddefff..b6cffbd6b 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj @@ -38,7 +38,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.OffScreen.Example/app.manifest b/CefSharp.OffScreen.Example/app.manifest index b8b572608..698fd5a53 100644 --- a/CefSharp.OffScreen.Example/app.manifest +++ b/CefSharp.OffScreen.Example/app.manifest @@ -7,7 +7,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index 4a2f35731..768b7942e 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -41,7 +41,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.Test/CefSharp.Test.netcore.csproj b/CefSharp.Test/CefSharp.Test.netcore.csproj index 406cabb96..8a72d4135 100644 --- a/CefSharp.Test/CefSharp.Test.netcore.csproj +++ b/CefSharp.Test/CefSharp.Test.netcore.csproj @@ -35,7 +35,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index aa1bc6d02..3a0a66328 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -34,7 +34,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj index f5e681763..72f2c3c01 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -38,7 +38,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.WinForms.Example/app.manifest b/CefSharp.WinForms.Example/app.manifest index 34af28bb7..f4aa94f67 100644 --- a/CefSharp.WinForms.Example/app.manifest +++ b/CefSharp.WinForms.Example/app.manifest @@ -8,7 +8,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 9ca3ce04f..e0b07fb12 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -33,7 +33,7 @@ - + all diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj index 68b7a0f59..24f1bf032 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj @@ -39,7 +39,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.Wpf.Example/app.manifest b/CefSharp.Wpf.Example/app.manifest index 12b51be53..566e5b66d 100644 --- a/CefSharp.Wpf.Example/app.manifest +++ b/CefSharp.Wpf.Example/app.manifest @@ -7,7 +7,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + diff --git a/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.csproj b/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.csproj index 06f2a6bf2..6e4a6cee0 100644 --- a/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.csproj +++ b/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.csproj @@ -28,7 +28,7 @@ - + diff --git a/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.netcore.csproj b/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.netcore.csproj index 136c43a2c..279c68a19 100644 --- a/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.netcore.csproj +++ b/CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.netcore.csproj @@ -40,7 +40,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CefSharp.shfbproj b/CefSharp.shfbproj index fb79d6b36..8813c4af4 100644 --- a/CefSharp.shfbproj +++ b/CefSharp.shfbproj @@ -31,7 +31,7 @@ - 156.0.150 + 156.0.320 2 False C#, Managed C++ @@ -59,7 +59,7 @@ InheritedMembers, InheritedFrameworkMembers, Protected, ProtectedInternalAsProtected, EditorBrowsableNever, NonBrowsable - Version 156.0.150 + Version 156.0.320 https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE Interfaces, enums, structs and classes that make up the core API interface diff --git a/CefSharp/Properties/AssemblyInfo.cs b/CefSharp/Properties/AssemblyInfo.cs index fa2371462..16b556716 100644 --- a/CefSharp/Properties/AssemblyInfo.cs +++ b/CefSharp/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ namespace CefSharp public const bool ComVisible = false; public const string AssemblyCompany = "The CefSharp Authors"; public const string AssemblyProduct = "CefSharp"; - public const string AssemblyVersion = "156.0.150"; - public const string AssemblyFileVersion = "156.0.150.0"; + public const string AssemblyVersion = "156.0.320"; + public const string AssemblyFileVersion = "156.0.320.0"; public const string AssemblyCopyright = "Copyright © 2023 The CefSharp Authors"; public const string CefSharpCoreProject = "CefSharp.Core, PublicKey=" + PublicKey; public const string CefSharpBrowserSubprocessProject = "CefSharp.BrowserSubprocess, PublicKey=" + PublicKey; diff --git a/NuGet/CefSharp.Common.app.config.x64.transform b/NuGet/CefSharp.Common.app.config.x64.transform index 85e86498f..abc0594ab 100644 --- a/NuGet/CefSharp.Common.app.config.x64.transform +++ b/NuGet/CefSharp.Common.app.config.x64.transform @@ -20,7 +20,7 @@ - + diff --git a/NuGet/CefSharp.Common.app.config.x86.transform b/NuGet/CefSharp.Common.app.config.x86.transform index fa443f5aa..0d3d0b180 100644 --- a/NuGet/CefSharp.Common.app.config.x86.transform +++ b/NuGet/CefSharp.Common.app.config.x86.transform @@ -20,7 +20,7 @@ - + diff --git a/NuGet/PackageReference/CefSharp.Common.NETCore.targets b/NuGet/PackageReference/CefSharp.Common.NETCore.targets index 2b0fcf711..f0eac84a9 100644 --- a/NuGet/PackageReference/CefSharp.Common.NETCore.targets +++ b/NuGet/PackageReference/CefSharp.Common.NETCore.targets @@ -143,16 +143,16 @@ - - - + + + - - - + + + diff --git a/UpdateNugetPackages.Agent.ps1 b/UpdateNugetPackages.Agent.ps1 new file mode 100644 index 000000000..9fc36e0c8 --- /dev/null +++ b/UpdateNugetPackages.Agent.ps1 @@ -0,0 +1,188 @@ +#requires -Version 7.0 +# Non-interactive, cross-platform CEF upgrade script for coding agents. +[CmdletBinding(SupportsShouldProcess = $true)] +param( + [Parameter(Mandatory = $true, Position = 0)] + [ValidatePattern('^[0-9A-Za-z][0-9A-Za-z.+-]*$')] + [string] $CefVersion, + + [Parameter(Position = 1)] + [ValidatePattern('^[0-9A-Za-z][0-9A-Za-z.+-]*$')] + [string] $CefSharpVersion = '' +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +$parsedCefVersion = $null +if (-not [Version]::TryParse($CefVersion, [ref] $parsedCefVersion)) { + throw "CefVersion must be a valid numeric version: $CefVersion" +} +$CefVersion = $parsedCefVersion.ToString() + +if ([string]::IsNullOrWhiteSpace($CefSharpVersion)) { + $CefSharpVersion = $CefVersion + '0' +} + +$parsedCefSharpVersion = $null +if (-not [Version]::TryParse($CefSharpVersion, [ref] $parsedCefSharpVersion)) { + throw "CefSharpVersion must be a valid numeric version: $CefSharpVersion" +} +$CefSharpVersion = $parsedCefSharpVersion.ToString() + +$WorkingDir = $PSScriptRoot +$Updates = [System.Collections.Generic.Dictionary[string,string]]::new([System.StringComparer]::Ordinal) + +function Get-UpdatedContent { + param([Parameter(Mandatory)][string] $Path) + + if (-not $Updates.ContainsKey($Path)) { + if (-not (Test-Path -LiteralPath $Path -PathType Leaf)) { + throw "Required upgrade file not found: $Path" + } + + $Updates[$Path] = [System.IO.File]::ReadAllText($Path) + } + + return $Updates[$Path] +} + +function Set-RegexUpdate { + param( + [Parameter(Mandatory)][string] $RelativePath, + [Parameter(Mandatory)][string] $Pattern, + [Parameter(Mandatory)][string] $Replacement, + [int] $MinimumMatches = 1 + ) + + $path = Join-Path $WorkingDir $RelativePath + $content = Get-UpdatedContent $path + $matches = [regex]::Matches($content, $Pattern) + if ($matches.Count -lt $MinimumMatches) { + throw "Expected at least $MinimumMatches match(es) for '$Pattern' in $RelativePath; found $($matches.Count). No files have been written." + } + + $Updates[$path] = [regex]::Replace($content, $Pattern, $Replacement) +} + +function Remove-EnsureNuGetBuildImportsTarget { + param([Parameter(Mandatory)][string] $RelativePath) + + $path = Join-Path $WorkingDir $RelativePath + $content = Get-UpdatedContent $path + $pattern = '(?s)]*\bName="EnsureNuGetPackageBuildImports")[^>]*(?:/>|>.*?)' + $Updates[$path] = [regex]::Replace($content, $pattern, '') +} + +# Keep the four packages.config files and the corresponding project imports in sync. +$configFiles = @( + 'CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config', + 'CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config', + 'CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config', + 'CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config' +) +foreach ($file in $configFiles) { + Set-RegexUpdate $file '(]*\bid="cef\.sdk")[^>]*\bversion=")[^"]+("[\s\S]*?/?>)' ('${1}' + $CefVersion + '${2}') +} + +$projectFiles = @( + 'CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj', + 'CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj', + 'CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj', + 'CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj' +) +foreach ($file in $projectFiles) { + Set-RegexUpdate $file '(packages\\cef\.sdk\.)[^"\\]+' ('${1}' + $CefVersion) 2 + Remove-EnsureNuGetBuildImportsTarget $file +} + +# Update the Chromium runtime package references in the same example/test projects +# as UpdateNugetPackages.ps1. +$csprojFiles = @( + 'CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj', + 'CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj', + 'CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj', + 'CefSharp.Test/CefSharp.Test.netcore.csproj', + 'CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj', + 'CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj', + 'CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj', + 'CefSharp.Test/CefSharp.Test.csproj', + 'CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.netcore.csproj', + 'CefSharp.Wpf.HwndHost.Example/CefSharp.Wpf.HwndHost.Example.csproj' +) +foreach ($file in $csprojFiles) { + Set-RegexUpdate $file '(]*\bInclude="chromiumembeddedframework\.runtime")[^>]*\bVersion=")[^"]+("[^>]*/?>)' ('${1}' + $CefVersion + '${2}') +} + +# Match the version defaults previously updated by UpdateNugetPackages.ps1. +Set-RegexUpdate 'UpdateNugetPackages.ps1' '(?m)(^\s*\[string\]\s+\$CefVersion\s*=\s*")[^"]+("\s*,?\s*$)' ('${1}' + $CefVersion + '${2}') +Set-RegexUpdate 'build.ps1' '(?m)(^\s*\[string\]\s+\$Version\s*=\s*")[^"]+("\s*,?\s*$)' ('${1}' + $CefSharpVersion + '${2}') +Set-RegexUpdate 'build.ps1' '(?m)(^\s*\[string\]\s+\$AssemblyVersion\s*=\s*")[^"]+("\s*,?\s*$)' ('${1}' + $CefSharpVersion + '${2}') + +# Reproduce the metadata/version updates normally performed by build.ps1's +# update-build-version target, without invoking its Windows-only build setup. +$assemblyVersion = $parsedCefSharpVersion.ToString() +$assemblyFileBuild = if ($parsedCefSharpVersion.Build -ge 0) { $parsedCefSharpVersion.Build } else { 0 } +$assemblyFileRevision = if ($parsedCefSharpVersion.Revision -ge 0) { $parsedCefSharpVersion.Revision } else { 0 } +$assemblyFileVersion = [Version]::new( + $parsedCefSharpVersion.Major, + $parsedCefSharpVersion.Minor, + $assemblyFileBuild, + $assemblyFileRevision +).ToString() +Set-RegexUpdate 'CefSharp/Properties/AssemblyInfo.cs' '(public const string AssemblyVersion = ")[^"]+(")' ('${1}' + $assemblyVersion + '${2}') +Set-RegexUpdate 'CefSharp/Properties/AssemblyInfo.cs' '(public const string AssemblyFileVersion = ")[^"]+(")' ('${1}' + $assemblyFileVersion + '${2}') + +foreach ($file in @( + 'CefSharp.BrowserSubprocess/app.manifest', + 'CefSharp.OffScreen.Example/app.manifest', + 'CefSharp.WinForms.Example/app.manifest', + 'CefSharp.Wpf.Example/app.manifest' +)) { + Set-RegexUpdate $file '(assemblyIdentity version=")[^"]+(")' ('${1}' + $assemblyFileVersion + '${2}') +} + +foreach ($file in @( + 'NuGet/CefSharp.Common.app.config.x64.transform', + 'NuGet/CefSharp.Common.app.config.x86.transform' +)) { + Set-RegexUpdate $file '(codeBase version=")[^"]+(")' ('${1}' + $assemblyFileVersion + '${2}') +} + +foreach ($file in @( + 'CefSharp.BrowserSubprocess.Core/Resource.rc', + 'CefSharp.Core.Runtime/Resource.rc' +)) { + Set-RegexUpdate $file '(?m)(^\s*(?:FILE|PRODUCT)?VERSION\s+)[^\r\n]+' ('${1}' + ($assemblyVersion -replace '\.', ',')) 2 + Set-RegexUpdate $file '(Version", ")[^"]*(")' ('${1}' + $assemblyVersion + '${2}') +} + +Set-RegexUpdate 'CefSharp.shfbproj' '()[^<]*()' ('${1}' + $assemblyVersion + '${2}') +Set-RegexUpdate 'CefSharp.shfbproj' '(Version )[^<]*()' ('${1}' + $assemblyVersion + '${2}') +Set-RegexUpdate 'appveyor.yml' '(?m)(^version:\s*)[^\r\n]*-CI\{build\}' ('${1}' + $assemblyVersion + '-CI{build}') + +# These package versions are embedded in the targets file in both attributes +# (Version and VersionOverride); update them from the new cef.sdk version. +Set-RegexUpdate 'NuGet/PackageReference/CefSharp.Common.NETCore.targets' '(" Version=")[^"]*(")' ('${1}' + $CefVersion + '${2}') +Set-RegexUpdate 'NuGet/PackageReference/CefSharp.Common.NETCore.targets' '(" VersionOverride=")[^"]*(")' ('${1}' + $CefVersion + '${2}') + +# Validate every changed XML/MSBuild file before writing anything. +foreach ($path in $Updates.Keys) { + if ([IO.Path]::GetExtension($path) -in @('.config', '.vcxproj', '.csproj', '.manifest', '.transform', '.shfbproj', '.targets')) { + $document = [System.Xml.XmlDocument]::new() + $document.LoadXml($Updates[$path]) + } +} + +foreach ($path in $Updates.Keys) { + if (-not $PSCmdlet.ShouldProcess($path, "Write Cef $CefVersion / CefSharp $CefSharpVersion upgrade changes")) { + continue + } + + $bytes = [System.IO.File]::ReadAllBytes($path) + $hasUtf8Bom = $bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF + $encoding = [System.Text.UTF8Encoding]::new($hasUtf8Bom) + [System.IO.File]::WriteAllText($path, $Updates[$path], $encoding) +} + +Write-Host "Prepared Cef $CefVersion and CefSharp $CefSharpVersion version updates. Review the diff, then build/test on Windows CI." diff --git a/UpdateNugetPackages.ps1 b/UpdateNugetPackages.ps1 index 8c898bdb3..2aada16ef 100644 --- a/UpdateNugetPackages.ps1 +++ b/UpdateNugetPackages.ps1 @@ -3,7 +3,7 @@ param( [Parameter(Position = 1)] - [string] $CefVersion = "156.0.15", + [string] $CefVersion = "156.0.32", [Parameter(Position = 2)] [string] $CefSharpVersion = "" ) diff --git a/appveyor.yml b/appveyor.yml index ee28bfcd1..58f437965 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 156.0.150-CI{build} +version: 156.0.320-CI{build} clone_depth: 10 diff --git a/build.ps1 b/build.ps1 index cc0a5db0c..5acf29cc8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -5,9 +5,9 @@ param( [Parameter(Position = 0)] [string] $Target = "vs2022", [Parameter(Position = 1)] - [string] $Version = "156.0.150", + [string] $Version = "156.0.320", [Parameter(Position = 2)] - [string] $AssemblyVersion = "156.0.150", + [string] $AssemblyVersion = "156.0.320", [Parameter(Position = 3)] [ValidateSet("NetFramework", "NetCore")] [string] $TargetFramework = "NetFramework",