Skip to content

Commit

Permalink
Update scripts for running vsimporter on all the samples (#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
memontic-ms authored Feb 27, 2017
1 parent 5b6ea56 commit 5e79572
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 9 additions & 5 deletions scripts/build/SDKTest.ps1 → scripts/build/VSImport-Samples.ps1
Original file line number Diff line number Diff line change
@@ -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.')
)
Expand All @@ -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
6 changes: 4 additions & 2 deletions scripts/build/unzip.ps1
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 5e79572

Please sign in to comment.