Skip to content
Snippets Groups Projects
Commit eaad4a92 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

build script: parametrize Qt paths

Change-Id: I78e65eb6f9b17463d73bef3e0eb76c543966db0b
parent 2479542b
Branches
Tags
No related merge requests found
[cmdletbinding()] [cmdletbinding()]
param ( param (
[string]$qtver,
[string]$daemonDir, [string]$daemonDir,
[string]$lrcDir [string]$lrcDir
); );
write-host "copying runtime files..." write-host "Copying runtime files..." -ForegroundColor Green
$QtDir = "C:\Qt\5.9.4\msvc2017_64" # default values
$qtver = If ($qtver) {$qtver} Else {"5.9.4"}
$QtDir = "C:\Qt\$qtver\msvc2017_64"
$ClientDir = split-path -parent $MyInvocation.MyCommand.Definition $ClientDir = split-path -parent $MyInvocation.MyCommand.Definition
$OutDir = $ClientDir + "\x64\Release" $OutDir = $ClientDir + "\x64\Release"
New-Item -ItemType directory -Path $OutDir -Force If(!(test-path $OutDir)) { New-Item -ItemType directory -Path $OutDir -Force }
if (-not ($daemonDir)) { if (!$daemonDir) { $daemonDir = $ClientDir + '\..\daemon' }
$daemonDir = $ClientDir + '\..\daemon' if (!$lrcDir) { $lrcDir = $ClientDir + '\..\lrc' }
}
if (-not ($lrcDir)) { write-host "********************************************************************************" -ForegroundColor Magenta
$lrcDir = $ClientDir + '\..\lrc' write-host "using daemonDir: " $daemonDir -ForegroundColor Magenta
} write-host "using lrcDir: " $lrcDir -ForegroundColor Magenta
write-host "using QtDir: " $QtDir -ForegroundColor Magenta
write-host "********************************************************************************" -ForegroundColor Magenta
# dependency bin files # dependency bin files
$FilesToCopy = @( $FilesToCopy = @(
...@@ -37,7 +42,7 @@ $FilesToCopy = @( ...@@ -37,7 +42,7 @@ $FilesToCopy = @(
"$ClientDir\License.rtf" "$ClientDir\License.rtf"
) )
foreach ($i in $FilesToCopy) { foreach ($i in $FilesToCopy) {
write-host "copying: " $i " => " $OutDir write-host "copying: " $i " => " $OutDir -ForegroundColor Cyan
Copy-Item -Path $i -Destination $OutDir -Force Copy-Item -Path $i -Destination $OutDir -Force
} }
...@@ -77,7 +82,7 @@ $FilesToCopy = @( ...@@ -77,7 +82,7 @@ $FilesToCopy = @(
"$QtDir\resources\icudtl.dat" "$QtDir\resources\icudtl.dat"
) )
foreach ($i in $FilesToCopy) { foreach ($i in $FilesToCopy) {
write-host "copying: " $i " => " $OutDir write-host "copying: " $i " => " $OutDir -ForegroundColor Cyan
Copy-Item -Path $i -Destination $OutDir -Force Copy-Item -Path $i -Destination $OutDir -Force
} }
...@@ -89,33 +94,33 @@ $FilesToCopy = @( ...@@ -89,33 +94,33 @@ $FilesToCopy = @(
"$QtDir\plugins\imageformats\qsvg.dll" "$QtDir\plugins\imageformats\qsvg.dll"
) )
$CopyDir = $OutDir + "\imageformats" $CopyDir = $OutDir + "\imageformats"
New-Item -ItemType directory -Path $CopyDir -Force If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
foreach ($i in $FilesToCopy) { foreach ($i in $FilesToCopy) {
write-host "copying: " $i " => " $CopyDir write-host "copying: " $i " => " $CopyDir -ForegroundColor Cyan
Copy-Item -Path $i -Destination $CopyDir -Force Copy-Item -Path $i -Destination $CopyDir -Force
} }
# qt platform dll for windows # qt platform dll for windows
$CopyDir = $OutDir + "\platforms" $CopyDir = $OutDir + "\platforms"
New-Item -ItemType directory -Path $CopyDir -Force If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
$file = "$QtDir\plugins\platforms\qwindows.dll" $file = "$QtDir\plugins\platforms\qwindows.dll"
write-host "copying: " $file " => " $CopyDir write-host "copying: " $file " => " $CopyDir -ForegroundColor Cyan
Copy-Item -Path $file -Destination $CopyDir -Force Copy-Item -Path $file -Destination $CopyDir -Force
# qt sql driver # qt sql driver
$CopyDir = $OutDir + "\sqldrivers" $CopyDir = $OutDir + "\sqldrivers"
New-Item -ItemType directory -Path $CopyDir -Force If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
$file = "$QtDir\plugins\sqldrivers\qsqlite.dll" $file = "$QtDir\plugins\sqldrivers\qsqlite.dll"
write-host "copying: " $file " => " $CopyDir write-host "copying: " $file " => " $CopyDir -ForegroundColor Cyan
Copy-Item -Path $file -Destination $CopyDir -Force Copy-Item -Path $file -Destination $CopyDir -Force
# ringtones # ringtones
$CopyDir = $OutDir + "\ringtones" $CopyDir = $OutDir + "\ringtones"
New-Item -ItemType directory -Path $CopyDir -Force If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
$RingtonePath = "$ClientDir\..\daemon\ringtones" $RingtonePath = "$ClientDir\..\daemon\ringtones"
write-host "copying ringtones..." write-host "copying ringtones..."
Get-ChildItem -Path $RingtonePath -Include *.ul, *.ogg, *.wav, *.opus -Recurse | ForEach-Object { Get-ChildItem -Path $RingtonePath -Include *.ul, *.ogg, *.wav, *.opus -Recurse | ForEach-Object {
write-host "copying ringtone: " $_.FullName " => " $CopyDir write-host "copying ringtone: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
} }
...@@ -128,10 +133,10 @@ Get-ChildItem -Path $lrcTSPath -Include *.ts -Recurse | ForEach-Object { ...@@ -128,10 +133,10 @@ Get-ChildItem -Path $lrcTSPath -Include *.ts -Recurse | ForEach-Object {
& $lrelease $_.FullName & $lrelease $_.FullName
} }
$CopyDir = $OutDir + "\share\libringclient\translations" $CopyDir = $OutDir + "\share\libringclient\translations"
New-Item -ItemType directory -Path $CopyDir -Force If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
write-host "copying ringtones..." write-host "copying lrc translations..."
Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object { Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
write-host "copying translation file: " $_.FullName " => " $CopyDir write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
} }
...@@ -141,11 +146,11 @@ Get-ChildItem -Path $clientTSPath -Include *.ts -Recurse | ForEach-Object { ...@@ -141,11 +146,11 @@ Get-ChildItem -Path $clientTSPath -Include *.ts -Recurse | ForEach-Object {
& $lrelease $_.FullName & $lrelease $_.FullName
} }
$CopyDir = $OutDir + "\share\ring\translations" $CopyDir = $OutDir + "\share\ring\translations"
New-Item -ItemType directory -Path $CopyDir -Force If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
write-host "copying ringtones..." write-host "copying client translations..."
Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object { Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object {
write-host "copying translation file: " $_.FullName " => " $CopyDir write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
} }
write-host "copy completed" -NoNewline write-host "copy completed" -NoNewline -ForegroundColor Green
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment