aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/windows')
-rw-r--r--coin/provisioning/common/windows/android-openssl.ps14
-rw-r--r--coin/provisioning/common/windows/android.ps17
-rw-r--r--coin/provisioning/common/windows/helpers.ps122
-rw-r--r--coin/provisioning/common/windows/install-breakpad.ps194
-rw-r--r--coin/provisioning/common/windows/install-protobuf.ps164
-rw-r--r--coin/provisioning/common/windows/msys.ps116
-rw-r--r--coin/provisioning/common/windows/opcua_unifiedautomation.ps171
-rw-r--r--coin/provisioning/common/windows/open62541.ps1265
8 files changed, 251 insertions, 292 deletions
diff --git a/coin/provisioning/common/windows/android-openssl.ps1 b/coin/provisioning/common/windows/android-openssl.ps1
index 5390dfae..cf144c90 100644
--- a/coin/provisioning/common/windows/android-openssl.ps1
+++ b/coin/provisioning/common/windows/android-openssl.ps1
@@ -53,10 +53,6 @@ Rename-Item C:\Utils\openssl-$version $destination
Remove-Item -Path $zip
Remove-Item C:\Utils\openssl-$version.tar
-Set-EnvironmentVariable "CC" "C:\utils\Android\android-ndk-r18b\toolchains\llvm\prebuilt\windows\bin\clang"
-Set-EnvironmentVariable "AR" "C:\utils\Android\android-ndk-r18b\toolchains\llvm\prebuilt\windows\bin\llvm-ar"
-Set-EnvironmentVariable "ANDROID_DEV" "C:\utils\Android\android-ndk-r18b\platforms\android-21\arch-arm\usr"
-
# Make sure configure for openssl has a "make" and "perl" available
$env:PATH = $env:PATH + ";C:\msys\1.0\bin;C:\strawberry\perl\bin"
diff --git a/coin/provisioning/common/windows/android.ps1 b/coin/provisioning/common/windows/android.ps1
index 90c33fbd..1b4dd35d 100644
--- a/coin/provisioning/common/windows/android.ps1
+++ b/coin/provisioning/common/windows/android.ps1
@@ -85,7 +85,7 @@ if (IsProxyEnabled) {
# Remove "http://" from the beginning
$proxy = $proxy.Remove(0,7)
$proxyhost,$proxyport = $proxy.split(':')
- $sdkmanager_args = "--no_https --proxy=http --proxy_host=`"$proxyhost`" --proxy_port=`"$proxyport`" "
+ $sdkmanager_args = "--no_https", "--proxy=http", "--proxy_host=`"$proxyhost`"", "--proxy_port=`"$proxyport`""
}
New-Item -ItemType Directory -Force -Path C:\Utils\Android\licenses
@@ -95,9 +95,10 @@ Out-File -FilePath C:\Utils\Android\licenses\android-sdk-license -Encoding utf8
# Get a PATH where Java's path is defined from previous provisioning
[Environment]::SetEnvironmentVariable("PATH", [Environment]::GetEnvironmentVariable("PATH", "Machine"), "Process")
-$sdkmanager_args += " platforms;$sdkApiLevel platform-tools build-tools;$sdkBuildToolsVersion"
-Run-Executable "$toolsFolder\bin\sdkmanager.bat" "$sdkmanager_args"
cd $toolsFolder\bin\
+$sdkmanager_args += "platforms;$sdkApiLevel", "platform-tools", "build-tools;$sdkBuildToolsVersion"
+$command = 'for($i=0;$i -lt 6;$i++) { $response += "y`n"}; $response | .\sdkmanager.bat @sdkmanager_args'
+iex $command
$command = 'for($i=0;$i -lt 6;$i++) { $response += "y`n"}; $response | .\sdkmanager.bat --licenses'
iex $command
cmd /c "dir C:\Utils\android"
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1
index cbf2371f..76ad4867 100644
--- a/coin/provisioning/common/windows/helpers.ps1
+++ b/coin/provisioning/common/windows/helpers.ps1
@@ -35,6 +35,28 @@ function Run-Executable
}
}
+function Extract-tar_gz
+{
+ Param (
+ [string]$Source,
+ [string]$Destination
+ )
+ Write-Host "Extracting '$Source' to '$Destination'..."
+
+ if ((Get-Command "7z.exe" -ErrorAction SilentlyContinue) -eq $null) {
+ $zipExe = join-path (${env:ProgramFiles(x86)}, ${env:ProgramFiles}, ${env:ProgramW6432} -ne $null)[0] '7-zip\7z.exe'
+ if (-not (test-path $zipExe)) {
+ $zipExe = "C:\Utils\sevenzip\7z.exe"
+ if (-not (test-path $zipExe)) {
+ throw "Could not find 7-zip."
+ }
+ }
+ } else {
+ $zipExe = "7z.exe"
+ }
+ Run-Executable "cmd.exe" "/C $zipExe x -y `"$Source`" -so | $zipExe x -y -aoa -si -ttar `"-o$Destination`""
+}
+
function Extract-7Zip
{
Param (
diff --git a/coin/provisioning/common/windows/install-breakpad.ps1 b/coin/provisioning/common/windows/install-breakpad.ps1
new file mode 100644
index 00000000..4a9544cc
--- /dev/null
+++ b/coin/provisioning/common/windows/install-breakpad.ps1
@@ -0,0 +1,94 @@
+############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the provisioning scripts of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL21$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## $QT_END_LICENSE$
+##
+############################################################################
+
+# This script install breakpad from sources.
+# for manual install.. remember to checkout correct version
+# git clone https://chromium.googlesource.com/breakpad/breakpad
+# git clone https://chromium.googlesource.com/linux-syscall-support breakpad/src/third_party/lss
+
+# Commit used to make this zip breakpad_20181113.tar.gz
+# breakpad
+# commit 66571f4838b2306161f072555cb199049bc68142 (HEAD -> master, origin/master, origin/HEAD)
+# linux-syscall-support
+# commit 93426bda6535943ff1525d0460aab5cc0870ccaf (HEAD -> master, origin/master, origin/HEAD)
+
+# This script installs breakpad.
+
+
+. "$PSScriptRoot\helpers.ps1"
+
+
+$breakpad_commit_sha="b988fa74ec18de6214b18f723e48331d9a7802ae"
+$breakpad_tar="breakpad_$breakpad_commit_sha.tar.gz"
+$breakpad_tar_url="http://ci-files01-hki.intra.qt.io/input/breakpad/$breakpad_tar"
+$breakpad_tar_sha="a2d404d2aebc947cdac5840a9bccd65dfafae24c"
+
+$linux_syscall_support_commit_sha1="93426bda6535943ff1525d0460aab5cc0870ccaf"
+$linux_syscall_support_tar="linux-syscall-support_$linux_syscall_support_commit_sha1.tar.gz"
+$linux_syscall_support_tar_url="http://ci-files01-hki.intra.qt.io/input/linux-syscall-support/$linux_syscall_support_tar"
+$linux_syscall_support_tar_sha="62565be0920f3661e138d68026b79fbbdc2a11e4"
+
+$targetBreakpad="$env:tmp\$breakpad_tar"
+$targetSyscall="$env:tmp\$linux_syscall_support_tar"
+$installFolder = "C:\Utils"
+
+# breakpad
+try {
+ Download $breakpad_tar_url $breakpad_tar_url $targetBreakpad
+ Verify-Checksum $targetBreakpad $breakpad_tar_sha
+ Extract-tar_gz $targetBreakpad $installFolder
+ Remove-Item -Path $targetBreakpad
+ # linux-syscall-support
+ Download $linux_syscall_support_tar_url $linux_syscall_support_tar_url $targetSyscall
+ Verify-Checksum $targetSyscall $linux_syscall_support_tar_sha
+ Extract-tar_gz $targetSyscall "$env:tmp\"
+ New-Item -ItemType directory -Path "$installFolder\breakpad\third_party\lss"
+ Get-ChildItem -Path "$env:tmp\linux-syscall-support\*" -Recurse | Move-Item -Destination "$installFolder\breakpad\third_party\lss"
+ Remove-Item -Path $targetSyscall
+}
+catch {
+ Write-Host "Cached download failed: Attempping fallback method eg git."
+ Set-Location $installFolder
+ git.exe clone "https://chromium.googlesource.com/breakpad/breakpad"
+ git.exe clone "https://chromium.googlesource.com/linux-syscall-support breakpad\third_party\ssl"
+ Set-Location "breakpad"
+ git checkout $breakpad_commit_sha
+ Set-Location "src/third_party/lss"
+ git checkout $linux_syscall_support_commit_sha1
+}
+
+Set-EnvironmentVariable "BREAKPAD_SOURCE_DIR" "$installFolder\breakpad\src"
+
+# Write HEAD commit sha to versions txt, so build can be repeated at later date
+Write-Output "breakpad = $breakpad_commit_sha" >> ~/versions.txt
+Write-Output "linux-syscall-support = $linux_syscall_support_tar" >> ~/versions.txt
diff --git a/coin/provisioning/common/windows/install-protobuf.ps1 b/coin/provisioning/common/windows/install-protobuf.ps1
new file mode 100644
index 00000000..fd3fb3d3
--- /dev/null
+++ b/coin/provisioning/common/windows/install-protobuf.ps1
@@ -0,0 +1,64 @@
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the provisioning scripts of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL21$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+. "$PSScriptRoot\helpers.ps1"
+
+# This script will install Google's Protocol Buffers
+# Script requires Cmake to be installed and strawberry-perl not to be installed
+
+$version = "3.6.1"
+$sha1 = "44b8ba225f3b4dc45fb56d5881ec6a91329802b6"
+$officialUrl = "https://github.com/protocolbuffers/protobuf/releases/download/v$version/protobuf-all-$version.zip"
+$cachedUrl = "http://ci-files01-hki.ci.local/input/automotive_suite/protobuf-all-$version.zip"
+$zip = "C:\Utils\protobuf-all-$version.zip"
+$installationFolder = "C:\Utils\protobuf"
+
+Write-Host "Installing Protocol Buffers"
+Add-Path "C:\CMake\bin"
+Download "$officialUrl" "$cachedUrl" "$zip"
+Verify-Checksum "$zip" "$sha1"
+Extract-7Zip "$zip" C:\Utils
+New-Item -ItemType directory -Force -Path "C:\Utils\protobuf-$version\cmake\build"
+New-Item -ItemType directory -Force -Path "C:\Utils\protobuf-$version\cmake\build\release"
+New-Item -ItemType directory -Force -Path "$installationFolder"
+cd "C:\Utils\protobuf-$version\cmake\build\release"
+cmd /c "`"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Auxiliary\\Build\\vcvars64.bat`" && cmake -G `"NMake Makefiles`" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$installationFolder ../.. && nmake && nmake install"
+if(![System.IO.File]::Exists("$installationFolder\bin\protoc.exe")){
+ Write-Host "Can't find $installationFolder\bin\protoc.exe. Installation probably failed!"
+ exit 1
+}
+
+Remove-Item "$zip"
+
+Add-Path "$installationFolder\bin"
+Set-EnvironmentVariable PROTOBUF_INCLUDE "$installationFolder\include"
+Set-EnvironmentVariable PROTOBUF_LIB "$installationFolder\lib"
diff --git a/coin/provisioning/common/windows/msys.ps1 b/coin/provisioning/common/windows/msys.ps1
new file mode 100644
index 00000000..df67cc20
--- /dev/null
+++ b/coin/provisioning/common/windows/msys.ps1
@@ -0,0 +1,16 @@
+. "$PSScriptRoot\helpers.ps1"
+
+# This script will install msys which is needed for configuring openssl for Android
+
+$version = "1.0.11"
+$url = "\\ci-files01-hki.intra.qt.io\provisioning\windows\msys-$version.7z"
+
+$zip = Get-DownloadLocation ("msys-$version.7z")
+$sha1 = "22cd76f1263db8c72727a9537228c481ff33c285"
+$destination = "C:\msys"
+
+Download $url $url $zip
+Verify-Checksum $zip $sha1
+C:\Utils\sevenzip\7z.exe x $zip -oC:\
+
+Write-Output "Msys = $version" >> ~/versions.txt
diff --git a/coin/provisioning/common/windows/opcua_unifiedautomation.ps1 b/coin/provisioning/common/windows/opcua_unifiedautomation.ps1
index aff784b9..70fcaae0 100644
--- a/coin/provisioning/common/windows/opcua_unifiedautomation.ps1
+++ b/coin/provisioning/common/windows/opcua_unifiedautomation.ps1
@@ -1,6 +1,6 @@
#############################################################################
##
-## Copyright (C) 2018 The Qt Company Ltd.
+## Copyright (C) 2019 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the provisioning scripts of the Qt Toolkit.
@@ -33,27 +33,58 @@
. "$PSScriptRoot\helpers.ps1"
-$zip = Get-DownloadLocation "uasdkcpp.zip"
-$sha1 = "e1927dbd5d8bb459b468fa70a70b1de51a4ce022"
-$installLocation = "C:\Utils\uacpp"
+function DownloadAndInstallUA
+{
+ Param (
+ [string] $InstallerFileName = $(BadParam("no download URL specified")),
+ [string] $sha1 = $(BadParam("No SHA1 for download specified")),
+ [string] $Destination = $(BadParam("No location to install specified"))
+ )
+ Write-Host "UACPPSDK: DownloadAndInstallUA $InstallerFileName"
+ $zip = Get-DownloadLocation "uasdkcpp.zip"
-Write-Host "UACPPSDK: Downloading Unified Automation CPP installer..."
-$internalUrl = "http://ci-files01-hki.intra.qt.io/input/opcua_uacpp/uasdkcppbundle-bin-EVAL-win32-x86-vs2015-v1.5.6-361.zip"
-# No public download link exists
-$externalUrl = $internalUrl
+ Write-Host "UACPPSDK: Downloading Unified Automation CPP installer..."
+ $internalUrl = "http://ci-files01-hki.intra.qt.io/input/opcua_uacpp/$InstallerFileName.zip"
+ # No public download link exists
+ $externalUrl = $internalUrl
-Download $externalUrl $internalUrl $zip
-Verify-Checksum $zip $sha1
+ Download $externalUrl $internalUrl $zip
+ Verify-Checksum $zip $sha1
-Write-Host "UACPPSDK: Installing $zip..."
-Extract-7Zip $zip (Get-DefaultDownloadLocation)
-Remove-Item -Path $zip
+ Write-Host "UACPPSDK: Extracting $zip..."
+ Extract-7Zip $zip (Get-DefaultDownloadLocation)
+ Remove-Item -Path $zip
-$executable = (Get-DefaultDownloadLocation) + "uasdkcppbundle-bin-EVAL-win32-x86-vs2015-v1.5.6-361.exe"
-$arguments = "/S /D=$installLocation"
-Run-Executable $executable $arguments
-Write-Host "UACPPSDK: Installer done."
-Remove-Item $executable
+ $executable = (Get-DefaultDownloadLocation) + "$InstallerFileName.exe"
+ # We cannot call the installer as the x86 and x64 versions of the installer are not
+ # allowed to be installed in parallel (they check for the same registry value and
+ # delete each other). Extracting does not have a side-effect for Qt
+ #$arguments = "/S /D=$installLocation"
+ #Run-Executable $executable $arguments
+ #Write-Host "UACPPSDK: Installer done."
+ #Remove-Item $executable
-Write-Host "Set environment variable for COIN to locate SDK"
-Set-EnvironmentVariable "CI_UACPP_msvc2015_x86_PREFIX" "$installLocation"
+ Extract-7Zip $executable $Destination
+ Remove-Item $executable
+}
+
+#x86 version
+$installerName86 = "uasdkcppbundle-bin-EVAL-win32-x86-vs2015-v1.6.3-406"
+$downloadSha86 = "C73278B4C10DF0E3D60ABAA159ABA9185095124C"
+$installLocation86 = "C:\Utils\uacpp_x86"
+
+DownloadAndInstallUA $installerName86 $downloadSha86 $installLocation86
+Set-EnvironmentVariable "CI_UACPP_msvc2015_x86_PREFIX" "$installLocation86"
+# For UA msvc2015 is binary compatible with msvc2017
+Set-EnvironmentVariable "CI_UACPP_msvc2017_x86_PREFIX" "$installLocation86"
+
+
+#x64 version
+$installerName64 = "uasdkcppbundle-bin-EVAL-win64-x86_64-vs2015-v1.6.3-406"
+$downloadSha64 = "1384e6882644f9163e9840aee962cdb9ca3398c8"
+$installLocation64 = "C:\Utils\uacpp_x64"
+
+DownloadAndInstallUA $installerName64 $downloadSha64 $installLocation64
+Set-EnvironmentVariable "CI_UACPP_msvc2015_x64_PREFIX" "$installLocation64"
+# For UA msvc2015 is binary compatible with msvc2017
+Set-EnvironmentVariable "CI_UACPP_msvc2017_x64_PREFIX" "$installLocation64"
diff --git a/coin/provisioning/common/windows/open62541.ps1 b/coin/provisioning/common/windows/open62541.ps1
deleted file mode 100644
index b7eceb4d..00000000
--- a/coin/provisioning/common/windows/open62541.ps1
+++ /dev/null
@@ -1,265 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2018 The Qt Company Ltd.
-## Contact: http://www.qt.io/licensing/
-##
-## This file is part of the provisioning scripts of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:LGPL21$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see http://www.qt.io/terms-conditions. For further
-## information use the contact form at http://www.qt.io/contact-us.
-##
-## GNU Lesser General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU Lesser
-## General Public License version 2.1 or version 3 as published by the Free
-## Software Foundation and appearing in the file LICENSE.LGPLv21 and
-## LICENSE.LGPLv3 included in the packaging of this file. Please review the
-## following information to ensure the GNU Lesser General Public License
-## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-##
-## As a special exception, The Qt Company gives you certain additional
-## rights. These rights are described in The Qt Company LGPL Exception
-## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-Param (
- [string]$targetCommand= ""
- )
-
-. "$PSScriptRoot\helpers.ps1"
-
-## Variables for builds
-$commitSHA = "215651ab8db94e5eacdd10ec26a5a9fb96b9301f"
-$sha1 = "8d899f986071525be73e1ee8565b28ea10536d7d"
-$extractTarget = "C:\open62541_build"
-
-function CreateArchive
-{
- param(
- [string]$sourceDirectory=$(throw("You must specify a directory")),
- [string]$archiveName=$(throw("You must specify an archive name"))
- )
-
- if ((Get-Command "7z.exe" -ErrorAction SilentlyContinue) -eq $null) {
- $zipExe = join-path (${env:ProgramFiles(x86)}, ${env:ProgramFiles}, ${env:ProgramW6432} -ne $null)[0] '7-zip\7z.exe'
- if (-not (test-path $zipExe)) {
- $zipExe = "C:\Utils\sevenzip\7z.exe"
- if (-not (test-path $zipExe)) {
- throw "Could not find 7-zip."
- }
- }
- } else {
- $zipExe = "7z.exe"
- }
-
- Run-Executable $zipExe "a -y `"$archiveName`" `"$sourceDirectory`""
-}
-
-function PrepareRepository
-{
- $username = $env:USERNAME
- $zip = "c:\users\$username\downloads\open62541.zip"
-
- $externalUrl = "https://github.com/open62541/open62541/archive/$commitSHA.zip"
- $internalUrl = "http://ci-files01-hki.intra.qt.io/input/open62541/$commitSHA.zip"
-
- Download $externalUrl $internalUrl $zip
- Verify-Checksum $zip $sha1
-
- Extract-7Zip $zip $extractTarget
-}
-
-function PushDevEnvironment
-{
- # Provisioning updates the registry entries for PATH etc. However, they are not
- # propagated to the next provisioning script and hence need to be manually
- # read / set.
- $adaptedPath = $env:PATH
- $jomLocation = [Environment]::GetEnvironmentVariable("CI_JOM_PATH", "Machine")
- $adaptedPath = $adaptedPath + ";" + $jomLocation
- $adaptedPath = $adaptedPath + ";" + "C:\Python27"
- $adaptedPath = $adaptedPath + ";" + "C:\CMake\bin"
- [Environment]::SetEnvironmentVariable("PATH", $adaptedPath, "Process")
-}
-
-function MSVCEnvironment
-{
- Param (
- [string]$msvcDir=$(throw("No VS Directory specified")),
- [string]$msvcbat=$(throw("No vsvars batch file specified"))
- )
-
- Push-Location $msvcDir
- cmd /c "$msvcbat&set" |
- foreach {
- if ($_ -match "=") {
- $v = $_.split("="); Set-Item -force -path "ENV:\$($v[0])" -value "$($v[1])"
- }
- }
- Pop-Location
-}
-
-function BuildAndInstallOpen62541
-{
- Param (
- [string]$Type=$(throw("You must specify the dev type [mingw530, mingw630, mingw730, msvc2015, msvc2017]")),
- [string]$Platform=$(throw("You must specify the target platform [x86, x64]")),
- [string]$MakeCommand=$(throw("You must specify a make command [mingw32-make, nmake]"))
- )
- Write-Host "### Open62541: Supposed to build with: $Type $Platform $MakeCommand"
-
- ## Make Build directory
- $buildDir = "$extractTarget\open62541-$commitSHA\build" + "_" + $Type + "_" + $Platform
- if (Test-Path $buildDir) {
- Write-Host " Deleting pre-existing build directory"
- Remove-Item $buildDir -Force -Recurse
- }
- New-Item -ItemType Directory -Force -Path $buildDir
- Push-Location $buildDir
-
- ## Invoke Cmake
- $makeGenerator = "NMake Makefiles JOM"
- $installTarget = "C:\Utils\open62541" + "_" + $Type + "_" + $Platform
- if (Test-Path $installTarget) {
- Write-Host " Deleting pre-existing install directory"
- Remove-Item $installTarget -Force -Recurse
- }
-
- if ($Type.StartsWith("mingw")) {
- $makeGenerator = "MinGW Makefiles"
- }
- cmake -G "$makeGenerator" -DUA_ENABLE_AMALGAMATION=ON -DUA_ENABLE_METHODCALLS=ON -DCMAKE_INSTALL_PREFIX:PATH=$installTarget -DLIB_INSTALL_DIR:PATH=$installTarget/lib ..
-
- ## Call build command
- Write-Host "### Open62541: Compilation ###"
- Run-Executable $MakeCommand
-
- ## call install command
- Write-Host "### Open62541: Installation ###"
- Run-Executable $MakeCommand install
-
- $platformVariable = "CI_OPEN62541_" + $Type + "_" + $Platform + "_PREFIX"
- Set-EnvironmentVariable $platformVariable $installTarget
-
- ## Packaging
- Push-Location "C:\Utils"
- $archiveName = "open62541_" + $Type + "_" + $Platform + ".7z"
- CreateArchive $installTarget $archiveName
- Pop-Location
-
- ## cleanup build directory
- Write-Host "### Open62541: Cleanup ###"
- Pop-Location
- Remove-Item $buildDir -Force -Recurse
-}
-
-function DownloadAndInstall
-{
- Param (
- [string]$Type=$(throw("You must specify the dev type [mingw530, mingw630, mingw730, msvc2015, msvc2017]")),
- [string]$Platform=$(throw("You must specify the target platform [x86, x64]"))
- )
- $baseLocation = "http://ci-files01-hki.intra.qt.io/input/open62541/"
- $targetName = "open62541_" + $Type + "_" + $Platform
- $archiveName = $targetName + ".7z"
- $downloadUrl = $baseLocation + $archiveName
-
- # Download
- $downloadTarget = "C:\Utils\" + $archiveName
- Download $downloadUrl $downloadUrl $downloadTarget
-
- # Extract
- Push-Location C:\Utils
- Extract-7Zip $downloadTarget C:\Utils
- Pop-Location
-
- # Set environment variable
- $platformVariable = "CI_OPEN62541_" + $Type + "_" + $Platform
- $platformPath = "C:\Utils\" + $targetName
- Set-EnvironmentVariable $platformVariable $platformPath
-}
-
-##############################
-# Startup #
-##############################
-if ($targetCommand.StartsWith("mingw")) {
- Write-Host "### Creating Open62541 for MinGW"
- $mingwPath = [Environment]::GetEnvironmentVariable($targetCommand, "Machine")
- if (!$mingwPath) {
- throw("Could not find mingw")
- }
-
- # Strawberry has its own gcc, put mingw in front
- $adaptedPath = $mingwPath + "\bin;" + [Environment]::GetEnvironmentVariable("PATH", "Machine")
- [Environment]::SetEnvironmentVariable("PATH", $adaptedPath, "Process")
-
- PushDevEnvironment
- BuildAndInstallOpen62541 $targetCommand x86 "mingw32-make"
-} elseif ($targetCommand -eq "msvc2015_x86") {
- Write-Host "### Creating Open62541 for MSVC2015 x86"
- MSVCEnvironment "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" "vcvarsall.bat x86"
- PushDevEnvironment
- BuildAndInstallOpen62541 msvc2015 x86 jom
-} elseif ($targetCommand -eq "msvc2015_x64") {
- Write-Host "### Creating Open62541 for MSVC2015 x64"
- MSVCEnvironment "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" "vcvarsall.bat amd64"
- PushDevEnvironment
- BuildAndInstallOpen62541 msvc2015 x64 jom
-} elseif ($targetCommand -eq "msvc2017_x86") {
- Write-Host "### Creating Open62541 for MSVC2017 x86"
- MSVCEnvironment "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build" vcvars32.bat
- PushDevEnvironment
- BuildAndInstallOpen62541 msvc2017 x86 jom
-} elseif ($targetCommand -eq "msvc2017_x64") {
- Write-Host "### Creating Open62541 for MSVC2017 x64"
- MSVCEnvironment "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build" vcvars64.bat
- PushDevEnvironment
- BuildAndInstallOpen62541 msvc2017 x64 jom
-} elseif ($targetCommand -eq "prepare") {
- PrepareRepository
-} elseif ($targetCommand -eq "build") {
- Write-Host "### Building for all supported platforms"
- PrepareRepository
- Write-Host "### Invoking MinGW530 build"
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand mingw530
- Write-Host "### Invoking MinGW630 build"
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand mingw630
- Write-Host "### Invoking MinGW730 build"
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand mingw730
- Write-Host "### Invoking MSVC2015 build"
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand msvc2015_x86
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand msvc2015_x64
- Write-Host "### Invoking MSVC2017 build"
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand msvc2017_x86
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand msvc2017_x64
- Write-Host "### Archives have been generated at C:/Utils. Please upload manually"
-} elseif ($targetCommand -eq "packaged") {
- Write-Host "### Expecting pre-built packages, download and install from archives"
- Write-Host "### MinGW530 x64"
- DownloadAndInstall mingw530 x86
- Write-Host "### MinGW630 x64"
- DownloadAndInstall mingw630 x86
- Write-Host "### MinGW730 x64"
- DownloadAndInstall mingw730 x64
- Write-Host "### MSVC2015 x86"
- DownloadAndInstall msvc2015 x86
- Write-Host "### MSVC2015 x64"
- DownloadAndInstall msvc2015 x64
- Write-Host "### MSVC2017 x64"
- DownloadAndInstall msvc2017 x64
-} elseif ($targetCommand) {
- Write-Host "### Unknown parameter specified:" $targetCommand " Options are: mingw, msvc2015_x(86/64), msvc2017_x(86/64)"
- throw("Unknown parameter")
-} else {
- # Default behavior
- PowerShell -ExecutionPolicy Bypass -File "$PSScriptRoot\open62541.ps1" -targetCommand build
-}