diff options
Diffstat (limited to '')
-rw-r--r-- | .appveyor/build.ps1 | 63 | ||||
-rw-r--r-- | .appveyor/test.ps1 | 22 |
2 files changed, 6 insertions, 79 deletions
diff --git a/.appveyor/build.ps1 b/.appveyor/build.ps1 index 6ecbf00..40233af 100644 --- a/.appveyor/build.ps1 +++ b/.appveyor/build.ps1 @@ -1,7 +1,5 @@ param( - [string] $BuildDir = $null, [string] $ProjectDir = $null, - [string] $Generator = $null, [string] $Platform = $null, [string] $Configuration = $null, [string] $DriverTargetOS = $null @@ -35,39 +33,11 @@ function Test-AppVeyor { function Set-AppVeyorDefaults { $script:ProjectDir = $env:APPVEYOR_BUILD_FOLDER - $script:BuildDir = 'C:\Projects\build' - $script:Generator = switch ($env:APPVEYOR_BUILD_WORKER_IMAGE) { - 'Visual Studio 2013' { 'Visual Studio 12 2013' } - 'Visual Studio 2015' { 'Visual Studio 14 2015' } - 'Visual Studio 2017' { 'Visual Studio 15 2017' } - default { throw "Unsupported AppVeyor image: $env:APPVEYOR_BUILD_WORKER_IMAGE" } - } $script:Platform = $env:PLATFORM $script:Configuration = $env:CONFIGURATION $script:DriverTargetOS = $env:appveyor_driver_target_os } -function Build-ProjectUserMode { - param( - [Parameter(Mandatory=$true)] - [string] $ProjectDir, - [Parameter(Mandatory=$true)] - [string] $BuildDir, - [Parameter(Mandatory=$true)] - [string] $Generator, - [Parameter(Mandatory=$true)] - [string] $Platform, - [Parameter(Mandatory=$true)] - [string] $Configuration - ) - - mkdir $BuildDir - cd $BuildDir - - Invoke-Exe { cmake.exe -G $Generator -A $Platform "$ProjectDir\um" } - Invoke-Exe { cmake.exe --build . --config $Configuration -- /m } -} - function Get-DriverConfiguration { param( [Parameter(Mandatory=$true)] @@ -151,35 +121,6 @@ function Build-ProjectKernelMode { } } -function Build-Project { - param( - [Parameter(Mandatory=$true)] - [string] $ProjectDir, - [Parameter(Mandatory=$true)] - [string] $BuildDir, - [Parameter(Mandatory=$true)] - [string] $Generator, - [Parameter(Mandatory=$true)] - [string] $Platform, - [Parameter(Mandatory=$true)] - [string] $Configuration, - [Parameter(Mandatory=$true)] - [string] $DriverTargetOS - ) - - Build-ProjectUserMode ` - -ProjectDir $ProjectDir ` - -BuildDir $BuildDir ` - -Generator $Generator ` - -Platform $Platform ` - -Configuration $Configuration - Build-ProjectKernelMode ` - -ProjectDir $ProjectDir ` - -Platform $Platform ` - -Configuration $Configuration ` - -DriverTargetOS $DriverTargetOS -} - function Build-ProjectAppVeyor { if (Test-AppVeyor) { Set-AppVeyorDefaults @@ -187,10 +128,8 @@ function Build-ProjectAppVeyor { } try { - Build-Project ` + Build-ProjectKernelMode ` -ProjectDir $script:ProjectDir ` - -BuildDir $script:BuildDir ` - -Generator $script:Generator ` -Platform $script:Platform ` -Configuration $script:Configuration ` -DriverTargetOS $script:DriverTargetOS diff --git a/.appveyor/test.ps1 b/.appveyor/test.ps1 index 3eeebfc..ece8dbe 100644 --- a/.appveyor/test.ps1 +++ b/.appveyor/test.ps1 @@ -1,5 +1,6 @@ param( - [string] $BuildDir = $null, + [Parameter(Mandatory=$true)] + [string] $InstallDir = $null, [string] $ProjectDir = $null, [string] $Configuration = $null, [string] $Platform = $null, @@ -35,24 +36,11 @@ function Test-AppVeyor { function Set-AppVeyorDefaults { $script:ProjectDir = $env:APPVEYOR_BUILD_FOLDER - $script:BuildDir = 'C:\Projects\build' $script:Platform = $env:PLATFORM $script:Configuration = $env:CONFIGURATION $script:DriverTargetOS = $env:appveyor_driver_target_os } -function Add-UtilsPath { - param( - [Parameter(Mandatory=$true)] - [string] $BuildDir, - [Parameter(Mandatory=$true)] - [string] $Configuration - ) - - $env:PATH = "$BuildDir\service\utils\$Configuration;${env:PATH}" - $env:PATH = "$BuildDir\wrappers\simple\utils\$Configuration;${env:PATH}" -} - function Get-DriverName { param( [Parameter(Mandatory=$true)] @@ -189,7 +177,7 @@ function Run-ProjectTests { [Parameter(Mandatory=$true)] [string] $ProjectDir, [Parameter(Mandatory=$true)] - [string] $BuildDir, + [string] $InstallDir, [Parameter(Mandatory=$true)] [string] $Platform, [Parameter(Mandatory=$true)] @@ -198,7 +186,7 @@ function Run-ProjectTests { [string] $DriverTargetOS ) - Add-UtilsPath -BuildDir $BuildDir -Configuration $Configuration + $env:PATH = "$InstallDir\bin;${env:PATH}" $drivers = 'minimal', 'simple', 'special\nt_namespace' @@ -228,7 +216,7 @@ function Run-ProjectTestsAppVeyor { try { Run-ProjectTests ` -ProjectDir $script:ProjectDir ` - -BuildDir $script:BuildDir ` + -InstallDir $script:InstallDir ` -Platform $script:Platform ` -Configuration $script:Configuration ` -DriverTargetOS $script:DriverTargetOS |