-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.ps1
54 lines (41 loc) · 1.6 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
[String]$ScriptDir = Split-Path $Script:MyInvocation.MyCommand.Path
$ErrorActionPreference = "Stop"
Import-Module "$ScriptDir\build.vs\GitVersion.psm1"
Import-Module "$ScriptDir\build.vs\Clean.psm1"
Import-Module "$ScriptDir\build.vs\RestoreNuGet.psm1"
Import-Module "$ScriptDir\build.vs\PreBuildWizard.psm1"
Import-Module "$ScriptDir\build.vs\Build.psm1"
Import-Module "$ScriptDir\build.vs\PackNuGet.psm1"
# -------------------------------------------------------------------------------------------------------------------------------------
# #################################
# configuration
# #################################
[String] $SolutionPath = "$ScriptDir\FastActivator.sln"
$MsbuildConfigurations = @('Debug','Release')
$MsbuildPlatforms = @('Any CPU')
# -------------------------------------------------------------------------------------------------------------------------------------
# remove old build output
Clean `
-OutputPaths @("$ScriptDir\_build", "$ScriptDir\_deploy") `
-PauseOnError
# let GitVersion determine the version number from the git history via tags
GitVersion -PauseOnError
# restore NuGet packages
RestoreNuGet `
-SolutionPath "$SolutionPath" `
-PauseOnError
# patch templates and assembly infos with current version number
# check consistency of NuGet packages
PreBuildWizard `
-SolutionPath "$SolutionPath" `
-PauseOnError
# build projects
Build `
-SolutionPath "$SolutionPath" `
-MsbuildConfigurations $MsbuildConfigurations `
-MsbuildPlatforms $MsbuildPlatforms `
-SkipConsistencyCheck `
-PauseOnError
# pack nuget packages
PackNuGet -PauseOnError
Read-Host "Press ANY key..."