Skip to content

Commit f984268

Browse files
committed
ci: build all languages for Gateway installer
1 parent cb63344 commit f984268

3 files changed

Lines changed: 35 additions & 6 deletions

File tree

ci/Build/Build.psm1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ function Get-PackageLanguages {
4646
)
4747
}
4848

49-
# Sets the specified envrionment variable to the given path.
49+
function Get-GatewayPackageLanguages {
50+
return @(
51+
[PSCustomObject]@{ Name = 'en-US'; LCID = 1033 },
52+
[PSCustomObject]@{ Name = 'fr-FR'; LCID = 1036 },
53+
[PSCustomObject]@{ Name = 'de-DE'; LCID = 1031 }
54+
)
55+
}
56+
57+
# Sets the specified environment variable to the given path.
5058
#
5159
# If the environment variable is not set, it is set to the path.
5260
# If the environment variable is set to a different value than the path provided, an error is thrown.
@@ -111,5 +119,6 @@ function Merge-Tokens {
111119
Export-ModuleMember -Function Get-NativeTarget
112120
Export-ModuleMember -Function Get-Version
113121
Export-ModuleMember -Function Get-PackageLanguages
122+
Export-ModuleMember -Function Get-GatewayPackageLanguages
114123
Export-ModuleMember -Function Set-EnvVarPath
115124
Export-ModuleMember -Function Merge-Tokens

ci/package-gateway-windows.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Import-Module (Join-Path $PSScriptRoot 'Build')
2828
function New-GatewayMsi() {
2929
param(
3030
[switch]
31-
# Generates additional files for the MSI. The MSI is not copied to the output directory if this is set. This produces files `package\WindowsManaged\Release\en-US` and `package\WindowsManaged\Release\fr-FR`.
31+
# Generates additional files for the MSI. The MSI is not copied to the output directory if this is set. This produces files `package\WindowsManaged\Release\en-US`, `package\WindowsManaged\Release\fr-FR`, and `package\WindowsManaged\Release\de-DE`.
3232
$Generate,
3333
[parameter(Mandatory = $true)]
3434
# The path to devolutions-gateway.exe.
@@ -82,7 +82,7 @@ function New-GatewayMsi() {
8282
# This is used by `package/WindowsManaged/Program.cs`.
8383
$Env:DGATEWAY_MSI_SOURCE_ONLY_BUILD = '1'
8484

85-
foreach ($lang in Get-PackageLanguages) {
85+
foreach ($lang in Get-GatewayPackageLanguages) {
8686
$Env:DGATEWAY_MSI_LANG_ID = $lang.Name
8787
& 'MSBuild.exe' 'DevolutionsGateway.sln' '/t:restore,build' '/p:Configuration=Release' | Out-Host
8888
if ($LASTEXITCODE -ne 0) {

ci/tlk.ps1

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,21 @@ class TlkRecipe
268268
}
269269
)
270270

271+
static [object[]] $GatewayPackageLanguages = @(
272+
[PSCustomObject]@{
273+
Name = "en-US";
274+
LCID = 1033;
275+
},
276+
[PSCustomObject]@{
277+
Name = "fr-FR";
278+
LCID = 1036;
279+
},
280+
[PSCustomObject]@{
281+
Name = "de-DE";
282+
LCID = 1031;
283+
}
284+
)
285+
271286
TlkRecipe() {
272287
$this.Init()
273288
}
@@ -483,12 +498,17 @@ class TlkRecipe
483498

484499
$TargetConfiguration = "Release"
485500

501+
$Languages = switch ($this.Product) {
502+
"gateway" { [TlkRecipe]::GatewayPackageLanguages }
503+
default { [TlkRecipe]::PackageLanguages }
504+
}
505+
486506
# Build the base (en-US) MSI
487507
& ".\$TargetConfiguration\Build_$($this.PackageName()).cmd"
488508

489509
$BaseMsi = Join-Path $TargetConfiguration "$($this.PackageName()).msi"
490510

491-
foreach ($PackageLanguage in $([TlkRecipe]::PackageLanguages | Select-Object -Skip 1)) {
511+
foreach ($PackageLanguage in $($Languages | Select-Object -Skip 1)) {
492512
# Build the localized MSI
493513
& ".\$TargetConfiguration\$($PackageLanguage.Name)\Build_$($this.PackageName()).cmd"
494514
$LangDir = Join-Path $TargetConfiguration $PackageLanguage.Name
@@ -501,7 +521,7 @@ class TlkRecipe
501521
}
502522

503523
# Set the complete language list on the base MSI
504-
$LCIDs = ([TlkRecipe]::PackageLanguages | ForEach-Object { $_.LCID }) -join ','
524+
$LCIDs = ($Languages | ForEach-Object { $_.LCID }) -join ','
505525
& 'cscript.exe' "/nologo" "$($this.SourcePath)/ci/WiLangId.vbs" "$BaseMsi" "Package" "$LCIDs" | Out-Host
506526

507527
switch ($this.Product) {
@@ -549,7 +569,7 @@ class TlkRecipe
549569
& 'MSBuild.exe' "DevolutionsGateway.sln" "/t:restore,build" "/p:Configuration=$TargetConfiguration" | Out-Host
550570

551571
if ($SourceOnlyBuild) {
552-
foreach ($PackageLanguage in $([TlkRecipe]::PackageLanguages | Select-Object -Skip 1)) {
572+
foreach ($PackageLanguage in $([TlkRecipe]::GatewayPackageLanguages | Select-Object -Skip 1)) {
553573
$Env:DGATEWAY_MSI_LANG_ID = $PackageLanguage.Name
554574
& 'MSBuild.exe' "DevolutionsGateway.sln" "/t:restore,build" "/p:Configuration=$TargetConfiguration" | Out-Host
555575
}

0 commit comments

Comments
 (0)