aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-windows.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-windows.ps1')
-rw-r--r--scripts/build-windows.ps139
1 files changed, 3 insertions, 36 deletions
diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1
index 71b27b8..c22e033 100644
--- a/scripts/build-windows.ps1
+++ b/scripts/build-windows.ps1
@@ -100,38 +100,6 @@ if ([System.Version]$ACTUAL_PYTHON_VERSION -ne [System.Version]$EXPECTED_PYTHON_
100 expected: [$EXPECTED_PYTHON_VERSION] 100 expected: [$EXPECTED_PYTHON_VERSION]
101 actual : [$ACTUAL_PYTHON_VERSION]" 101 actual : [$ACTUAL_PYTHON_VERSION]"
102} 102}
103
104# Check MSVS Tools through MSVS_VERSION
105$EXPECTED_MSVST_VERSION = @("2019","2022")
106$NPM_CONFIG_MSVS_VERSION = npm config get msvs_version
107if((-not $NPM_CONFIG_MSVS_VERSION) -or -not ($EXPECTED_MSVST_VERSION -contains $NPM_CONFIG_MSVS_VERSION)){
108 Write-Host "Your Microsoft Visual Studio Tools isn't set properly or it's not the right version!
109 Checking your version..."
110
111 # TODO: Implement path for ARM machines
112 $MSVS_REG_PATH = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64"
113
114 if(-not (Test-Path -Path $MSVS_REG_PATH)){
115 fail_with_docs "You don't have the Microsoft Visual Studio Tools installed!"
116 }
117
118 $MSVS_VERSION = [int]((Get-ItemProperty -Path $MSVS_REG_PATH).Version.substring(4, 2))
119 switch($MSVS_VERSION) {
120 { $MSVS_VERSION -ge 30 } {$ACTUAL_MSVST_VERSION = "2022"}
121 { ($MSVS_VERSION -ge 20) -and ($MSVS_VERSION -le 29) } {$ACTUAL_MSVST_VERSION = "2019"}
122 { $MSVS_VERSION -lt 20 } {$ACTUAL_MSVST_VERSION = "2017 or lower"}
123 }
124
125 if (-not ($EXPECTED_MSVST_VERSION -contains $ACTUAL_MSVST_VERSION)) {
126 fail_with_docs "You are not running the expected version of MSVS Tools!
127 expected: [$EXPECTED_MSVST_VERSION]
128 actual : [$ACTUAL_MSVST_VERSION]"
129 }
130
131 Write-Host "Changing your msvs_version on npm to [$ACTUAL_MSVST_VERSION]"
132 npm config set msvs_version $ACTUAL_MSVST_VERSION
133}
134
135# Check pnpm version 103# Check pnpm version
136$EXPECTED_PNPM_VERSION = (Get-Content .\recipes\package.json | ConvertFrom-Json).engines.pnpm 104$EXPECTED_PNPM_VERSION = (Get-Content .\recipes\package.json | ConvertFrom-Json).engines.pnpm
137$ACTUAL_PNPM_VERSION = Get-Command pnpm --version -ErrorAction SilentlyContinue # in case the pnpm executable itself is not present 105$ACTUAL_PNPM_VERSION = Get-Command pnpm --version -ErrorAction SilentlyContinue # in case the pnpm executable itself is not present
@@ -162,12 +130,11 @@ Pop-Location
162& pnpm i 130& pnpm i
163& pnpm prepare 131& pnpm prepare
164& pnpm lint 132& pnpm lint
165# TODO: Uncomment after fixing tests 133& pnpm test
166# & pnpm test
167 134
168# ----------------------------------------------------------------------------- 135# -----------------------------------------------------------------------------
169Write-Host "*************** Starting app ***************" 136Write-Host "*************** Starting app ***************"
170& node ace migration:refresh 137& pnpm refresh
171& pnpm start --dev 138& pnpm dev
172 139
173Write-Host "*************** App successfully stopped! ***************" 140Write-Host "*************** App successfully stopped! ***************"