Repository navigation
Expand file tree
/
Copy pathBuild.ps1
More file actions
61 lines (48 loc) · 1.99 KB
/
Copy pathBuild.ps1
File metadata and controls
61 lines (48 loc) · 1.99 KB
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
[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 = "LicenseCollector"
[String] $SolutionPath = "$ScriptDir\LicenseCollector.slnx"
[String] $LicenseTemplatePath = "$ScriptDir\THIRD_PARTY_NOTICES.template"
$MsbuildConfigurations = @('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
# collect license for release build
dotnet "_build\.out\LicenseCollector\AnyCPU.Release\net10.0\LicenseCollector.dll" `
--SolutionFilePath "$SolutionPath" `
--Configuration "Release" `
--Platform "Any CPU" `
--LicenseTemplatePath "$LicenseTemplatePath" `
"$ScriptDir\THIRD_PARTY_NOTICES"
Read-Host "Press ANY key..."