-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
40 lines (32 loc) · 1.55 KB
/
build.ps1
File metadata and controls
40 lines (32 loc) · 1.55 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
param(
[Parameter()]
[string]
$Version
)
# & dotnet wix build ./Installer/*.wxs -arch x64 -out output\installer\WebContent.msi
# & dotnet wix msi validate output\installer\WebContent.msi -sice ICE61
& dotnet tool restore
$null = New-Item $PSScriptRoot\output, .cache\ -ItemType Directory -Force
Get-ChildItem $PSScriptRoot\output | Remove-Item -Recurse -Force
# Download WebView2 runtime
$webview2Url = 'https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/c638b5d5-4b2f-4845-baab-c9f4fd6c58ab/MicrosoftEdgeWebView2RuntimeInstallerX64.exe'
$webviewDestination = [io.path]::Combine($PSScriptRoot, '.cache', 'MicrosoftEdgeWebView2RuntimeInstallerX64.exe')
if (!(Test-Path $webviewDestination -PathType Leaf)) {
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading WebView2 Runtime due to cache miss" -ForegroundColor Yellow
Invoke-WebRequest -Uri $webview2Url -OutFile $webviewDestination
}
if (!$PSCmdlet.MyInvocation.BoundParameters.ContainsKey('Version')) {
$Version = (dotnet nbgv get-version -f json | ConvertFrom-Json).Version
}
Write-Host "Building CascadiaWebContentPlugin.$Version.msi"
& msbuild src/Setup/setup.wixproj /t:Rebuild /restore:True /p:Configuration=Release /p:Platform=x64 /p:BuildVersion=$Version
if (!$?) {
throw "MSBuild exited with code $LASTEXITCODE"
}
Write-Host "Build completed successfully." -ForegroundColor Green
[pscustomobject]@{
Version = $Version
Artifacts = Resolve-Path $PSScriptRoot\output\WebContent
Installer = Resolve-Path $PSScriptRoot\output\Setup\en-US\
}