forked from microsoft/clrmd
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[master] Update dependencies from dotnet/arcade (microsoft#902)
* Update dependencies from https://github.com/dotnet/arcade build 20210310.7 Microsoft.DotNet.Arcade.Sdk From Version 6.0.0-beta.21152.1 -> To Version 6.0.0-beta.21160.7 * Update dependencies from https://github.com/dotnet/arcade build 20210317.3 Microsoft.DotNet.Arcade.Sdk From Version 6.0.0-beta.21152.1 -> To Version 6.0.0-beta.21167.3 * Update dependencies from https://github.com/dotnet/arcade build 20210326.2 Microsoft.DotNet.Arcade.Sdk From Version 6.0.0-beta.21152.1 -> To Version 6.0.0-beta.21176.2 * Update dependencies from https://github.com/dotnet/arcade build 20210403.1 Microsoft.DotNet.Arcade.Sdk From Version 6.0.0-beta.21152.1 -> To Version 6.0.0-beta.21203.1 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2fe9741
commit c7cd5b0
Showing
18 changed files
with
283 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
Param( | ||
[Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here | ||
[string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json | ||
[switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one | ||
[switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally | ||
) | ||
|
||
# Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: | ||
# https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task | ||
|
||
Set-StrictMode -Version 2.0 | ||
$ErrorActionPreference = "Stop" | ||
. $PSScriptRoot\tools.ps1 | ||
|
||
Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') | ||
|
||
$exclusionsFilePath = "$SourcesDirectory\Localize\LocExclusions.json" | ||
$exclusions = @{ Exclusions = @() } | ||
if (Test-Path -Path $exclusionsFilePath) | ||
{ | ||
$exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json | ||
} | ||
|
||
Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work | ||
|
||
# Template files | ||
$jsonFiles = @() | ||
$jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\en\..+\.json" } # .NET templating pattern | ||
$jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern | ||
|
||
$xlfFiles = @() | ||
|
||
$allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" | ||
$langXlfFiles = @() | ||
if ($allXlfFiles) { | ||
$null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' | ||
$firstLangCode = $Matches.1 | ||
$langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" | ||
} | ||
$langXlfFiles | ForEach-Object { | ||
$null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf | ||
|
||
$destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" | ||
$xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru | ||
} | ||
|
||
$locFiles = $jsonFiles + $xlfFiles | ||
|
||
$locJson = @{ | ||
Projects = @( | ||
@{ | ||
LanguageSet = $LanguageSet | ||
LocItems = @( | ||
$locFiles | ForEach-Object { | ||
$outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" | ||
$continue = $true | ||
foreach ($exclusion in $exclusions.Exclusions) { | ||
if ($outputPath.Contains($exclusion)) | ||
{ | ||
$continue = $false | ||
} | ||
} | ||
$sourceFile = ($_.FullName | Resolve-Path -Relative) | ||
if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { | ||
Remove-Item -Path $sourceFile | ||
} | ||
if ($continue) | ||
{ | ||
return @{ | ||
SourceFile = $sourceFile | ||
CopyOption = "LangIDOnName" | ||
OutputPath = $outputPath | ||
} | ||
} | ||
} | ||
) | ||
} | ||
) | ||
} | ||
|
||
$json = ConvertTo-Json $locJson -Depth 5 | ||
Write-Host "LocProject.json generated:`n`n$json`n`n" | ||
Pop-Location | ||
|
||
if (!$UseCheckedInLocProjectJson) { | ||
New-Item "$SourcesDirectory\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created | ||
Set-Content "$SourcesDirectory\Localize\LocProject.json" $json | ||
} | ||
else { | ||
New-Item "$SourcesDirectory\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created | ||
Set-Content "$SourcesDirectory\Localize\LocProject-generated.json" $json | ||
|
||
if ((Get-FileHash "$SourcesDirectory\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\Localize\LocProject.json").Hash) { | ||
Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." | ||
|
||
exit 1 | ||
} | ||
else { | ||
Write-Host "Generated LocProject.json and current LocProject.json are identical." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test"> | ||
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'"> | ||
<Python>python3</Python> | ||
<HelixPreCommands>$(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/SOD/SizeOnDisk</HelixPreCommands> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)"> | ||
<PayloadDirectory>%(Identity)</PayloadDirectory> | ||
</HelixCorrelationPayload> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'"> | ||
<ScenarioDirectory>%HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\</ScenarioDirectory> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'"> | ||
<ScenarioDirectory>$HELIX_CORRELATION_PAYLOAD/performance/src/scenarios/</ScenarioDirectory> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<HelixWorkItem Include="SOD - Android HelloWorld APK Size"> | ||
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory> | ||
<PreCommands>cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py</PreCommands> | ||
<Command>$(Python) test.py sod --scenario-name "%(Identity)"</Command> | ||
<PostCommands>$(Python) post.py</PostCommands> | ||
</HelixWorkItem> | ||
<HelixWorkItem Include="SOD - Android HelloWorld Extracted Size"> | ||
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory> | ||
<PreCommands>cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --unzip</PreCommands> | ||
<Command>$(Python) test.py sod --scenario-name "%(Identity)"</Command> | ||
<PostCommands>$(Python) post.py</PostCommands> | ||
</HelixWorkItem> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.