-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nick Abalov
authored and
Nick Abalov
committed
Sep 30, 2016
1 parent
ad7a912
commit 1df984a
Showing
4 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Function Build() | ||
{ | ||
$msbuild=$env:MSBUILD | ||
$solutionPath = Join-Path $solutionDir 'WindowsPhoneDriver.sln' | ||
|
||
&$msbuild ($solutionPath, '/v:minimal', '/p:configuration=Release', '/t:Clean,Build') | ||
if (!$?) { | ||
Write-Host "Build failed. $?" -ForegroundColor Red | ||
Exit 1 | ||
} | ||
} | ||
|
||
Function Clean() | ||
{ | ||
Remove-Item $releaseDir -Force -Recurse | ||
New-Item -ItemType directory -Path $releaseDir | ||
} | ||
|
||
Function PackNuGet () | ||
{ | ||
Write-Host "Packing Nuget package" | ||
Get-ChildItem -Path $releaseDir -Filter "*.nupkg" | foreach ($_) { Remove-Item $_.FullName } | ||
|
||
$nuget = Join-Path $solutionDir '.nuget\nuget.exe' | ||
|
||
$innerServerProjectDir = Join-Path $solutionDir 'WindowsPhoneDriver.InnerDriver' | ||
$innerServerprojectPath = Join-Path $innerServerProjectDir 'WindowsPhoneDriver.InnerDriver.csproj' | ||
|
||
&$nuget ('pack', $innerServerprojectPath, '-IncludeReferencedProjects', '-Properties', 'Configuration=Release', '-OutputDirectory', $releaseDir) | ||
} | ||
|
||
Function PackRelease() | ||
{ | ||
Add-Type -assembly "system.io.compression.filesystem" | ||
|
||
$driverSourcePath = Join-Path $solutionDir "WindowsPhoneDriver.OuterDriver\Bin\Release" | ||
$innerServerSourcePath = Join-Path $solutionDir "WindowsPhoneDriver.InnerDriver\Bin\Release" | ||
|
||
Get-ChildItem -Path $releaseDir -Filter "*.zip" | foreach ($_) { Remove-Item $_.FullName } | ||
|
||
[IO.Compression.ZipFile]::CreateFromDirectory($driverSourcePath, "$releaseDir/WindowsPhoneDriver.OuterDriver.zip") | ||
[IO.Compression.ZipFile]::CreateFromDirectory($innerServerSourcePath, "$releaseDir/WindowsPhoneDriver.InnerDriver.zip") | ||
} | ||
|
||
$workspace=$PSScriptRoot | ||
$releaseDir = Join-Path $workspace "Release" | ||
$solutionDir=Join-Path $workspace "WindowsPhoneDriver" | ||
|
||
Write-Host "Update CHANGELOG.md" | ||
Write-Host "Update version in Assemblies" | ||
Write-Host "Update version in NuSpec file" | ||
|
||
Pause | ||
|
||
Clean | ||
Build | ||
# Test | ||
PackNuGet | ||
PackRelease | ||
|
||
Write-Host "Finished" -ForegroundColor Green | ||
Write-Host "Publish NuGet package using nuget.exe push $releaseDir\WindowsPhoneDriver.InnerDriver.*.nupkg" | ||
Write-Host "Add and push tag using git tag -a v*.*.* -m 'Version *.*.*'" | ||
Write-Host "Upload and attach $releaseDir\*.zip files to release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters