Skip to content

Commit 1274822

Browse files
Merge branch 'release/9.2'
2 parents 51ee738 + f0b55a2 commit 1274822

485 files changed

Lines changed: 191900 additions & 8250 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*.vcxproj -whitespace
2020
*.vcxproj.filters -whitespace
2121
*.vdproj -whitespace
22+
*.yml -whitespace
2223
*.xml -whitespace
2324
changelog -whitespace
2425
FwHelpAbout.cs -whitespace

.github/workflows/CI.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Flex CI
2+
on:
3+
push:
4+
branches: ["release/**", "develop", "master", "feature/PubSub"]
5+
pull_request:
6+
branches: ["release/**", "develop", "master", "feature/PubSub"]
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
debug_build_and_test:
15+
env:
16+
CROWDIN_API_KEY: ${{ secrets.FLEX_CROWDIN_API }}
17+
name: Build Debug and run Tests
18+
runs-on: windows-latest
19+
steps:
20+
- name: Checkout Files
21+
uses: actions/checkout@v4
22+
id: checkout
23+
24+
- name: Download 461 targeting pack
25+
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
26+
id: downloadfile # Remember to give an ID if you need the output filename
27+
with:
28+
url: "https://download.microsoft.com/download/F/1/D/F1DEB8DB-D277-4EF9-9F48-3A65D4D8F965/NDP461-DevPack-KB3105179-ENU.exe"
29+
target: public/
30+
31+
- name: Install targeting pack
32+
shell: cmd
33+
working-directory: public
34+
run: NDP461-DevPack-KB3105179-ENU.exe /q
35+
36+
- name: Setup dotnet
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: |
40+
2.1.x
41+
3.1.x
42+
5.0.x
43+
44+
- name: Prepare for build
45+
shell: cmd
46+
working-directory: Build
47+
run: build64.bat /t:WriteNonlocalDevelopmentPropertiesFile
48+
49+
- name: Build Debug and run tests
50+
id: build_and_test
51+
shell: powershell
52+
run: |
53+
cd Build
54+
.\build64.bat /t:remakefw-jenkins /p:action=test /p:desktopNotAvailable=true ^| tee-object -FilePath build.log
55+
56+
- name: Scan Debug Build Output
57+
shell: powershell
58+
working-directory: Build
59+
run: |
60+
$results = Select-String -Path "build.log" -Pattern "^\s*[1-9][0-9]* Error\(s\)"
61+
if ($results) {
62+
foreach ($result in $results) {
63+
Write-Host "Found errors in build.log $($result.LineNumber): $($result.Line)" -ForegroundColor red
64+
}
65+
exit 1
66+
} else {
67+
Write-Host "No errors found" -ForegroundColor green
68+
exit 0
69+
}
70+
71+
- name: Capture Test Results
72+
shell: powershell
73+
working-directory: Build
74+
run: .\NUnitReport /a ^| tee-object -FilePath test-results.log
75+
76+
- name: Report Test Results
77+
uses: sillsdev/fw-nunitreport-action@v2.0.0
78+
with:
79+
log-path: Build/test-results.log
80+
token: ${{ secrets.GITHUB_TOKEN }}
81+
82+
- uses: actions/upload-artifact@v4
83+
with:
84+
name: build-logs
85+
path: Build/*.log
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Commit messages check
2+
on:
3+
pull_request:
4+
workflow_call:
5+
6+
jobs:
7+
gitlint:
8+
name: Check commit messages
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Install dependencies
16+
run: |
17+
pip install --upgrade gitlint
18+
- name: Lint git commit messages
19+
shell: bash
20+
# run the linter and tee the output to a file, this will make the check fail but allow us to use the results in summary
21+
run: gitlint --ignore body-is-missing --commits origin/$GITHUB_BASE_REF.. 2>&1 | tee check_results.log
22+
- name: Propegate Error Summary
23+
if: always()
24+
shell: bash
25+
# put the output of the commit message linting into the summary for the job and in an environment variable
26+
run: |
27+
# Change the commit part of the log into a markdown link to the commit
28+
commitsUrl="https:\/\/github.com\/${{ github.repository_owner }}\/${{ github.event.repository.name }}\/commit\/"
29+
sed -i "s/Commit \([0-9a-f]\{7,40\}\)/[commit \1]($commitsUrl\1)/g" check_results.log
30+
# Put the results into the job summary
31+
cat check_results.log >> "$GITHUB_STEP_SUMMARY"
32+
# Put the results into a multi-line environment variable to use in the next step
33+
echo "check_results<<###LINT_DELIMITER###" >> "$GITHUB_ENV"
34+
echo "$(cat check_results.log)" >> "$GITHUB_ENV"
35+
echo "###LINT_DELIMITER###" >> "$GITHUB_ENV"
36+
# add a comment on the PR if the commit message linting failed
37+
- name: Comment on PR
38+
if: failure()
39+
uses: marocchino/sticky-pull-request-comment@v2
40+
with:
41+
header: Commit Comment
42+
message: |
43+
⚠️ Commit Message Format Issues ⚠️
44+
${{ env.check_results }}
45+
- name: Clear PR Comment
46+
if: success()
47+
uses: marocchino/sticky-pull-request-comment@v2
48+
with:
49+
header: Commit Comment
50+
hide: true
51+
hide_classify: "RESOLVED"
52+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: check-whitespace
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
# Avoid unnecessary builds
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check-whitespace:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: git log --check
21+
id: check_out
22+
run: |
23+
echo "Starting the script."
24+
baseSha=${{ github.event.pull_request.base.sha }}
25+
git log --check --pretty=format:"---% h% s" ${baseSha}.. | tee check-results.log
26+
problems=()
27+
commit=
28+
commitText=
29+
commitTextmd=
30+
# Use git log --check to look for whitespace errors in each commit of this PR
31+
log_output=$(cat check-results.log)
32+
echo "${log_output}"
33+
# Use a for loop to iterate over lines of log_output
34+
IFS=$'\n'
35+
for line in $log_output; do
36+
echo "Line: ${line}"
37+
case "${line}" in
38+
"--- "*)
39+
IFS=' ' read -r _ commit commitText <<< "$line"
40+
commitTextmd="[${commit}](https://github.com/${{ github.repository }}/commit/${commit}) ${commitText}"
41+
;;
42+
"")
43+
;;
44+
*:[1-9]*:*) # contains file and line number information - This indicates that a whitespace error was found
45+
file="${line%%:*}"
46+
afterFile="${line#*:}" # Remove the first colon and everything before it
47+
lineNumber="${afterFile%%:*}" # Remove anything after and including the first remaining colon to get only the line number
48+
problems+=("[${commitTextmd}]")
49+
problems+=("[${line}](https://github.com/${{ github.repository }}/blob/${{github.event.pull_request.head.ref}}/${file}#L${lineNumber})")
50+
problems+=""
51+
;;
52+
esac
53+
done
54+
if test ${#problems[*]} -gt 0; then
55+
echo "⚠️ Please review the Summary output for further information." >> $GITHUB_STEP_SUMMARY
56+
echo "### A whitespace issue was found in one or more of the commits." >> $GITHUB_STEP_SUMMARY
57+
echo "" >> $GITHUB_STEP_SUMMARY
58+
echo "Errors:" >> $GITHUB_STEP_SUMMARY
59+
for i in "${problems[@]}"; do
60+
echo "${i}" >> $GITHUB_STEP_SUMMARY
61+
done
62+
exit 1
63+
fi
64+
echo "No problems found"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Bin/_setLatestBuildConfig.bat
2929
Bin/_setroot.bat
3030
Lib/debug/DebugProcs.lib
3131
Lib/debug/Generic.lib
32+
Lib/debug/System.ValueTuple.dll
3233
Lib/debug/unit++.*
3334
Lib/release/DebugProcs.lib
3435
Lib/release/Generic.lib
@@ -39,6 +40,7 @@ Src/FwParatextLexiconPlugin/GeneratedParatextLexiconPluginRegistryHelper.cs
3940
Src/Common/FwUtils/GeneratedFwUtils.cs
4041
Src/CommonAssemblyInfo.cs
4142
Src/LangInst/InstallLanguageTests/timing.txt
43+
x64
4244

4345
# other files
4446
*.user

Build/Installer.targets

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@
101101
A base build should warn if we have 'RemovedSinceLastBase' items to help us remember to clear these out.
102102
-->
103103
<Target Name="RescuePatching">
104-
<!-- <ItemGroup>
105-
<RemovedSinceLastBase Include="$(dir-outputBase)/Example.dll" />
104+
<ItemGroup>
105+
<RemovedSinceLastBase Include="$(dir-outputBase)/Helps/WW-ConceptualIntro/ConceptualIntroduction.htm" />
106+
<RemovedSinceLastBase Include="$(dir-outputBase)/Helps/ConceptualIntroFLEx.pdf" />
107+
<RemovedSinceLastBase Include="$(dir-outputBase)/NHunspell.dll" />
108+
<RemovedSinceLastBase Include="$(dir-outputBase)/Hunspellx64.dll" />
106109
</ItemGroup>
107-
<WriteLinesToFile File="%(RemovedSinceLastBase.FullPath)" Lines="" /> -->
110+
<WriteLinesToFile File="%(RemovedSinceLastBase.FullPath)" Lines="" />
108111
</Target>
109112
<!-- ########################################################################################################## -->
110113
<!-- ### Compile Targets ### -->
@@ -210,6 +213,7 @@
210213
<L10nFiles Include="$(OutputDirForConfig)\ur\**\*"/>
211214
<L10nFiles Include="$(OutputDirForConfig)\vi\**\*"/>
212215
<L10nFiles Include="$(OutputDirForConfig)\zh-CN\**\*"/>
216+
<L10nFiles Include="$(OutputDirForConfig)\zlm\**\*"/>
213217
<!-- no need to install the following; most are installed by merge modules -->
214218
<MergeModules Include="$(OutputDirForConfig)\asserts.log"/>
215219
<MergeModules Include="$(OutputDirForConfig)\basicTest.xml"/>
@@ -303,7 +307,8 @@
303307
<PropertyGroup>
304308
<!-- Substring keeps Chinese the same length as everyone else (and '-' is an illegal character in some places) -->
305309
<!-- "The nail that sticks up gets hammered down" (Japanese proverb) -->
306-
<SafeTargetLocale>$(TargetLocale.Substring(0,2))</SafeTargetLocale>
310+
<SafeTargetLocale Condition="'$(TargetLocale)'=='zh-CN'">$(TargetLocale.Substring(0,2))</SafeTargetLocale>
311+
<SafeTargetLocale Condition="'$(TargetLocale)'!='zh-CN'">$(TargetLocale)</SafeTargetLocale>
307312
<!-- KeyPathFix changes KeyPath="yes" to KeyPath="no" so we can overwrite later versions of files, if necessary. -->
308313
<!-- See https://github.com/sillsdev/genericinstaller's README for details. -->
309314
<KeyPathFixArg Condition="'$(FixKeyPath)'=='true'">-t $(InstallerDir)/BaseInstallerBuild/KeyPathFix.xsl</KeyPathFixArg>
@@ -396,7 +401,8 @@
396401
Condition="!Exists('$(WixLibsDir)/vcredist_2015-19_x64.exe') And $(Platform)=='x64'"
397402
DownloadsDir="$(WixLibsDir)"/> <!-- VisualC++ 14.1 runtime -->
398403
<!-- FLEx Bridge -->
399-
<DownloadFile Address="https://build.palaso.org/guestAuth/repository/download/FLExBridgeDevelopWin32InstallerSansPublish/fw-9.1.22.tcbuildtag/FLExBridge_Offline.exe"
404+
<DownloadFile Address="https://software.sil.org/downloads/r/fieldworks/FlexBridge_Offline_4.2.0.exe"
405+
LocalFilename="FLExBridge_Offline.exe"
400406
Condition="!Exists('$(WixLibsDir)/FLExBridge_Offline.exe')"
401407
DownloadsDir="$(WixLibsDir)"/> <!-- TODO: always download to get the latest version -->
402408
</Target>
@@ -439,12 +445,12 @@
439445
</MSBuild.ExtensionPack.Framework.Guid>
440446
<Message Text="Generated GUID '$(ProductIdGuid)'"/>
441447
<PropertyGroup>
442-
<MsiFile>$(SafeApplicationName)_$(Revision).msi</MsiFile>
448+
<MsiFile>$(SafeApplicationName)_$(PatchVersionSegment).msi</MsiFile>
443449
<BaseBuildDir>$(InstallerDir)/BaseInstallerBuild</BaseBuildDir>
444450
<BaseBuildArgs>"$(ApplicationName)" $(SafeApplicationName) $(BuildVersion) $(ProductIdGuid) $(UpgradeCodeGuid) "$(AppBuildDir)/$(BinDirSuffix)" "$(AppBuildDir)/$(DataDirSuffix)" $(CopyrightYear) "$(Manufacturer)" $(SafeManufacturer) $(Arch)</BaseBuildArgs>
445451
</PropertyGroup>
446452
<!-- Suppress ICE30 because we and Encoding Converters MM both install Geckofx, resulting in an ICE warning for double ref counting -->
447-
<Exec WorkingDirectory="$(BaseBuildDir)" Command="(set SuppressICE=-sice:ICE30) &amp; buildBaseInstaller.bat $(BaseBuildArgs)" />
453+
<Exec WorkingDirectory="$(BaseBuildDir)" Command="buildBaseInstaller.bat $(BaseBuildArgs)" EnvironmentVariables="SuppressICE=-sice:ICE30" />
448454
<ItemGroup>
449455
<InstallerFiles Include="$(BaseBuildDir)/**/$(SafeApplicationName)_*.exe"/>
450456
<InstallerFiles Include="$(BaseBuildDir)/**/$(SafeApplicationName)_*.msi"/>

Build/Localize.targets

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="Current">
33

4+
<UsingTask TaskName="CopyLocale" AssemblyFile="FwBuildTasks.dll"/>
45
<UsingTask TaskName="GoldEticToXliff" AssemblyFile="FwBuildTasks.dll"/>
56
<UsingTask TaskName="ListsToXliff" AssemblyFile="FwBuildTasks.dll"/>
67
<UsingTask TaskName="LocalizeFieldWorks" AssemblyFile="FwBuildTasks.dll"/>
@@ -13,7 +14,7 @@
1314

1415
<!-- Localize strings-en.xml, lists, and all resx files -->
1516
<Target Name="localize" DependsOnTargets="localize-source;localize-binaries"/>
16-
<Target Name="localize-source" DependsOnTargets="Initialize;downloadTranslatedFiles;copyLibL10ns;combineGOLDEtic;zipLocalizedLists;processLanguages-source" Condition="'$(DisableLocalization)'!='true'"/>
17+
<Target Name="localize-source" DependsOnTargets="Initialize;downloadTranslatedFiles;copyLibL10ns;combineGOLDEtic;copyLocales;zipLocalizedLists;processLanguages-source" Condition="'$(DisableLocalization)'!='true'"/>
1718
<Target Name="localize-binaries" DependsOnTargets="Initialize;processLanguages-binaries" Condition="'$(DisableLocalization)'!='true'"/>
1819

1920
<PropertyGroup>
@@ -34,6 +35,9 @@
3435
<!-- Install overcrowdin, or update if already installed. -->
3536
<Exec WorkingDirectory="$(fwrt)" Command="dotnet tool update -g overcrowdin || dotnet tool install -g overcrowdin"/>
3637
</Target>
38+
<Target Name="copyLocales" DependsOnTargets="VerifyLcmCloned"> <!-- Copy locales to alternate ws identifiers -->
39+
<CopyLocale SourceL10n="$(L10nsDirectory)/ms" DestL10n="$(L10nsDirectory)/zlm" LcmDir="$(LcmSrcDir)" />
40+
</Target>
3741

3842
<!-- Update localizable files in Crowdin -->
3943
<Target Name="uploadUpdatesForTranslation" DependsOnTargets="CopyLcmResxFiles;InstallOvercrowdin">
@@ -69,7 +73,7 @@
6973
<Target Name="downloadTranslatedFiles" Condition="'$(disableDownloads)'!='true'" DependsOnTargets="InstallOvercrowdin">
7074
<ForceDelete Files="$(L10nsDirectory)"/>
7175
<MakeDir Directories="$(DownloadsDir)"/>
72-
<Exec WorkingDirectory="$(fwrt)" Command="overcrowdin download -v -r2 -f $(CrowdinZip)" ContinueOnError="$(OnFailedCrowdinDownload)"/>
76+
<Exec WorkingDirectory="$(fwrt)" Command="overcrowdin download -v -f $(CrowdinZip)" ContinueOnError="$(OnFailedCrowdinDownload)"/>
7377
<Unzip ZipFilename="$(CrowdinZip)" ToDir="$(L10nsDirectory)"/>
7478
<NormalizeLocales L10nsDirectory="$(L10nsDirectory)"/>
7579
<ItemGroup>
@@ -152,6 +156,11 @@
152156
<XliffFiles Include="$(LocaleDir)/Lists/*.xlf"/>
153157
</ItemGroup>
154158
<XliffToLists XliffSourceFiles="@(XliffFiles)" OutputXml="$(OutputXml)"/>
159+
<!-- To support varied windows locale options for Malay we copy ms to zlm, adjust the xml contents -->
160+
<Message Text="Making zlm adjustments to the ms LocalizedLists copy" Condition="'$(Locale)'=='zlm'" />
161+
<XmlPoke XmlInputPath="$(OutputXml)"
162+
Query="//*[@ws='ms']/@ws"
163+
Value="zlm" Condition="'$(Locale)'=='zlm'"/>
155164
<Zip Source="$(OutputXml)" Destination="$(fwrt)/DistFiles/Templates"/>
156165
</Target>
157166

Build/Src/FwBuildTasks/FwBuildTasks.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
<RootNamespace>SIL.FieldWorks.Build.Tasks</RootNamespace>
44
<Description>Additional msbuild tasks for FieldWorks</Description>
55
<Product>FwBuildTasks</Product>
6-
<TargetFramework>net461</TargetFramework>
6+
<TargetFramework>net462</TargetFramework>
77
<OutputPath>../..</OutputPath>
88
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
99
</PropertyGroup>
10-
1110
<ItemGroup>
1211
<PackageReference Include="NUnit" Version="3.13.3" PrivateAssets="All" />
12+
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
1313
<PackageReference Include="SIL.TestUtilities" Version="12.0.0-*" PrivateAssets="All" />
14+
<Reference Include="netstandard" />
1415
<Reference Include="Microsoft.Build.Framework" />
1516
<Reference Include="Microsoft.Build.Utilities.v4.0" />
1617
<Reference Include="System.IO.Compression" />

Build/Src/FwBuildTasks/FwBuildTasksTests/NormalizeLocalesTests.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020 SIL International
1+
// Copyright (c) 2020 SIL International
22
// This software is licensed under the LGPL, version 2.1 or later
33
// (http://www.gnu.org/licenses/lgpl-2.1.html)
44

@@ -60,6 +60,19 @@ public void Works()
6060
VerifyLocale("zh-CN", "zh");
6161
}
6262

63+
[Test]
64+
public void CopyMalay()
65+
{
66+
FileSystemSetup(new[] { "ms" });
67+
68+
VerifyLocale("ms", "zlm");
69+
70+
_task.Execute();
71+
72+
VerifyLocale("ms", "zzz");
73+
VerifyLocale("zlm", "zzz");
74+
}
75+
6376
private void FileSystemSetup(string[] locales)
6477
{
6578
foreach (var locale in locales)

0 commit comments

Comments
 (0)