-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added command line support for using local CEF builds #44
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,16 @@ param( | |
[Parameter(Position = 0)] | ||
[string] $Target = "nupkg", | ||
|
||
[ValidateSet("none", "download", "local")] | ||
[Parameter(Position = 1)] | ||
[bool]$DownloadBinary = $true | ||
[string] $DownloadBinary = "download", | ||
|
||
[Parameter(Position = 2)] | ||
# absolute or relative path to directory containing cef binaries archives (used if DownloadBinary = local) | ||
[string] $CefBinaryDir = "../cefsource/chromium/src/cef/binary_distrib/", | ||
|
||
[Parameter(Position = 3)] | ||
$CefVersion = "3.2883.1552.g88ff29a" | ||
) | ||
|
||
$WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition | ||
|
@@ -18,7 +26,6 @@ $Cef32vcx = Join-Path (Join-Path $Cef32 'libcef_dll_wrapper') 'libcef_dll_wrappe | |
$Cef64 = Join-Path $WorkingDir 'cef_binary_3.y.z_windows64' | ||
$Cef64vcx = Join-Path (Join-Path $Cef64 'libcef_dll_wrapper') 'libcef_dll_wrapper.vcxproj' | ||
|
||
$CefVersion = "3.2883.1552.g88ff29a" | ||
# Take the cef version and strip the commit hash | ||
$CefPackageVersion = $CefVersion.SubString(0, $CefVersion.LastIndexOf('.')) | ||
|
||
|
@@ -444,6 +451,80 @@ function DownloadCefBinaryAndUnzip() | |
} | ||
} | ||
|
||
function CopyFromLocalCefBuild() | ||
{ | ||
# Example file names from cefsource build: | ||
# 32-bit: cef_binary_3.2924.1538.gbfdeccd_windows32.tar.bz2 | ||
# 64-bit: cef_binary_3.2924.1538.gbfdeccd_windows64.tar.bz2 | ||
|
||
Write-Host $CefVersion | ||
|
||
$Cef32FileName = "cef_binary_$($CefVersion)_windows32.tar.bz2" | ||
$Cef64FileName = "cef_binary_$($CefVersion)_windows64.tar.bz2" | ||
|
||
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe" | ||
|
||
if ([System.IO.Path]::IsPathRooted($CefBinaryDir)) | ||
{ | ||
$CefBuildDir = $CefBinaryDir | ||
} | ||
else | ||
{ | ||
$CefBuildDir = Join-Path $WorkingDir "$CefBinaryDir/" | ||
} | ||
|
||
$LocalFile = Join-Path $WorkingDir $Cef32FileName | ||
|
||
if(-not (Test-Path $LocalFile)) | ||
{ | ||
Write-Diagnostic "Copy $Cef32FileName (approx 200mb)" | ||
Copy-Item ($CefBuildDir+$Cef32FileName) $LocalFile | ||
Write-Diagnostic "Copy of $Cef32FileName complete" | ||
} | ||
|
||
if(-not (Test-Path (Join-Path $Cef32 '\include\cef_version.h'))) | ||
{ | ||
# Extract bzip file | ||
sz e $LocalFile | ||
# Extract tar file | ||
$TarFile = ($LocalFile).Substring(0, $LocalFile.length - 4) | ||
sz x $TarFile | ||
#Sleep for a short period to allow 7z to release it's file handles | ||
sleep -m 2000 | ||
#Remove tar file | ||
Remove-Item $TarFile | ||
$Folder = Join-Path $WorkingDir ($Cef32FileName.Substring(0, $Cef32FileName.length - 8)) | ||
Move-Item ($Folder + '\*') $Cef32 -force | ||
Remove-Item $Folder | ||
} | ||
|
||
$LocalFile = Join-Path $WorkingDir $Cef64FileName | ||
|
||
if(-not (Test-Path $LocalFile)) | ||
{ | ||
|
||
Write-Diagnostic "Copy $Cef64FileName (approx 200mb)" | ||
Copy-Item ($CefBuildDir+$Cef64FileName) $LocalFile; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation |
||
Write-Diagnostic "Copy of $Cef64FileName complete" | ||
} | ||
|
||
if(-not (Test-Path (Join-Path $Cef64 '\include\cef_version.h'))) | ||
{ | ||
# Extract bzip file | ||
sz e $LocalFile | ||
# Extract tar file | ||
$TarFile = ($LocalFile).Substring(0, $LocalFile.length - 4) | ||
sz x $TarFile | ||
#Sleep for a short period to allow 7z to release it's file handles | ||
sleep -m 2000 | ||
#Remove tar file | ||
Remove-Item $TarFile | ||
$Folder = Join-Path $WorkingDir ($Cef64FileName.Substring(0, $Cef64FileName.length - 8)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation is out. Assuming you copied this and the original indentation is out and you have time please fix that also. |
||
Move-Item ($Folder + '\*') $Cef64 -force | ||
Remove-Item $Folder | ||
} | ||
} | ||
|
||
function CheckDependencies() | ||
{ | ||
#Check for cmake | ||
|
@@ -461,9 +542,18 @@ function CheckDependencies() | |
|
||
CheckDependencies | ||
|
||
if($DownloadBinary) | ||
switch -Exact ($DownloadBinary) | ||
{ | ||
DownloadCefBinaryAndUnzip | ||
"none" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brace on new line |
||
} | ||
"download" | ||
{ | ||
DownloadCefBinaryAndUnzip | ||
} | ||
"local" | ||
{ | ||
CopyFromLocalCefBuild | ||
} | ||
} | ||
|
||
DownloadNuget | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation