From 2a28ce864bed677e4ac2477eedf6bee498075d94 Mon Sep 17 00:00:00 2001 From: Heikki Halmet Date: Thu, 2 Nov 2017 16:09:11 +0200 Subject: Split Common folder based on operating system families MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change will split common folder to four different folders: Linux, Unix, Windows and MacOS. Each of these folders includes scripts which are common for their operating system familes Task-number: QTQAINFRA-1451 Change-Id: Ic93b2183052335dee875d1452b21e38d268b6474 Reviewed-by: Jędrzej Nowacki --- coin/provisioning/common/windows/03-conan.ps1 | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 coin/provisioning/common/windows/03-conan.ps1 (limited to 'coin/provisioning/common/windows/03-conan.ps1') diff --git a/coin/provisioning/common/windows/03-conan.ps1 b/coin/provisioning/common/windows/03-conan.ps1 new file mode 100644 index 00000000..2c9d9f8d --- /dev/null +++ b/coin/provisioning/common/windows/03-conan.ps1 @@ -0,0 +1,62 @@ +. "$PSScriptRoot\helpers.ps1" + +$scriptsPath = "C:\Python27\Scripts" + +& "$scriptsPath\pip.exe" install --upgrade conan==0.24.0 + +# Use Qt Project repository by default +& "$scriptsPath\conan.exe" remote add qtproject https://api.bintray.com/conan/qtproject/conan --insert + +[Environment]::SetEnvironmentVariable("CI_CONAN_BUILDINFO_DIR", "C:\Utils\conanbuildinfos", "Machine") + +function Start-Process-Logged +{ + Write-Host "Start-Process", $args + Start-Process @args +} + +function Run-Conan-Install +{ + Param ( + [string]$ConanfilesDir, + [string]$BuildinfoDir, + [string]$Arch, + [string]$Compiler, + [string]$CompilerVersion, + [string]$CompilerRuntime, + [string]$CompilerLibcxx + ) + + if ($CompilerRuntime) { + $extraArgs = "-s compiler.runtime=$($CompilerRuntime)" + } + + if ($CompilerLibcxx) { + $extraArgs = "-s compiler.libcxx=$($CompilerLibcxx)" + } + + $manifestsDir = "$PSScriptRoot\conan_manifests" + + Get-ChildItem -Path "$ConanfilesDir\*.txt" | + ForEach-Object { + $conanfile = $_.FullName + $outpwd = "C:\Utils\conanbuildinfos\$($BuildinfoDir)\$($_.BaseName)" + New-Item $outpwd -Type directory -Force + + $process = Start-Process-Logged ` + "$scriptsPath\conan.exe" ` + -WorkingDirectory $outpwd ` + -ArgumentList "install -f $conanfile --no-imports --verify $manifestsDir", ` + '-s', ('compiler="' + $Compiler + '"'), ` + "-s os=Windows -s arch=$Arch -s compiler.version=$CompilerVersion $extraArgs" ` + -NoNewWindow -Wait -Verbose ` + -PassThru # Return process object + + if ($process.ExitCode -ne 0) { + Write-Host "conan exited with code $($process.ExitCode)" + Exit(1) + } + + Copy-Item -Path $conanfile -Destination "$outpwd\conanfile.txt" + } +} -- cgit v1.2.3