Conversation
Conditional Autoupdate flag in Version resource
LocalizationMappingTable.py in separate file
AddOn.rc.in
Outdated
| 3 + 1, /* VERSION_APPENDIX length */ | ||
| 0 | ||
| "@addOnLanguage@" "\0" /* Version appendix for localized data */ |
There was a problem hiding this comment.
| 3 + 1, /* VERSION_APPENDIX length */ | |
| 0 | |
| "@addOnLanguage@" "\0" /* Version appendix for localized data */ | |
| 4, | |
| 0 | |
| "@addOnLanguage@\0" |
Prefer 4 spaces to be in line with VersionInfo.rc.in.
That stray 0 looks odd. Doesn't look like anything in the documentation https://learn.microsoft.com/en-us/windows/win32/menurc/user-defined-resource
Prefer to do the length calculation for the string in CMake.
| set (out "${CMAKE_CURRENT_BINARY_DIR}/${target}-VersionInfo.rc") | ||
| configure_file ("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/VersionInfo.rc.in" "${out}" @ONLY) | ||
| target_sources ("${target}" PRIVATE "${out}") | ||
|
|
||
| set (addOnRes "${CMAKE_CURRENT_BINARY_DIR}/${target}-AddOn.rc") | ||
| configure_file ("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/AddOn.rc.in" "${addOnRes}" @ONLY) | ||
|
|
||
| target_sources ("${target}" PRIVATE "${out}" "${addOnRes}") |
There was a problem hiding this comment.
Turn this into a loop with foreach (res IN ITEMS VersionInfo AddOn).
| endfunction () | ||
|
|
||
| function (generate_add_on_version_info outSemver) | ||
| function (generate_add_on_version_info outSemver addOnLanguage) |
There was a problem hiding this comment.
Since the function is internal I almost feel like this parameter can be omitted, since it's present in the calling context anyway.
Either that or move it before the out parameter.
| endif () | ||
| endif () | ||
| generate_add_on_version_info (semver) | ||
| generate_add_on_version_info (semver ${addOnLanguage}) |
There was a problem hiding this comment.
Prefer "${...}" for things you intend to pass as a single argument and where you don't want list expansion.
| # optional members (macOS code signing for start) | ||
| set (optionalMembers codesignIdentity developmentTeamId) | ||
| set (returnAs codesignIdentity developmentTeamId) | ||
| # optional members (macOS code signing for start, autoupdate next) |
There was a problem hiding this comment.
Please remove the comment here and below for the language list.
| winLangCharsetStr = '040904b0' | ||
| if languageCode != 'INT': | ||
| winLangCharsetStr = localizationMappingTable.get (languageCode, winLangCharsetStr) | ||
| projGenParams.append (f'-DAC_WIN_LANGCHARSET_STR={winLangCharsetStr}') |
There was a problem hiding this comment.
I know it comes from the header, but I don't like this *_STR/*Str suffix. Nothing else has this, so let's keep it that way.
| if (autoupdate STREQUAL "1") | ||
| set (autoupdate "\n\t\t\tVALUE \"Autoupdate\", \"1\"") | ||
| else () | ||
| set (autoupdate "") | ||
| endif () |
There was a problem hiding this comment.
| if (autoupdate STREQUAL "1") | |
| set (autoupdate "\n\t\t\tVALUE \"Autoupdate\", \"1\"") | |
| else () | |
| set (autoupdate "") | |
| endif () | |
| set (autoupdate "") | |
| if (autoupdate STREQUAL "1") | |
| set (autoupdate "\n\t\t\tVALUE \"Autoupdate\", \"1\"") | |
| endif () |
In the other places as well.
LocalizationMappingTable.py
Outdated
| with open(gsLocalizationPath, 'r', encoding='utf-8') as f: | ||
| gsLocalizationContent = f.read () | ||
|
|
||
| if not pattern: |
There was a problem hiding this comment.
Few lines above you already assert that the pattern is not None.
LocalizationMappingTable.py
Outdated
| import re | ||
|
|
||
|
|
||
| def FillLocalizationMappingTable (devKitPath) -> str: |
There was a problem hiding this comment.
This returns a dict[str, str], not a str. You can also type hint that the devKitPath is a Path (from pathlib).
ACP-22926
As per request from AI solutions automatic update