@@ -19,18 +19,22 @@ function Remove-ArtifactsDir {
19
19
20
20
function Update-GeneratedCode {
21
21
# Regenerate source code since it occasionally happens that merged pull requests did not include all the regenerated code
22
- write-host - foreground blue " Generate code... `n --- "
23
- write-host " $root \ UnitsNet\ Scripts\ GenerateUnits.ps1"
22
+ $genScriptDotNet = " $root /UnitsNet/Scripts/GenerateUnits.ps1 "
23
+ $genScriptWrc = " $root / UnitsNet.WindowsRuntimeComponent/ Scripts/ GenerateUnits.ps1"
24
24
25
- & " $root \UnitsNet\Scripts\GenerateUnits.ps1"
25
+ write-host - foreground blue " Generate code for .NET...`n ---"
26
+ write-host $genScriptDotNet
27
+ & $genScriptDotNet
26
28
if ($lastexitcode -ne 0 ) { exit 1 }
27
29
28
- if (-not $IncludeWindowsRuntimeComponent ) {
29
- write-host - foreground yellow " Skipping WindowsRuntimeComponent code regen."
30
- } else {
31
- & " $root \UnitsNet.WindowsRuntimeComponent\Scripts\GenerateUnits.ps1"
32
- if ($lastexitcode -ne 0 ) { exit 1 }
33
- }
30
+ # Regenerate WRC code even if we are not building that target.
31
+ # The reason is that build.bat will skip WRC build since most people don't have that dependency installed.
32
+ # AppVeyor build server would still regen and build WRC regardless, but this way we also get the changes
33
+ # into pull requests so they are visible and master branch is kept up-to-date.
34
+ write-host - foreground blue " Generate code for Windows Runtime Component...`n ---"
35
+ write-host $genScriptWrc
36
+ & $genScriptWrc
37
+ if ($lastexitcode -ne 0 ) { exit 1 }
34
38
35
39
write-host - foreground blue " Generate code...END`n "
36
40
}
0 commit comments