-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.ps1
98 lines (77 loc) · 3.97 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Properties {
$project_dir = Split-Path $psake.build_script_file
$src_dir = "$project_dir\src"
$out_dir = "$project_dir\out"
$nuget_path = "$project_dir\tools\.nuget"
$nuspec_dir = "$project_dir\nuspecs"
$nupgk_dir = "$project_dir\nupkg"
$version_file = "$src_dir\FrameworkVersion.cs"
$old_path = ""
}
Task Default -Depends Build
Task ExtendPath {
$old_path = get-item -path "ENV:PATH"
if (-not $old_path.value.Contains($nuget_path))
{
$path = "$nuget_path;" + $old_path.value;
set-item -force -path "ENV:PATH" -value "$path"
}
}
Task Clean -Depends ExtendPath {
Write-Host "Clean all Builds" -ForegroundColor Green
Exec { msbuild "$src_dir\Aperea.Bootstrap.sln" /t:Clean /v:quiet /p:Configuration=Release }
Exec { msbuild "$src_dir\Aperea.Bootstrap.sln" /t:Clean /v:quiet /p:Configuration=Debug }
}
Task Build -Depends Clean {
Write-Host "Building ApereaFramework.sln" -ForegroundColor Green
Install-Packages $src_dir "$src_dir\packages"
Exec { msbuild "$src_dir\Aperea.Bootstrap.sln" /t:Build /v:quiet /p:Configuration=Release /p:OutDir="$out_dir\" }
}
Task BumpRevision {
BumpRevision $version_file
}
Task BumpBuildVersion {
BumpBuildVersion $version_file
}
Task BumpMinorVersion {
BumpMinorVersion $version_file
}
Task BumpMajorVersion {
BumpMajorVersion $version_file
}
Task SetPackageVersion {
$version = Get-AssemblyInfoVersion $version_file
Write-Host "Updating NuGet-Packages Version to $version" -ForegroundColor Green
$depVersion = "[$version]"
Set-PackageVersion "$nuspec_dir\Aperea.Bootstrap.nuspec" $version
Set-PackageVersion "$nuspec_dir\Aperea.Bootstrap.Mvc.nuspec" $version @{"Aperea.Bootstrap"=$depVersion}
Set-PackageVersion "$nuspec_dir\Aperea.Bootstrap.Logging.nuspec" $version @{"Aperea.Bootstrap"=$depVersion}
Set-PackageVersion "$nuspec_dir\Aperea.Bootstrap.WebApi.nuspec" $version @{"Aperea.Bootstrap"=$depVersion}
Set-PackageVersion "$nuspec_dir\Aperea.Common.nuspec" $version @{"Aperea.Bootstrap"=$depVersion}
Set-PackageVersion "$nuspec_dir\Aperea.Data.EntityFramework.nuspec" $version @{"Aperea.Bootstrap"=$depVersion}
}
Task CreateNuGet -Depends Build, SetPackageVersion {
Write-Host "Creating NuGet-Packages" -ForegroundColor Green
md $nupgk_dir -force
Exec { .\tools\nuget\nuget.exe pack "$nuspec_dir\Aperea.Bootstrap.nuspec" /OutputDirectory "$nupgk_dir\" }
Exec { .\tools\nuget\nuget.exe pack "$nuspec_dir\Aperea.Bootstrap.Mvc.nuspec" /OutputDirectory "$nupgk_dir\" }
Exec { .\tools\nuget\nuget.exe pack "$nuspec_dir\Aperea.Bootstrap.Logging.nuspec" /OutputDirectory "$nupgk_dir\" }
Exec { .\tools\nuget\nuget.exe pack "$nuspec_dir\Aperea.Bootstrap.WebApi.nuspec" /OutputDirectory "$nupgk_dir\" }
Exec { .\tools\nuget\nuget.exe pack "$nuspec_dir\Aperea.Common.nuspec" /OutputDirectory "$nupgk_dir\" }
Exec { .\tools\nuget\nuget.exe pack "$nuspec_dir\Aperea.Data.EntityFramework.nuspec" /OutputDirectory "$nupgk_dir\" }
}
Task Release -Depends CreateNuGet {
}
Task PushIt -Depends Release {
$version = Get-AssemblyInfoVersion $version_file
Write-Host "Pushing NuGet-Packages" -ForegroundColor Green
Exec { .\tools\nuget\nuget.exe push "$nupgk_dir\Aperea.Bootstrap.$version.nupkg" }
Exec { .\tools\nuget\nuget.exe push "$nupgk_dir\Aperea.Bootstrap.Mvc.$version.nupkg" }
Exec { .\tools\nuget\nuget.exe push "$nupgk_dir\Aperea.Bootstrap.Logging.$version.nupkg" }
Exec { .\tools\nuget\nuget.exe push "$nupgk_dir\Aperea.Bootstrap.WebApi.$version.nupkg" }
Exec { .\tools\nuget\nuget.exe push "$nupgk_dir\Aperea.Common.$version.nupkg" }
Exec { .\tools\nuget\nuget.exe push "$nupgk_dir\Aperea.Data.EntityFramework.$version.nupkg" }
}
Task NuGetPush -Depends PushIt, BumpRevision {
$version = Get-AssemblyInfoVersion $version_file
}