forked from MindscapeHQ/raygun4net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
61 lines (46 loc) · 2.01 KB
/
build.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
56
57
58
59
60
61
properties {
$root = $psake.build_script_dir
$solution_file = "$root/Mindscape.Raygun4Net.sln"
$winrt_solution_file = "$root/Mindscape.Raygun4Net.WinRT.sln"
$windows_phone_solution_file = "$root/Mindscape.Raygun4Net.WindowsPhone.sln"
$nugetspec = "$root/Mindscape.Raygun4Net.nuspec"
$nugetpackage = "Mindscape.Raygun4Net.1.0.nupkg"
$configuration = "Release"
$build_dir = "$root\build\"
$release_dir = "$root\release\"
$nunit_dir = "$root\packages\NUnit.Runners.2.6.2\tools\"
$tools_dir = "$root\tools"
$nuget_dir = "$root\.nuget"
$env:Path += ";$nunit_dir;$tools_dir;$nuget_dir"
}
task default -depends Package
task Clean {
remove-item -force -recurse $build_dir -ErrorAction SilentlyContinue | Out-Null
remove-item -force -recurse $release_dir -ErrorAction SilentlyContinue | Out-Null
}
task Init -depends Clean {
new-item $release_dir -itemType directory | Out-Null
new-item $build_dir -itemType directory | Out-Null
}
task Compile -depends Init {
exec { msbuild "$solution_file" /m /p:OutDir=$build_dir /p:Configuration=$configuration }
}
task CompileWinRT -depends Init {
exec { msbuild "$winrt_solution_file" /m /p:OutDir=$build_dir /p:Configuration=$configuration }
}
task CompileWindowsPhone -depends Init {
exec { msbuild "$windows_phone_solution_file" /m /p:OutDir=$build_dir /p:Configuration=$Configuration }
}
task Test -depends Compile {
$test_assemblies = Get-ChildItem $build_dir -Include *Tests.dll -Name
Push-Location -Path $build_dir
exec { nunit-console.exe $test_assemblies }
Pop-Location
}
task Package -depends Compile, CompileWinRT, CompileWindowsPhone {
}
task PushNugetPackage -depends Package {
Push-Location -Path $release_dir
exec { nuget push "$release_dir*.nupkg" }
Pop-Location
}