microsoft / axe-windows

Automated accessibility testing engine for Windows applications
MIT License
136 stars 62 forks source link

feat(localization): Refactor script to auto-detect localized projects #789

Closed DaveTryon closed 1 year ago

DaveTryon commented 1 year ago

Details

In https://github.com/microsoft/axe-windows/pull/786#discussion_r1005849979, the suggestion was made to have CopyLocalizedFiles.ps1 detect which projects had localized folders to copy, as oppose to requiring that src\CI\CI.csproj call them out explicitly. This PR makes that change. The logic is as follows:

  1. Start with the solution folder
  2. Walk through all child directories of the solution folder (these are the project folders)
  3. Check for the existence of a bin\Release\netstandard2.0\localize directory within each project. This is the folder created by MicroBuild if localization is enabled
  4. If the folder exists, call into the code that was already in place in the script.

Within the script, some internal function names have been massaged to better reflect what they do.

src\CI\CI.csproj now executes the script just once. It enables Verbose logging so that we have a nice trace inside the build pipeline. This output is visible here

The files included in the package are still correct:

Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Actions.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Automation.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Automation.xml
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Core.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Desktop.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Rules.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.RuleSelection.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.SystemAbstractions.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Telemetry.dll
Axe.Windows.2.0.1\lib\netstandard20\Axe.Windows.Win32.dll
Axe.Windows.2.0.1\lib\netstandard20\cs\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\cs\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\cs\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\de\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\de\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\de\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\es\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\es\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\es\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\fr\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\fr\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\fr\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\it\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\it\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\it\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ja\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ja\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ja\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ko\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ko\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ko\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\pl\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\pl\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\pl\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\pt-BR\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\pt-BR\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\pt-BR\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ru\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ru\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\ru\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\tr\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\tr\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\tr\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\zh-Hans\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\zh-Hans\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\zh-Hans\Axe.Windows.RuleSelection.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\zh-Hant\Axe.Windows.Core.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\zh-Hant\Axe.Windows.Rules.resources.dll
Axe.Windows.2.0.1\lib\netstandard20\zh-Hant\Axe.Windows.RuleSelection.resources.dll
Motivation

Reduced maintenance if/when other projects are localized, easier debugging of the build script

Context

Pull request checklist