forked from qtproject/installer-framework
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from hjaltisan/installer_reorg
ChinaInstaller config option added
- Loading branch information
Showing
22 changed files
with
1,112 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
param | ||
( | ||
[switch]$DeepClean, | ||
[String]$ToolsPrefix = "C:", | ||
[String]$WinSdk = "10.0.17763.0", | ||
[String]$BuildToolsPrefix = "", | ||
[switch]$Verbose, | ||
[switch]$SkipCleaning, | ||
[switch]$SkipPreClean, | ||
[switch]$SkipPostClean | ||
) | ||
|
||
if ($Verbose) { | ||
$DebugPreference = 'Continue' | ||
} | ||
|
||
$DeepCleanSwitch = "" | ||
if ($DeepClean) { $DeepCleanSwitch = "-DeepClean" } | ||
$VerboseSwitch = "" | ||
if ($Verbose) { $VerboseSwitch = "-Verbose" } | ||
|
||
$jom = "$ToolsPrefix\jom\jom.exe" | ||
$qmake = "$ToolsPrefix\Qt_static\v5.12.7\bin\qmake.exe" | ||
$varsall = "C:\$BuildToolsPrefix\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" | ||
|
||
Write-Output "Start building installer framework" | ||
Write-Output "---" | ||
|
||
if (!(Test-Path $jom)) { | ||
Write-Output "Jom was not found at '$jom'! Exiting..." | ||
Return | ||
} else { | ||
Write-Debug "Jom was found at '$jom'." | ||
} | ||
if (!(Test-Path $qmake)) { | ||
Write-Output "Qmake was not found at '$qmake'! Exiting..." | ||
} else { | ||
Write-Debug "Qmake was found at '$qmake'." | ||
} | ||
if (!(Test-Path $varsall)) { | ||
Write-Output "vcvarsall not found at '$varsall'! Exiting..." | ||
} else { | ||
Write-Debug "vcvarsall was found at '$varsall'." | ||
} | ||
|
||
$buildDir = "$PSScriptRoot\build" | ||
|
||
if ($SkipCleaning -Or $SkipPreClean) { | ||
Write-Debug "Skipping pre cleaning" | ||
if (Test-Path $buildDir) { | ||
Remove-Item $buildDir -Force -Recurse | ||
Write-Debug "Build dir removed" | ||
} | ||
} else { | ||
Invoke-Expression -Command "$PSScriptRoot\clean.ps1 $DeepCleanSwitch $VerboseSwitch" | ||
} | ||
|
||
# Create the build folder | ||
if ($Verbose) { | ||
New-Item -Path $buildDir -ItemType "directory" | ||
} else { | ||
$null = New-Item -Path $buildDir -ItemType "directory" | ||
} | ||
Write-Debug "Build dir created" | ||
|
||
# Build the framework (this is done via bat because of vcvarsall) | ||
$buildHelper = """$PSScriptRoot\build_helper.bat"" ""$varsall"" $WinSdk ""$qmake"" ""$jom""" | ||
Write-Debug "Start creating the framework: $buildHelper" | ||
if ($Verbose) { | ||
cmd.exe /c $buildHelper | ||
} else { | ||
$null = cmd.exe /c $buildHelper | ||
} | ||
Write-Debug "Framework created" | ||
|
||
# Copy the output to the build folder | ||
Copy-Item "$PSScriptRoot\bin\binarycreator.exe" $buildDir | ||
Copy-Item "$PSScriptRoot\bin\installerbase.exe" $buildDir | ||
|
||
Write-Debug "Framework output to build" | ||
|
||
if ($SkipCleaning -Or $SkipPostClean) { | ||
Write-Debug "Skipping post cleaning" | ||
} else { | ||
Invoke-Expression -Command "$PSScriptRoot\clean.ps1 $DeepCleanSwitch $VerboseSwitch -SkipBuildDir" | ||
} | ||
|
||
Write-Output "---" | ||
Write-Output "Framework built successfully. You'll find it under \build" | ||
|
||
$DebugPreference = 'SilentlyContinue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
SETLOCAL | ||
|
||
CD /d %~dp0 | ||
|
||
SET VARSALL=%1 | ||
SET WINSDK=%2 | ||
SET QMAKE=%3 | ||
SET JOM=%4 | ||
|
||
rem Set up the required cmd environment | ||
call %VARSALL% x86 %WINSDK% | ||
|
||
rem Create the makefiles | ||
%QMAKE% -r | ||
|
||
rem Build the makefiles | ||
%JOM% release | ||
|
||
ENDLOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
param | ||
( | ||
[switch]$SkipBuildDir, | ||
[switch]$DeepClean, | ||
[switch]$Verbose | ||
) | ||
|
||
if ($Verbose) { | ||
$DebugPreference = 'Continue' | ||
} | ||
|
||
function RemoveDir ($dir) { | ||
if (Test-Path "$PSScriptRoot\$dir") { | ||
Remove-Item "$PSScriptRoot\$dir" -Force -Recurse | ||
Write-Debug " -> d: $dir" | ||
} | ||
} | ||
|
||
function RemoveFile ($file) { | ||
if (Test-Path "$PSScriptRoot\$file") { | ||
Remove-Item "$PSScriptRoot\$file" -Force | ||
Write-Debug " -> f: $file" | ||
} | ||
} | ||
|
||
Write-Debug "Cleanup starting" | ||
Write-Debug "Removing the following (f)iles and (d)irectories:" | ||
|
||
if (!$SkipBuildDir) { RemoveDir "build" } | ||
|
||
RemoveDir "bin" | ||
|
||
$baseFiles = ".qmake.stash", | ||
"src\libs\7zip\mocinclude.opt", | ||
"src\libs\installer\mocinclude.opt", | ||
"src\sdk\installerbase.qrc", | ||
"src\sdk\mocinclude.opt", | ||
"src\sdk\translations\ifw_en.ts", | ||
"tools\archivegen\mocinclude.opt", | ||
"tools\binarycreator\mocinclude.opt", | ||
"tools\devtool\mocinclude.opt", | ||
"tools\repocompare\mocinclude.opt", | ||
"tools\repogen\mocinclude.opt" | ||
|
||
foreach ($file in $baseFiles) { | ||
RemoveFile $file | ||
} | ||
|
||
# Remove the built translation files | ||
Get-ChildItem -Path "$PSScriptRoot\src\sdk\translations" *.qm | ForEach-Object { Remove-Item -Path $_.FullName -Force } | ||
|
||
if ($DeepClean) { | ||
Write-Debug "---" | ||
Write-Debug "Removing additional (f)iles and (d)irectories since -DeepClean was provided:" | ||
|
||
$sources = "libs\7zip", "libs\installer", "sdk", "sdk\translations" | ||
$tools = "archivegen", "binarycreator", "devtool", "repocompare", "repogen" | ||
$alldirs = @{ "src" = $sources; "tools" = $tools } | ||
|
||
foreach ($pair in $alldirs.GetEnumerator()) { | ||
RemoveFile "$($pair.Name)\Makefile" | ||
foreach ($subDir in ($pair.Value)) { | ||
# Dirs | ||
RemoveDir "$($pair.Name)\$subDir\debug" | ||
RemoveDir "$($pair.Name)\$subDir\release" | ||
|
||
# Files | ||
RemoveFile "$($pair.Name)\$subDir\Makefile" | ||
RemoveFile "$($pair.Name)\$subDir\Makefile.Debug" | ||
RemoveFile "$($pair.Name)\$subDir\Makefile.Release" | ||
|
||
if (($pair.Name) -eq "tools") { | ||
RemoveFile "$($pair.Name)\$tool\${tool}_plugin_import.cpp" | ||
} | ||
} | ||
} | ||
|
||
RemoveDir "lib" | ||
|
||
$additionalFiles = "src\libs\Makefile", | ||
"Makefile", | ||
"src\libs\installer\ui_authenticationdialog.h", | ||
"src\libs\installer\ui_proxycredentialsdialog.h", | ||
"src\libs\installer\ui_serverauthenticationdialog.h", | ||
"src\sdk\installerbase_plugin_import.cpp", | ||
"src\sdk\ui_settingsdialog.h", | ||
"tools\repocompare\ui_mainwindow.h" | ||
|
||
foreach ($file in $additionalFiles) { | ||
RemoveFile $file | ||
} | ||
} | ||
|
||
Write-Debug "---" | ||
Write-Debug "Cleanup completed" | ||
|
||
$DebugPreference = 'SilentlyContinue' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.