-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.ps1
62 lines (49 loc) · 1.98 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
55
56
57
58
59
60
61
62
[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\LicenseCollector.psm1"
# -------------------------------------------------------------------------------------------------------------------------------------
# #################################
# configuration
# #################################
[String] $ProductName = "PreBuildWizard"
[String] $SolutionPath = "$ScriptDir\PreBuildWizard.sln"
[String] $LicenseTemplatePath = "$ScriptDir\THIRD_PARTY_NOTICES.template"
$MsbuildConfigurations = @('Debug','Release')
$MsbuildPlatforms = @('AnyCPU')
# -------------------------------------------------------------------------------------------------------------------------------------
# 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
# collect license for release build
LicenseCollector `
-SolutionPath "$SolutionPath" `
-Configuration "Release" `
-Platform "AnyCPU" `
-TemplatePath "$LicenseTemplatePath" `
-OutputPath "$ScriptDir\_build\.out\PreBuildWizard\AnyCPU.Release\net5.0\THIRD_PARTY_NOTICES" `
-PauseOnError
Read-Host "Press ANY key..."