From b69f5dcd74f3b12bd4f0d0a46180faff559fc793 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Tue, 21 Jul 2015 15:40:56 +0200 Subject: [PATCH] move my ci helper script to own repo --- appveyor.yml | 3 +++ ci/appveyor.ps1 | 72 +++---------------------------------------------- 2 files changed, 6 insertions(+), 69 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ddcba83..295c150 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,7 @@ branches: only: - master build_script: +- ps: if ( !(Test-Path "ci\appveyorHelp.psm1")) {Start-FileDownload https://raw.githubusercontent.com/TheOneRing/appVeyorHelp/master/appveyorHelp.psm1 -FileName ci\appveyorHelp.psm1 } - ps: .\ci\appveyor.ps1 test: off @@ -12,6 +13,8 @@ cache: - work\install -> ci\appveyor.ps1 - C:\ProgramData\chocolatey\bin -> ci\appveyor.ps1 - C:\ProgramData\chocolatey\lib -> ci\appveyor.ps1 +- C:\tools -> ci\appveyor.ps1 +- ci\appveyorHelp.psm1 -> ci\appveyor.ps1 environment: matrix: diff --git a/ci/appveyor.ps1 b/ci/appveyor.ps1 index be7b585..79f19a3 100644 --- a/ci/appveyor.ps1 +++ b/ci/appveyor.ps1 @@ -1,74 +1,8 @@ -#Set environment variables for Visual Studio Command Prompt -#http://stackoverflow.com/questions/2124753/how-i-can-use-powershell-with-the-visual-studio-command-prompt -function batCall([string] $path, [string] $arg) -{ - Write-Host "Calling `"$path`" `"$arg`"" - cmd /c "$path" "$arg" `& set | - foreach { - if ($_ -match "=") { - $v = $_.split("=") - #Write-Host "ENV:\$($v[0])=$($v[1])" - set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" - } - } -} -function fixCmakeDestDir([string] $prefix, [string] $destDir) -{ - $prefix=$prefix -replace "/", "\\" - $destDir=$destDir -replace "/", "\\" - if( $prefix.substring(1,1) -eq ":") - { - $prefix=$prefix.substring(3) - } - Write-Host "move $destDir\$prefix to $destDir" - mv "$destDir\$prefix\*" "$destDir" - $rootLeftOver = $prefix.substring(0, $prefix.indexOf("\\")) - Write-Host "rm $destDir\$rootLeftOver" - rm -Recurse "$destDir\$rootLeftOver" -} -$INSTALL_DIR="$env:APPVEYOR_BUILD_FOLDER\work\install" -$CMAKE_INSTALL_ROOT=$INSTALL_DIR -replace "\\", "/" +Import-Module .\appveyorHelp.psm1 -Force -$env:PATH="$env:PATH;$INSTALL_DIR" +INIT @("ninja", "extra-cmake-modules") - -if ( $env:COMPILER -eq "MINGW" ) -{ - batCall "C:\Qt\5.5\mingw492_32\bin\qtenv2.bat" - #remove sh.exe from path - $env:PATH=$env:PATH -replace "C:\\Program Files \(x86\)\\Git\\bin", "" -} -elseif ( $env:COMPILER -eq "MSVC" ) -{ - batCall "C:\Qt\5.5\msvc2013_64\bin\qtenv2.bat" - batCall "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 -} - - - -mkdir $env:APPVEYOR_BUILD_FOLDER\work\image -mkdir $env:APPVEYOR_BUILD_FOLDER\work\build -mkdir $env:APPVEYOR_BUILD_FOLDER\work\build\extra-cmake-modules mkdir $env:APPVEYOR_BUILD_FOLDER\work\build\snorenotify - - -if ( !(Test-Path "$env:APPVEYOR_BUILD_FOLDER\work\install" ) ) -{ - mkdir $env:APPVEYOR_BUILD_FOLDER\work\install - mkdir $env:APPVEYOR_BUILD_FOLDER\work\git - - cinst ninja - - cd $env:APPVEYOR_BUILD_FOLDER\work\git - git clone -q git://anongit.kde.org/extra-cmake-modules.git - - cd $env:APPVEYOR_BUILD_FOLDER\work\build\extra-cmake-modules - cmake -G"Ninja" $env:APPVEYOR_BUILD_FOLDER\work\git\extra-cmake-modules -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_ROOT" - ninja install -} - - cd $env:APPVEYOR_BUILD_FOLDER\work\build\snorenotify cmake -G"Ninja" $env:APPVEYOR_BUILD_FOLDER -DCMAKE_BUILD_TYPE=Release -DWITH_SNORE_DAEMON=ON -DWITH_FRONTENDS=ON -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_ROOT" -ninja install DESTDIR="$env:APPVEYOR_BUILD_FOLDER\work\image" -fixCmakeDestDir $CMAKE_INSTALL_ROOT "$env:APPVEYOR_BUILD_FOLDER\work\image" \ No newline at end of file +CMAKE-IMAGE-INSTALL "$env:APPVEYOR_BUILD_FOLDER\work\image" \ No newline at end of file