-
Notifications
You must be signed in to change notification settings - Fork 4
/
default.ps1
40 lines (29 loc) · 1.07 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
properties {
$location = (get-location)
$outdir = join-path $location "Build"
$bindir = join-path $outdir "Bin"
}
task default -depends NuGet
task Clean {
[void](remove-item Build -force -recurse -ea SilentlyContinue)
}
task Rebuild -depends Clean {
exec { msbuild /nologo /t:rebuild /p:"Configuration=Release;OutDir=$bindir/" "Source/log4net.NLogAppender/log4net.NLogAppender.csproj" }
}
task NuGet -depends Rebuild {
copy "$location\*.nuspec" Build
push-location Build
$spec = [xml](get-content log4net.NLogAppender.nuspec);
$spec.package.metadata.version = ([System.Diagnostics.FileVersionInfo]::GetVersionInfo("$bindir/log4net.NLogAppender.dll").productVersion -replace ".\d+$");
set-content log4net.NLogAppender.nuspec $spec.outerXml;
..\Packages\NuGet\NuGet.exe pack log4net.NLogAppender.nuspec
pop-location
}
task Deploy -depends NuGet {
$apikey = get-content ($env:HOMEPATH+"\.nuget_apikey")
$nupkg = dir "$outdir\*.nupkg"
.\Packages\NuGet\NuGet.exe push "$nupkg" $apikey
}
task ? -Description "Helper to display task info" {
Write-Documentation
}