Skip to content
Browse files

adding psake builds with package restore for psake

  • Loading branch information...
1 parent 330ee25 commit 9523bdd0e3db29f96f340d603ba37b4def4a2a7c @mwrock mwrock committed
Showing with 44 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +12 −0 Build.bat
  3. +27 −0 default.ps1
  4. +0 −7 package.ps1
  5. +4 −0 vendor/packages.config
View
1 .gitignore
@@ -1,2 +1,3 @@
build/
Test.xml
+vendor/packages/
View
12 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"
View
27 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
+}
View
7 package.ps1
@@ -1,7 +0,0 @@
-
-if (Test-Path "build") {
- Remove-Item "build" -Recurse -Force
-}
-
-mkdir build
-vendor\tools\nuget pack Pester.nuspec -OutputDirectory build
View
4 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.
Something went wrong with that request. Please try again.