forked from andyedinborough/CalDav
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Create-Package.ps1
27 lines (22 loc) · 872 Bytes
/
Create-Package.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
function create-nuspec($name) {
$spec = get-text "$name\$name.nuspec"
$spec = $spec.Replace("#version#", (get-version("$name\bin\release\$name.dll")))
$spec = $spec.Replace("#message#", (get-text(".git\COMMIT_EDITMSG")))
$spec | out-file "$name\bin\Package\$name.nuspec"
}
function get-text($file) {
return [string]::join([environment]::newline, (get-content -path $file))
}
function get-version($file) {
$file = resolve-path $file
return [System.Diagnostics.FileVersionInfo]::GetVersionInfo($file).FileVersion
}
function create-package($name){
del "$name\bin\Package" -recurse
md "$name\bin\Package\lib\net40"
copy "$name\bin\Release\*.*" "$name\bin\Package\lib\net40"
create-nuspec $name
.nuget\NuGet.exe pack "$name\bin\Package\$name.nuspec" /o "$name\bin\Package"
}
create-package CalDav
create-package CalDav.Server