-
Notifications
You must be signed in to change notification settings - Fork 27
/
default.ps1
55 lines (38 loc) · 1.8 KB
/
default.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
properties {
$baseDirectory = resolve-path .
$buildDirectory = "$baseDirectory\build"
$stageDirectory = "$buildDirectory.staged"
$solutionFilepath = "$baseDirectory\src\RavenDBMembership.sln"
$tempPath = "c:\temp\RavenDBMembershipTemp"
$sqlConnectionString = "Database='master';Data Source=.;User Id=testusersdeletesyourdata;Password=1Password0;"
}
import-module .\tools\PSUpdateXML
task default -depends Build,UnitTests,Configure,FullTests
task Verify40 {
if( (ls "$env:windir\Microsoft.NET\Framework\v4.0*") -eq $null ) {
throw "Building RavenDBMembership requires .NET 4.0, which doesn't appear to be installed on this machine"
}
}
task Clean {
if (test-path $buildDirectory) {
remove-item $buildDirectory -force -recurse
}
}
task Build -depends Verify40, Clean {
$v4_net_version = (ls "$env:windir\Microsoft.NET\Framework\v4.0*").Name
exec { &"C:\Windows\Microsoft.NET\Framework\$v4_net_version\MSBuild.exe" $solutionFilepath /p:OutDir="$buildDirectory\" }
}
task UnitTests {
exec { & .\tools\xunit\xunit.console.clr4.exe "$($buildDirectory)\RavenDBMembership.Tests.dll" }
}
task Configure {
$integrationTestConfigFile = (join-path $buildDirectory "RavenDBMembership.IntegrationTests.dll.config");
cp $integrationTestConfigFile "$integrationTestConfigFile.bak"
update-xml $integrationTestConfigFile {
set-xml -exactlyOnce "//configuration/applicationSettings/*/setting[@name='AccessibleTempPath']/value" $tempPath
set-xml -exactlyOnce "//configuration/applicationSettings/*/setting[@name='SqlConnectionString']/value" $sqlConnectionString
}
}
task FullTests {
exec { & .\tools\NUnit\net-2.0\nunit-console.exe "$($buildDirectory)\RavenDBMembership.IntegrationTests.dll" }
}