-
Notifications
You must be signed in to change notification settings - Fork 11
/
Build.ps1
36 lines (29 loc) · 1.23 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
# Build.ps1 -- Builds MyJournal.Notebook VS2017+ Solution using MSBuild
# Load the common script library
. "$PSScriptRoot\scripts\Common-Library.ps1"
if ($OneNote_Bitness -eq '64-bit') {
$Platform = 'x64'
} else {
$Platform = 'x86'
}
if ($global:MSBuild_EXE -eq $null) {
Set-Variable `
-Name MSBuild_EXE -Value $(Find-MSBuild $Platform) `
-Option Constant -Scope Global
}
Set-Location $PSScriptRoot
#-------------------------------------------------------------------------------
# MSBuild properties
#-------------------------------------------------------------------------------
# NOTE: THE FOLLOWING 2 PROPERTIES ARE MUTUALLY EXCLUSIVE; USE ONE OR THE OTHER
#
# To specify a semantic version, use the /p:Version property:
# EXAMPLE: '/p:Version=16.0.0-rc.1'
#
# To specify Git Commit SHA-1 hash, use the /p:SourceRevisionId property:
# EXAMPLE: "/p:SourceRevisionId=g$(Git-Latest-Commit)"
#-------------------------------------------------------------------------------
$properties = @('/p:Configuration=Release', "/p:Platform=$Platform",
"/p:SourceRevisionId=g$(Git-Latest-Commit)")
$sln = '"{0}"' -f "$PSScriptRoot\src\MyJournal.Notebook.sln"
& $MSBuild_EXE $sln $properties /t:'Clean;Build' /restore