forked from MicroLite-ORM/MicroLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.ps1
More file actions
53 lines (45 loc) · 1.79 KB
/
default.ps1
File metadata and controls
53 lines (45 loc) · 1.79 KB
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
properties {
$projectName = "MicroLite"
$baseDir = Resolve-Path .
$buildDir = "$baseDir\build"
$helpDir = "$buildDir\help\"
$builds = @(
@{Name = "NET35"; Constants="NET_3_5"; BuildDir="$buildDir\3.5\"; Framework="v3.5;TargetFrameworkProfile=Client"},
@{Name = "NET40"; Constants="NET_4_0"; BuildDir="$buildDir\4.0\"; Framework="v4.0;TargetFrameworkProfile=Client"},
@{Name = "NET45"; Constants="NET_4_5"; BuildDir="$buildDir\4.5\"; Framework="v4.5"}
)
}
Task Default -depends BuildHelp
Task Clean {
Write-Host "Cleaning $projectName Build Directory" -ForegroundColor Green
foreach ($build in $builds) {
$outDir = $build.BuildDir
Remove-Item -force -recurse $outDir -ErrorAction SilentlyContinue
}
Remove-Item -force -recurse $helpDir -ErrorAction SilentlyContinue
Write-Host
}
Task Build -Depends Clean {
foreach ($build in $builds) {
$name = $build.Name
Write-Host "Building $projectName.$name.sln" -ForegroundColor Green
$constants = $build.Constants
$outDir = $build.BuildDir
$netVer = $build.Framework
Exec { msbuild "$projectName.$name.sln" "/target:Clean;Rebuild" "/property:Configuration=Release;WarningLevel=1;DefineConstants=$constants;OutDir=$outDir;TargetFrameworkVersion=$netVer" /verbosity:quiet }
}
Write-Host
}
Task RunTests -Depends Build {
foreach ($build in $builds) {
$name = $build.Name
Write-Host "Running $projectName.Tests.$name" -ForegroundColor Green
$outDir = $build.BuildDir
Exec { & $baseDir\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe "$outDir\$projectName.Tests.dll" }
}
Write-Host
}
Task BuildHelp -Depends RunTests {
Write-Host "Building $projectName.shfbproj" -ForegroundColor Green
Exec { msbuild "$projectName.shfbproj" }
}