Permalink
Browse files

Upgrade psake to use the package from NuGet. Now builds should run like:

.\build.ps1 - for the default task
.\build.ps1 Test - for a specific task called Test.
  • Loading branch information...
1 parent 015d1c8 commit 31f9fad46a62124e6f1c4d9da45f1fe563f998e8 @fitzchak fitzchak committed Oct 31, 2012
Showing with 36 additions and 333 deletions.
  1. +1 −0 .nuget/packages.config
  2. +11 −0 build.cmd
  3. +10 −0 build.ps1
  4. 0 psake_ext.ps1 → build_utils.ps1
  5. +14 −20 default.ps1
  6. +0 −313 psake.ps1
View
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="psake" version="4.2.0.1" />
<package id="xunit.runners" version="1.9.1" />
</packages>
View
@@ -0,0 +1,11 @@
+@echo off
+
+if '%1'=='/?' goto help
+if '%1'=='-help' goto help
+if '%1'=='-h' goto help
+
+powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\build.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
+goto :eof
+
+:help
+powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\build.ps1' Help"
View
@@ -0,0 +1,10 @@
+param($task = "default")
+
+$scriptPath = $MyInvocation.MyCommand.Path
+$scriptDir = Split-Path $scriptPath
+
+get-module psake | remove-module
+
+import-module (Get-ChildItem "$scriptDir\packages\psake.*\tools\psake.psm1" | Select-Object -First 1)
+
+invoke-psake "$scriptDir\default.ps1" $task
File renamed without changes.
View
@@ -1,3 +1,5 @@
+Include ".\build_utils.ps1"
+
properties {
$base_dir = resolve-path .
$lib_dir = "$base_dir\SharedLibs"
@@ -59,7 +61,6 @@ properties {
$test_prjs = @("Raven.Tests.dll","Raven.Client.VisualBasic.Tests.dll", "Raven.Bundles.Tests.dll" )
}
-include .\psake_ext.ps1
task default -depends Stable,Release
@@ -96,23 +97,6 @@ task Init -depends Verify40, Clean {
New-Item $build_dir -itemType directory -ErrorAction SilentlyContinue | Out-Null
}
-task BeforeCompile {
- $dat = "$base_dir\..\BuildsInfo\RavenDB\Settings.dat"
- $datDest = "$base_dir\Raven.Studio\Settings.dat"
- echo $dat
- if (Test-Path $dat) {
- Copy-Item $dat $datDest -force
- }
- ElseIf ((Test-Path $datDest) -eq $false) {
- New-Item $datDest -type file -force
- }
-}
-
-task AfterCompile {
- #new-item "$base_dir\Raven.Studio\Settings.dat" -type file -force
- remove-item "$build_dir\nlog.config" -force -ErrorAction SilentlyContinue
-}
-
task Compile -depends Init {
$v4_net_version = (ls "$env:windir\Microsoft.NET\Framework\v4.0*").Name
@@ -121,13 +105,23 @@ task Compile -depends Init {
exec { &"$build_dir\Raven.ProjectRewriter.exe" }
try {
- ExecuteTask("BeforeCompile")
+ $dat = "$base_dir\..\BuildsInfo\RavenDB\Settings.dat"
+ $datDest = "$base_dir\Raven.Studio\Settings.dat"
+ echo $dat
+ if (Test-Path $dat) {
+ Copy-Item $dat $datDest -force
+ }
+ ElseIf ((Test-Path $datDest) -eq $false) {
+ New-Item $datDest -type file -force
+ }
+
Write-Host "Compiling with '$global:configuration' configuration" -ForegroundColor Yellow
exec { &"C:\Windows\Microsoft.NET\Framework\$v4_net_version\MSBuild.exe" "$sln_file" /p:OutDir="$buildartifacts_dir\" /p:Configuration=$global:configuration }
} catch {
Throw
} finally {
- ExecuteTask("AfterCompile")
+ #new-item "$base_dir\Raven.Studio\Settings.dat" -type file -force
+ remove-item "$build_dir\nlog.config" -force -ErrorAction SilentlyContinue
}
}
Oops, something went wrong.

0 comments on commit 31f9fad

Please sign in to comment.