From 5e7957234df470e481c9093ea2b7c5773ab15368 Mon Sep 17 00:00:00 2001 From: Meredith Monticello Date: Mon, 27 Feb 2017 14:10:46 -0800 Subject: [PATCH] Update scripts for running vsimporter on all the samples (#2097) --- .../build/{SDKTest.ps1 => VSImport-Samples.ps1} | 14 +++++++++----- scripts/build/unzip.ps1 | 6 ++++-- 2 files changed, 13 insertions(+), 7 deletions(-) rename scripts/build/{SDKTest.ps1 => VSImport-Samples.ps1} (55%) diff --git a/scripts/build/SDKTest.ps1 b/scripts/build/VSImport-Samples.ps1 similarity index 55% rename from scripts/build/SDKTest.ps1 rename to scripts/build/VSImport-Samples.ps1 index 37deeaed2e..7ade2da80b 100644 --- a/scripts/build/SDKTest.ps1 +++ b/scripts/build/VSImport-Samples.ps1 @@ -1,10 +1,11 @@ <# .SYNOPSIS - This script is used in the VSO build to unzip the SDK and vsimporter on the samples - that have a XCode Project. + This script is used in the VSO build to unzip the WinObjC.Tools NuGet + package and run vsimporter on the samples that have a XCode Project. #> param( - #NOTE: using Parameter(Mandatory) will hang the VSO build job since powershell will block waiting for user input. + #NOTE: using Parameter(Mandatory) will hang the VSO build job since + # powershell will block waiting for user input. [string]$zipFile = $(throw 'Mandatory parameter "zipFile" is not set.'), [string]$tempDir = $(throw 'Madatory parameter "tempDir" is not set.') ) @@ -14,15 +15,18 @@ $ErrorActionPreference = "Stop" & $PSScriptRoot\unzip.ps1 -zipFile $zipFile -outputDir $tempDir -$XCodeProjects = gci -recurse $tempDir\*.xcodeproj +$XCodeProjects = gci -recurse $PSScriptRoot\..\..\samples\*.xcodeproj +$XCodeProjects += gci -recurse $PSScriptRoot\..\..\tests\testapps\*.xcodeproj foreach($XCodeProject in $XCodeProjects) { write-host $XCodeProject - & $tempDir\bin\vsimporter.exe -project $XCodeProject + & $tempDir\tools\vsimporter.exe -project $XCodeProject if($lastexitcode -ne 0) { throw "VSImporter exited with error code: $lastexitcode" } } +Remove-Item $tempDir -Force -Recurse + exit 0 diff --git a/scripts/build/unzip.ps1 b/scripts/build/unzip.ps1 index c542979b94..c8596db2b4 100644 --- a/scripts/build/unzip.ps1 +++ b/scripts/build/unzip.ps1 @@ -1,15 +1,17 @@ <# .SYNOPSIS This script wraps c#'s io.compression.zipfile to unzip a zip file. - The script is intended to be used within the VSO build to unzip the winobjc SDK. + The script is intended to be used within the VSO build to unzip a NuGet package. #> param( - #NOTE: using Parameter(Mandatory) will hang the VSO build job since powershell will block waiting for user input. + #NOTE: using Parameter(Mandatory) will hang the VSO build job since + # powershell will block waiting for user input. [string]$zipFile = $(throw 'Mandatory parameter "zipFile" is not set.'), [string]$outputDir = $(throw 'Madatory parameter "outputDir" is not set.') ) write-host $MyInvocation.Line +$zipFile = gi $zipFile Add-Type -assembly "system.io.compression.filesystem"; [io.compression.zipfile]::ExtractToDirectory($zipFile, $outputDir);