Skip to content

Commit a5dbede

Browse files
authored
Update OneLocBuild for release/5.0 (#7529)
1 parent f8399d8 commit a5dbede

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

eng/common/generate-locproject.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ErrorActionPreference = "Stop"
1414

1515
Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1')
1616

17-
$exclusionsFilePath = "$SourcesDirectory\Localize\LocExclusions.json"
17+
$exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json"
1818
$exclusions = @{ Exclusions = @() }
1919
if (Test-Path -Path $exclusionsFilePath)
2020
{
@@ -38,7 +38,7 @@ if ($allXlfFiles) {
3838
$langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf"
3939
}
4040
$langXlfFiles | ForEach-Object {
41-
$null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf'
41+
$null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf
4242

4343
$destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf"
4444
$xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru
@@ -92,14 +92,14 @@ Write-Host "LocProject.json generated:`n`n$json`n`n"
9292
Pop-Location
9393

9494
if (!$UseCheckedInLocProjectJson) {
95-
New-Item "$SourcesDirectory\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created
96-
Set-Content "$SourcesDirectory\Localize\LocProject.json" $json
95+
New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created
96+
Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json
9797
}
9898
else {
99-
New-Item "$SourcesDirectory\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created
100-
Set-Content "$SourcesDirectory\Localize\LocProject-generated.json" $json
99+
New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created
100+
Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json
101101

102-
if ((Get-FileHash "$SourcesDirectory\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\Localize\LocProject.json").Hash) {
102+
if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) {
103103
Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them."
104104

105105
exit 1

eng/common/templates/job/onelocbuild.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ parameters:
1212
SourcesDirectory: $(Build.SourcesDirectory)
1313
CreatePr: true
1414
AutoCompletePr: false
15+
UseLfLineEndings: true
1516
UseCheckedInLocProjectJson: false
1617
LanguageSet: VS_Main_Languages
1718
LclSource: lclFilesInRepo
1819
LclPackageId: ''
1920
RepoType: gitHub
21+
GitHubOrg: dotnet
22+
MirrorRepo: ''
23+
MirrorBranch: main
2024
condition: ''
2125

2226
jobs:
@@ -52,18 +56,24 @@ jobs:
5256
env:
5357
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
5458
inputs:
55-
locProj: Localize/LocProject.json
59+
locProj: eng/Localize/LocProject.json
5660
outDir: $(Build.ArtifactStagingDirectory)
5761
lclSource: ${{ parameters.LclSource }}
5862
lclPackageId: ${{ parameters.LclPackageId }}
5963
isCreatePrSelected: ${{ parameters.CreatePr }}
6064
${{ if eq(parameters.CreatePr, true) }}:
6165
isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }}
66+
isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }}
6267
packageSourceAuth: patAuth
6368
patVariable: ${{ parameters.CeapexPat }}
6469
${{ if eq(parameters.RepoType, 'gitHub') }}:
6570
repoType: ${{ parameters.RepoType }}
6671
gitHubPatVariable: "${{ parameters.GithubPat }}"
72+
${{ if ne(parameters.MirrorRepo, '') }}:
73+
isMirrorRepoSelected: true
74+
gitHubOrganization: ${{ parameters.GitHubOrg }}
75+
mirrorRepo: ${{ parameters.MirrorRepo }}
76+
mirrorBranch: ${{ parameters.MirrorBranch }}
6777
condition: ${{ parameters.condition }}
6878

6979
- task: PublishBuildArtifacts@1
@@ -77,7 +87,7 @@ jobs:
7787
- task: PublishBuildArtifacts@1
7888
displayName: Publish LocProject.json
7989
inputs:
80-
PathtoPublish: '$(Build.SourcesDirectory)/Localize/'
90+
PathtoPublish: '$(Build.SourcesDirectory)/eng/Localize/'
8191
PublishLocation: Container
8292
ArtifactName: Loc
8393
condition: ${{ parameters.condition }}

0 commit comments

Comments
 (0)