Skip to content

Commit

Permalink
adding psake builds with package restore for psake
Browse files Browse the repository at this point in the history
  • Loading branch information
mwrock committed Sep 23, 2012
1 parent 330ee25 commit 9523bdd
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
build/ build/
Test.xml Test.xml
vendor/packages/
12 changes: 12 additions & 0 deletions Build.bat
@@ -0,0 +1,12 @@
@echo off

if '%1'=='/?' goto help
if '%1'=='-help' goto help
if '%1'=='-h' goto help

%~dp0vendor\tools\nuget.exe Install %~dp0vendor\packages.config -o %~dp0vendor\packages
powershell -NoProfile -ExecutionPolicy Bypass -Command "$psakeDir = ([array](dir %~dp0Vendor\packages\psake.*))[-1]; .$psakeDir\tools\psake.ps1 %* -ScriptPath $psakeDir\tools ; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
goto :eof

:help
powershell -NoProfile -ExecutionPolicy Bypass -Command "$psakeDir = ([array](dir %~dp0Vendor\packages\psake.*))[-1]; .$psakeDir\tools\psake.ps1 -ScriptPath $psakeDir\tools -help"
27 changes: 27 additions & 0 deletions default.ps1
@@ -0,0 +1,27 @@
$psake.use_exit_on_error = $true
properties {
$currentDir = resolve-path .
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
$baseDir = Split-Path -parent $Invocation.MyCommand.Definition | split-path -parent | split-path -parent | split-path -parent | split-path -parent
echo $baseDir
$version = git describe --abbrev=0 --tags
$version = $version.substring(1) + '.' + (git log $($version + '..') --pretty=oneline | measure-object).Count
$nugetDir = "$baseDir\.NuGet"
}

Task default -depends Test, Package

Task Test {
CD "$baseDir"
."$baseDir\bin\Pester.bat"
CD $currentDir
}

Task Package {
if (Test-Path "$baseDir\build") {
Remove-Item "$baseDir\build" -Recurse -Force
}

mkdir "$baseDir\build"
."$baseDir\vendor\tools\nuget" pack "$baseDir\Pester.nuspec" -OutputDirectory "$baseDir\build" -NoPackageAnalysis
}
7 changes: 0 additions & 7 deletions package.ps1

This file was deleted.

4 changes: 4 additions & 0 deletions vendor/packages.config
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="psake" version="4.2.0.1" />
</packages>

0 comments on commit 9523bdd

Please sign in to comment.