2019-02-15 21:40:25 +01:00
|
|
|
param(
|
2019-10-06 14:14:54 -07:00
|
|
|
[ValidateSet("vs2015", "vs2017", "vs2019", "nupkg-only", "gitlink")]
|
2014-10-02 20:17:24 +10:00
|
|
|
[Parameter(Position = 0)]
|
2018-02-05 17:23:34 +10:00
|
|
|
[string] $Target = "vs2015",
|
2014-10-02 20:17:24 +10:00
|
|
|
[Parameter(Position = 1)]
|
2020-02-27 17:38:00 +10:00
|
|
|
[string] $Version = "80.0.40",
|
2014-11-14 09:15:29 +10:00
|
|
|
[Parameter(Position = 2)]
|
2020-03-31 12:47:15 +10:00
|
|
|
[string] $AssemblyVersion = "80.1.20"
|
2014-10-02 20:17:24 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition
|
|
|
|
|
$CefSln = Join-Path $WorkingDir 'CefSharp3.sln'
|
|
|
|
|
|
2016-06-07 08:14:49 +10:00
|
|
|
# Extract the current CEF Redist version from the CefSharp.Core\packages.config file
|
|
|
|
|
# Save having to update this file manually Example 3.2704.1418
|
|
|
|
|
$CefSharpCorePackagesXml = [xml](Get-Content (Join-Path $WorkingDir 'CefSharp.Core\Packages.config'))
|
|
|
|
|
$RedistVersion = $CefSharpCorePackagesXml.SelectSingleNode("//packages/package[@id='cef.sdk']/@version").value
|
|
|
|
|
|
2014-11-24 20:48:33 +01:00
|
|
|
function Write-Diagnostic
|
|
|
|
|
{
|
|
|
|
|
param(
|
|
|
|
|
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
|
|
|
|
|
[string] $Message
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Write-Host
|
|
|
|
|
Write-Host $Message -ForegroundColor Green
|
|
|
|
|
Write-Host
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-13 12:20:45 +10:00
|
|
|
if (Test-Path Env:\APPVEYOR_BUILD_VERSION)
|
|
|
|
|
{
|
2014-11-13 12:28:07 +10:00
|
|
|
$Version = $env:APPVEYOR_BUILD_VERSION
|
2014-11-13 12:20:45 +10:00
|
|
|
}
|
|
|
|
|
|
2014-11-24 20:48:33 +01:00
|
|
|
if ($env:APPVEYOR_REPO_TAG -eq "True")
|
2014-11-24 20:25:09 +01:00
|
|
|
{
|
2014-12-18 14:10:01 +10:00
|
|
|
$Version = "$env:APPVEYOR_REPO_TAG_NAME".Substring(1) # trim leading "v"
|
2018-05-01 11:09:00 +10:00
|
|
|
$AssemblyVersion = $Version
|
|
|
|
|
#Stip the -pre
|
|
|
|
|
if($AssemblyVersion.Contains("-pre"))
|
|
|
|
|
{
|
|
|
|
|
$AssemblyVersion = $AssemblyVersion.Substring(0, $AssemblyVersion.IndexOf("-pre"))
|
|
|
|
|
}
|
2018-03-23 15:35:32 +10:00
|
|
|
Write-Diagnostic "Setting Version based on tag to $Version"
|
2018-05-01 11:09:00 +10:00
|
|
|
Write-Diagnostic "Setting AssemblyVersion based on tag to $AssemblyVersion"
|
2014-11-24 20:25:09 +01:00
|
|
|
}
|
|
|
|
|
|
2014-10-02 20:17:24 +10:00
|
|
|
# https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1
|
|
|
|
|
function Invoke-BatchFile
|
|
|
|
|
{
|
|
|
|
|
param(
|
|
|
|
|
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
|
|
|
|
|
[string]$Path,
|
|
|
|
|
[Parameter(Position = 1, Mandatory = $true, ValueFromPipeline = $true)]
|
|
|
|
|
[string]$Parameters
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$tempFile = [IO.Path]::GetTempFileName()
|
|
|
|
|
|
|
|
|
|
cmd.exe /c " `"$Path`" $Parameters && set > `"$tempFile`" "
|
|
|
|
|
|
|
|
|
|
Get-Content $tempFile | Foreach-Object {
|
|
|
|
|
if ($_ -match "^(.*?)=(.*)$")
|
|
|
|
|
{
|
|
|
|
|
Set-Content "env:\$($matches[1])" $matches[2]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Remove-Item $tempFile
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Die
|
|
|
|
|
{
|
|
|
|
|
param(
|
|
|
|
|
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
|
|
|
|
[string] $Message
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Write-Host
|
2014-11-03 18:19:39 +10:00
|
|
|
Write-Error $Message
|
|
|
|
|
exit 1
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Warn
|
|
|
|
|
{
|
|
|
|
|
param(
|
|
|
|
|
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
|
|
|
|
[string] $Message
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Write-Host
|
2014-11-03 18:19:39 +10:00
|
|
|
Write-Host $Message -ForegroundColor Yellow
|
|
|
|
|
Write-Host
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function TernaryReturn
|
|
|
|
|
{
|
|
|
|
|
param(
|
|
|
|
|
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
|
|
|
|
[bool] $Yes,
|
|
|
|
|
[Parameter(Position = 1, ValueFromPipeline = $true)]
|
|
|
|
|
$Value,
|
|
|
|
|
[Parameter(Position = 2, ValueFromPipeline = $true)]
|
|
|
|
|
$Value2
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if($Yes) {
|
|
|
|
|
return $Value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$Value2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Msvs
|
|
|
|
|
{
|
|
|
|
|
param(
|
2019-10-06 14:14:54 -07:00
|
|
|
[ValidateSet('v140', 'v141', 'v142')]
|
2014-10-02 20:17:24 +10:00
|
|
|
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
|
|
|
|
[string] $Toolchain,
|
|
|
|
|
|
|
|
|
|
[Parameter(Position = 1, ValueFromPipeline = $true)]
|
|
|
|
|
[ValidateSet('Debug', 'Release')]
|
|
|
|
|
[string] $Configuration,
|
|
|
|
|
|
|
|
|
|
[Parameter(Position = 2, ValueFromPipeline = $true)]
|
|
|
|
|
[ValidateSet('x86', 'x64')]
|
|
|
|
|
[string] $Platform
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "Targeting $Toolchain using configuration $Configuration on platform $Platform"
|
|
|
|
|
|
|
|
|
|
$VisualStudioVersion = $null
|
|
|
|
|
$VXXCommonTools = $null
|
|
|
|
|
|
|
|
|
|
switch -Exact ($Toolchain) {
|
2015-09-01 22:34:50 +10:00
|
|
|
'v140' {
|
2019-02-22 11:11:32 +10:00
|
|
|
if($env:VS140COMNTOOLS -eq $null) {
|
|
|
|
|
Die "Visual Studio 2015 is not installed on your development machine, unable to continue."
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-01 22:28:09 +10:00
|
|
|
$MSBuildExe = join-path -path (Get-ItemProperty "HKLM:\software\Microsoft\MSBuild\ToolsVersions\14.0").MSBuildToolsPath -childpath "msbuild.exe"
|
|
|
|
|
$MSBuildExe = $MSBuildExe -replace "Framework64", "Framework"
|
|
|
|
|
$VisualStudioVersion = '14.0'
|
2015-09-01 22:32:28 +10:00
|
|
|
$VXXCommonTools = Join-Path $env:VS140COMNTOOLS '..\..\vc'
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
2019-10-06 14:14:54 -07:00
|
|
|
{($_ -eq 'v141') -or ($_ -eq 'v142')} {
|
|
|
|
|
$VS_VER = 15;
|
|
|
|
|
$VS_OFFICIAL_VER = 2017;
|
|
|
|
|
if ($_ -eq 'v142'){$VS_VER=16;$VS_OFFICIAL_VER=2019;}
|
2018-02-05 17:23:34 +10:00
|
|
|
$programFilesDir = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0]
|
|
|
|
|
|
|
|
|
|
$vswherePath = Join-Path $programFilesDir 'Microsoft Visual Studio\Installer\vswhere.exe'
|
2019-10-06 14:14:54 -07:00
|
|
|
#Check if we already have vswhere which is included in newer versions of VS2017/VS2019
|
2018-02-05 17:23:34 +10:00
|
|
|
if(-not (Test-Path $vswherePath))
|
|
|
|
|
{
|
|
|
|
|
Write-Diagnostic "Downloading VSWhere as no install found at $vswherePath"
|
|
|
|
|
|
|
|
|
|
# Check if we already have a local copy and download if required
|
|
|
|
|
$vswherePath = Join-Path $WorkingDir \vswhere.exe
|
|
|
|
|
|
|
|
|
|
# TODO: Check hash and download if hash differs
|
|
|
|
|
if(-not (Test-Path $vswherePath))
|
|
|
|
|
{
|
|
|
|
|
$client = New-Object System.Net.WebClient;
|
|
|
|
|
$client.DownloadFile('https://github.com/Microsoft/vswhere/releases/download/2.2.11/vswhere.exe', $vswherePath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "VSWhere path $vswherePath"
|
|
|
|
|
|
2019-10-06 14:14:54 -07:00
|
|
|
$versionSearchStr = "[$VS_VER.0," + ($VS_VER+1) + ".0)"
|
|
|
|
|
$VS2017InstallPath = & $vswherePath -version $versionSearchStr -property installationPath
|
2018-02-05 17:23:34 +10:00
|
|
|
|
2019-10-06 14:14:54 -07:00
|
|
|
Write-Diagnostic "$($VS_OFFICIAL_VER)InstallPath: $VS2017InstallPath"
|
2018-02-05 17:23:34 +10:00
|
|
|
|
|
|
|
|
if(-not (Test-Path $VS2017InstallPath))
|
|
|
|
|
{
|
2019-10-06 14:14:54 -07:00
|
|
|
Die "Visual Studio $VS_OFFICIAL_VER is not installed on your development machine, unable to continue."
|
2018-02-05 17:23:34 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$MSBuildExe = "msbuild.exe"
|
2019-10-06 14:14:54 -07:00
|
|
|
$VisualStudioVersion = "$VS_VER.0"
|
2018-02-05 17:23:34 +10:00
|
|
|
$VXXCommonTools = Join-Path $VS2017InstallPath VC\Auxiliary\Build
|
|
|
|
|
}
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($VXXCommonTools -eq $null -or (-not (Test-Path($VXXCommonTools)))) {
|
|
|
|
|
Die 'Error unable to find any visual studio environment'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$VCVarsAll = Join-Path $VXXCommonTools vcvarsall.bat
|
|
|
|
|
if (-not (Test-Path $VCVarsAll)) {
|
|
|
|
|
Die "Unable to find $VCVarsAll"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Only configure build environment once
|
|
|
|
|
if($env:CEFSHARP_BUILD_IS_BOOTSTRAPPED -eq $null) {
|
|
|
|
|
Invoke-BatchFile $VCVarsAll $Platform
|
|
|
|
|
$env:CEFSHARP_BUILD_IS_BOOTSTRAPPED = $true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$Arch = TernaryReturn ($Platform -eq 'x64') 'x64' 'win32'
|
|
|
|
|
|
|
|
|
|
$Arguments = @(
|
|
|
|
|
"$CefSln",
|
|
|
|
|
"/t:rebuild",
|
|
|
|
|
"/p:VisualStudioVersion=$VisualStudioVersion",
|
|
|
|
|
"/p:Configuration=$Configuration",
|
2014-12-29 14:01:50 +10:00
|
|
|
"/p:Platform=$Arch",
|
2014-12-29 15:42:45 +10:00
|
|
|
"/verbosity:normal"
|
2014-10-02 20:17:24 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$StartInfo = New-Object System.Diagnostics.ProcessStartInfo
|
2015-01-20 13:16:25 +10:00
|
|
|
$StartInfo.FileName = $MSBuildExe
|
2014-10-02 20:17:24 +10:00
|
|
|
$StartInfo.Arguments = $Arguments
|
|
|
|
|
|
|
|
|
|
$StartInfo.EnvironmentVariables.Clear()
|
|
|
|
|
|
|
|
|
|
Get-ChildItem -Path env:* | ForEach-Object {
|
|
|
|
|
$StartInfo.EnvironmentVariables.Add($_.Name, $_.Value)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$StartInfo.UseShellExecute = $false
|
|
|
|
|
$StartInfo.CreateNoWindow = $false
|
2014-12-29 15:42:45 +10:00
|
|
|
$StartInfo.RedirectStandardError = $true
|
|
|
|
|
$StartInfo.RedirectStandardOutput = $true
|
2014-10-02 20:17:24 +10:00
|
|
|
|
|
|
|
|
$Process = New-Object System.Diagnostics.Process
|
|
|
|
|
$Process.StartInfo = $startInfo
|
2014-12-29 15:42:45 +10:00
|
|
|
$Process.Start()
|
|
|
|
|
|
|
|
|
|
$stdout = $Process.StandardOutput.ReadToEnd()
|
|
|
|
|
$stderr = $Process.StandardError.ReadToEnd()
|
|
|
|
|
|
2014-10-02 20:17:24 +10:00
|
|
|
$Process.WaitForExit()
|
|
|
|
|
|
2014-12-29 15:18:00 +10:00
|
|
|
if($Process.ExitCode -ne 0)
|
2014-12-29 15:42:45 +10:00
|
|
|
{
|
|
|
|
|
Write-Host "stdout: $stdout"
|
|
|
|
|
Write-Host "stderr: $stderr"
|
2014-10-02 20:17:24 +10:00
|
|
|
Die "Build failed"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function VSX
|
|
|
|
|
{
|
|
|
|
|
param(
|
2019-10-06 14:14:54 -07:00
|
|
|
[ValidateSet('v140', 'v141', 'v142')]
|
2014-10-02 20:17:24 +10:00
|
|
|
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
|
|
|
|
[string] $Toolchain
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "Starting to build targeting toolchain $Toolchain"
|
|
|
|
|
|
|
|
|
|
Msvs "$Toolchain" 'Release' 'x86'
|
|
|
|
|
Msvs "$Toolchain" 'Release' 'x64'
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "Finished build targeting toolchain $Toolchain"
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-02 20:24:49 +10:00
|
|
|
function NugetPackageRestore
|
|
|
|
|
{
|
2014-11-13 11:37:08 +10:00
|
|
|
$nuget = Join-Path $WorkingDir .\nuget\NuGet.exe
|
2014-10-02 20:24:49 +10:00
|
|
|
if(-not (Test-Path $nuget)) {
|
|
|
|
|
Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "Restore Nuget Packages"
|
|
|
|
|
|
|
|
|
|
# Restore packages
|
2014-10-02 20:26:27 +10:00
|
|
|
. $nuget restore $CefSln
|
2014-10-02 20:24:49 +10:00
|
|
|
}
|
|
|
|
|
|
2014-10-02 20:17:24 +10:00
|
|
|
function Nupkg
|
|
|
|
|
{
|
2014-11-18 14:20:37 +10:00
|
|
|
if (Test-Path Env:\APPVEYOR_PULL_REQUEST_NUMBER)
|
2014-11-18 12:22:21 +10:00
|
|
|
{
|
2014-11-18 14:20:37 +10:00
|
|
|
Write-Diagnostic "Pr Number: $env:APPVEYOR_PULL_REQUEST_NUMBER"
|
2014-11-18 14:21:43 +10:00
|
|
|
Write-Diagnostic "Skipping Nupkg"
|
|
|
|
|
return
|
2014-11-18 12:22:21 +10:00
|
|
|
}
|
|
|
|
|
|
2014-11-13 11:37:08 +10:00
|
|
|
$nuget = Join-Path $WorkingDir .\nuget\NuGet.exe
|
2014-10-02 20:17:24 +10:00
|
|
|
if(-not (Test-Path $nuget)) {
|
|
|
|
|
Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "Building nuget package"
|
|
|
|
|
|
2020-01-14 12:05:42 +10:00
|
|
|
# Build old packages
|
2017-01-06 15:01:39 +10:00
|
|
|
. $nuget pack nuget\CefSharp.Common.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget -Properties "RedistVersion=$RedistVersion"
|
|
|
|
|
. $nuget pack nuget\CefSharp.Wpf.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
|
|
|
|
. $nuget pack nuget\CefSharp.OffScreen.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
|
|
|
|
. $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
2020-01-14 12:05:42 +10:00
|
|
|
|
|
|
|
|
# Build newer style packages
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.Common.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "RedistVersion=$RedistVersion;Platform=x86;PlatformNative=Win32"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.Common.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "RedistVersion=$RedistVersion;Platform=x64;PlatformNative=x64"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.OffScreen.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "Platform=x86"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.OffScreen.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "Platform=x64"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.Wpf.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "Platform=x86"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.Wpf.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "Platform=x64"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.WinForms.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "Platform=x86"
|
|
|
|
|
. $nuget pack nuget\PackageReference\CefSharp.WinForms.win.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget\PackageReference -Properties "Platform=x64"
|
2014-10-14 10:58:16 +02:00
|
|
|
|
2014-11-03 18:19:39 +10:00
|
|
|
# Invoke `AfterBuild` script if available (ie. upload packages to myget)
|
|
|
|
|
if(-not (Test-Path $WorkingDir\AfterBuild.ps1)) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2014-10-14 10:58:16 +02:00
|
|
|
|
2014-11-03 18:19:39 +10:00
|
|
|
. $WorkingDir\AfterBuild.ps1 -Version $Version
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
|
|
|
|
|
2014-10-04 12:36:24 +10:00
|
|
|
function DownloadNuget()
|
|
|
|
|
{
|
2014-11-13 11:37:08 +10:00
|
|
|
$nuget = Join-Path $WorkingDir .\nuget\NuGet.exe
|
2014-10-04 12:36:24 +10:00
|
|
|
if(-not (Test-Path $nuget))
|
2014-11-03 18:19:39 +10:00
|
|
|
{
|
|
|
|
|
$client = New-Object System.Net.WebClient;
|
2017-11-29 21:47:39 +01:00
|
|
|
$client.DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', $nuget);
|
2014-11-03 18:19:39 +10:00
|
|
|
}
|
2014-10-04 12:36:24 +10:00
|
|
|
}
|
|
|
|
|
|
2017-01-06 15:01:39 +10:00
|
|
|
function UpdateSymbolsWithGitLink()
|
|
|
|
|
{
|
2017-01-09 12:35:13 +10:00
|
|
|
$gitlink = "GitLink.exe"
|
|
|
|
|
|
|
|
|
|
#Check for GitLink
|
|
|
|
|
if ((Get-Command $gitlink -ErrorAction SilentlyContinue) -eq $null)
|
|
|
|
|
{
|
|
|
|
|
#Download if not on path and not in Nuget folder (TODO: change to different folder)
|
|
|
|
|
$gitlink = Join-Path $WorkingDir .\nuget\GitLink.exe
|
|
|
|
|
if(-not (Test-Path $gitlink))
|
|
|
|
|
{
|
|
|
|
|
Write-Diagnostic "Downloading GitLink"
|
2019-08-02 10:26:29 +10:00
|
|
|
#Powershell is having problems download GitLink SSL/TLS error, force TLS 1.2
|
|
|
|
|
#https://stackoverflow.com/a/55809878/4583726
|
|
|
|
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12
|
2017-01-09 12:35:13 +10:00
|
|
|
$client = New-Object System.Net.WebClient;
|
|
|
|
|
$client.DownloadFile('https://github.com/GitTools/GitLink/releases/download/2.3.0/GitLink.exe', $gitlink);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Diagnostic "GitLink working dir : $WorkingDir"
|
|
|
|
|
|
|
|
|
|
# Run GitLink in the workingDir
|
2019-09-12 02:47:09 -07:00
|
|
|
. $gitlink $WorkingDir -f CefSharp3.sln -u https://github.com/CefSharp/CefSharp -c Release -p x64 -ignore CefSharp.Example`,CefSharp.Wpf.Example`,CefSharp.OffScreen.Example`,CefSharp.WinForms.Example
|
|
|
|
|
. $gitlink $WorkingDir -f CefSharp3.sln -u https://github.com/CefSharp/CefSharp -c Release -p x86 -ignore CefSharp.Example`,CefSharp.Wpf.Example`,CefSharp.OffScreen.Example`,CefSharp.WinForms.Example
|
2017-01-06 15:01:39 +10:00
|
|
|
}
|
|
|
|
|
|
2014-10-14 10:10:37 +02:00
|
|
|
function WriteAssemblyVersion
|
|
|
|
|
{
|
2014-11-03 18:19:39 +10:00
|
|
|
param()
|
|
|
|
|
|
|
|
|
|
$Filename = Join-Path $WorkingDir CefSharp\Properties\AssemblyInfo.cs
|
|
|
|
|
$Regex = 'public const string AssemblyVersion = "(.*)"';
|
2017-02-22 01:56:40 +01:00
|
|
|
$Regex2 = 'public const string AssemblyFileVersion = "(.*)"'
|
2019-02-15 21:40:25 +01:00
|
|
|
$Regex3 = 'public const string AssemblyCopyright = "Copyright © .* The CefSharp Authors"'
|
|
|
|
|
|
|
|
|
|
$AssemblyInfo = Get-Content -Encoding UTF8 $Filename
|
|
|
|
|
$CurrentYear = Get-Date -Format yyyy
|
2014-11-03 18:19:39 +10:00
|
|
|
|
2014-11-06 14:30:27 +10:00
|
|
|
$NewString = $AssemblyInfo -replace $Regex, "public const string AssemblyVersion = ""$AssemblyVersion"""
|
2019-04-11 05:45:32 +10:00
|
|
|
$NewString = $NewString -replace $Regex2, "public const string AssemblyFileVersion = ""$AssemblyVersion.0"""
|
2019-02-15 21:40:25 +01:00
|
|
|
$NewString = $NewString -replace $Regex3, "public const string AssemblyCopyright = ""Copyright © $CurrentYear The CefSharp Authors"""
|
2017-02-22 01:56:40 +01:00
|
|
|
|
2019-02-15 21:40:25 +01:00
|
|
|
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
|
|
|
|
|
[System.IO.File]::WriteAllLines($Filename, $NewString, $Utf8NoBomEncoding)
|
2017-02-22 01:56:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function WriteVersionToManifest($manifest)
|
|
|
|
|
{
|
|
|
|
|
$Filename = Join-Path $WorkingDir $manifest
|
|
|
|
|
$Regex = 'assemblyIdentity version="(.*?)"';
|
|
|
|
|
|
2019-02-15 21:40:25 +01:00
|
|
|
$ManifestData = Get-Content -Encoding UTF8 $Filename
|
2019-04-11 05:45:32 +10:00
|
|
|
$NewString = $ManifestData -replace $Regex, "assemblyIdentity version=""$AssemblyVersion.0"""
|
2017-02-22 01:56:40 +01:00
|
|
|
|
2019-02-15 21:40:25 +01:00
|
|
|
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
|
|
|
|
|
[System.IO.File]::WriteAllLines($Filename, $NewString, $Utf8NoBomEncoding)
|
2017-02-22 01:56:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function WriteVersionToResourceFile($resourceFile)
|
|
|
|
|
{
|
|
|
|
|
$Filename = Join-Path $WorkingDir $resourceFile
|
|
|
|
|
$Regex1 = 'VERSION .*';
|
|
|
|
|
$Regex2 = 'Version", ".*?"';
|
2019-02-15 21:40:25 +01:00
|
|
|
$Regex3 = 'Copyright © .* The CefSharp Authors'
|
|
|
|
|
|
|
|
|
|
$ResourceData = Get-Content -Encoding UTF8 $Filename
|
|
|
|
|
$CurrentYear = Get-Date -Format yyyy
|
2019-11-16 06:08:47 +10:00
|
|
|
#Assembly version with comma instead of dot
|
|
|
|
|
$CppAssemblyVersion = $AssemblyVersion -replace '\.', ','
|
2017-02-22 01:56:40 +01:00
|
|
|
|
2019-11-16 06:08:47 +10:00
|
|
|
$NewString = $ResourceData -replace $Regex1, "VERSION $CppAssemblyVersion"
|
2017-02-22 01:56:40 +01:00
|
|
|
$NewString = $NewString -replace $Regex2, "Version"", ""$AssemblyVersion"""
|
2019-02-15 21:40:25 +01:00
|
|
|
$NewString = $NewString -replace $Regex3, "Copyright © $CurrentYear The CefSharp Authors"
|
|
|
|
|
|
|
|
|
|
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
|
|
|
|
|
[System.IO.File]::WriteAllLines($Filename, $NewString, $Utf8NoBomEncoding)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function WriteVersionToShfbproj
|
|
|
|
|
{
|
|
|
|
|
$Filename = Join-Path $WorkingDir CefSharp.shfbproj
|
|
|
|
|
$Regex1 = '<HelpFileVersion>.*<\/HelpFileVersion>';
|
|
|
|
|
$Regex2 = '<HeaderText>Version .*<\/HeaderText>';
|
|
|
|
|
|
|
|
|
|
$ShfbprojData = Get-Content -Encoding UTF8 $Filename
|
|
|
|
|
$NewString = $ShfbprojData -replace $Regex1, "<HelpFileVersion>$AssemblyVersion</HelpFileVersion>"
|
|
|
|
|
$NewString = $NewString -replace $Regex2, "<HeaderText>Version $AssemblyVersion</HeaderText>"
|
|
|
|
|
|
|
|
|
|
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
|
|
|
|
|
[System.IO.File]::WriteAllLines($Filename, $NewString, $Utf8NoBomEncoding)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function WriteVersionToAppveyor
|
|
|
|
|
{
|
|
|
|
|
$Filename = Join-Path $WorkingDir appveyor.yml
|
|
|
|
|
$Regex1 = 'version: .*-CI{build}';
|
|
|
|
|
|
|
|
|
|
$AppveyorData = Get-Content -Encoding UTF8 $Filename
|
|
|
|
|
$NewString = $AppveyorData -replace $Regex1, "version: $AssemblyVersion-CI{build}"
|
2014-11-03 18:19:39 +10:00
|
|
|
|
2019-02-15 21:40:25 +01:00
|
|
|
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
|
|
|
|
|
[System.IO.File]::WriteAllLines($Filename, $NewString, $Utf8NoBomEncoding)
|
2014-10-14 10:10:37 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-07 08:14:49 +10:00
|
|
|
Write-Diagnostic "CEF Redist Version = $RedistVersion"
|
|
|
|
|
|
2014-10-04 12:36:24 +10:00
|
|
|
DownloadNuget
|
|
|
|
|
|
2014-10-02 20:24:49 +10:00
|
|
|
NugetPackageRestore
|
|
|
|
|
|
2014-10-14 10:10:37 +02:00
|
|
|
WriteAssemblyVersion
|
2019-02-15 21:40:25 +01:00
|
|
|
WriteVersionToShfbproj
|
|
|
|
|
WriteVersionToAppveyor
|
2014-10-14 10:10:37 +02:00
|
|
|
|
2017-02-22 01:56:40 +01:00
|
|
|
WriteVersionToManifest "CefSharp.BrowserSubprocess\app.manifest"
|
|
|
|
|
WriteVersionToManifest "CefSharp.OffScreen.Example\app.manifest"
|
|
|
|
|
WriteVersionToManifest "CefSharp.WinForms.Example\app.manifest"
|
|
|
|
|
WriteVersionToManifest "CefSharp.Wpf.Example\app.manifest"
|
|
|
|
|
|
|
|
|
|
WriteVersionToResourceFile "CefSharp.BrowserSubprocess.Core\Resource.rc"
|
|
|
|
|
WriteVersionToResourceFile "CefSharp.Core\Resource.rc"
|
|
|
|
|
|
2015-05-19 19:15:44 +10:00
|
|
|
switch -Exact ($Target)
|
|
|
|
|
{
|
2014-11-03 18:19:39 +10:00
|
|
|
"nupkg-only"
|
|
|
|
|
{
|
2014-10-02 20:17:24 +10:00
|
|
|
Nupkg
|
2017-01-06 15:01:39 +10:00
|
|
|
}
|
2017-01-09 12:35:13 +10:00
|
|
|
"gitlink"
|
2017-01-06 15:01:39 +10:00
|
|
|
{
|
|
|
|
|
UpdateSymbolsWithGitLink
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
2018-02-05 17:23:34 +10:00
|
|
|
"vs2015"
|
2014-11-03 18:19:39 +10:00
|
|
|
{
|
2018-02-05 17:23:34 +10:00
|
|
|
VSX v140
|
2017-01-09 12:35:13 +10:00
|
|
|
UpdateSymbolsWithGitLink
|
2015-05-19 19:15:44 +10:00
|
|
|
Nupkg
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
2018-02-05 17:23:34 +10:00
|
|
|
"vs2017"
|
2014-11-03 18:19:39 +10:00
|
|
|
{
|
2018-02-05 17:23:34 +10:00
|
|
|
VSX v141
|
2017-01-09 12:35:13 +10:00
|
|
|
UpdateSymbolsWithGitLink
|
2015-05-19 19:15:44 +10:00
|
|
|
Nupkg
|
2014-10-02 20:17:24 +10:00
|
|
|
}
|
2019-10-06 14:14:54 -07:00
|
|
|
"vs2019"
|
|
|
|
|
{
|
|
|
|
|
VSX v142
|
|
|
|
|
UpdateSymbolsWithGitLink
|
|
|
|
|
Nupkg
|
|
|
|
|
}
|
2017-10-06 08:09:51 +01:00
|
|
|
}
|