more spinoff / plus related cleanup

This commit is contained in:
Eric Froemling 2023-06-20 13:37:36 -07:00
parent b423f5a783
commit ce5eb91811
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98

View File

@ -722,6 +722,7 @@ class SpinoffContext:
def default_filter_file(self, src_path: str, text: str) -> str: def default_filter_file(self, src_path: str, text: str) -> str:
"""Run default filtering on a file.""" """Run default filtering on a file."""
# pylint: disable=too-many-branches
# Strip out any sections frames by our strip-begin/end tags. # Strip out any sections frames by our strip-begin/end tags.
if any(t[0] in text for t in STRIP_TAG_PAIRS): if any(t[0] in text for t in STRIP_TAG_PAIRS):
@ -778,40 +779,71 @@ class SpinoffContext:
return sort_jetbrains_dict(self.default_filter_text(text)) return sort_jetbrains_dict(self.default_filter_text(text))
# In our public repo, if the plus featureset is not included, we don't # In our public repo, if the plus featureset is not included, we
# want to link against the precompiled plus library. # don't want to fetch or link against the precompiled plus
# (pylint false positive) # library.
assert 'plus' in self._src_all_feature_sets assert 'plus' in self._src_all_feature_sets
if ( if self._public and 'plus' in self._src_omit_feature_sets:
self._public if src_path == 'ballisticakit-cmake/CMakeLists.txt':
and 'plus' in self._src_omit_feature_sets # Strip precompiled plus library out of the cmake file.
and src_path == 'ballisticakit-cmake/CMakeLists.txt' text = replace_exact(
): text,
# Strip precompiled plus library out of the cmake file. '${CMAKE_CURRENT_BINARY_DIR}/prefablib/libballistica_plus.a'
text = replace_exact( ' ode ',
text, 'ode ',
'${CMAKE_CURRENT_BINARY_DIR}/prefablib/libballistica_plus.a' label=src_path,
' ode ', )
'ode ', if src_path.startswith(
label=src_path, 'ballisticakit-windows/'
) ) and src_path.endswith('.vcxproj'):
if ( # Strip precompiled plus library out of visual studio projects.
self._public text = replace_exact(
and 'plus' in self._src_omit_feature_sets text,
and src_path.startswith('ballisticakit-windows/') ' <ItemGroup>\r\n'
and src_path.endswith('.vcxproj') ' <Library Include="..\\..\\build\\prefab\\lib\\windows'
): '\\$(Configuration)_$(Platform)\\'
# Strip precompiled plus library out of visual studio projects. '$(MSBuildProjectName)Plus.lib" />\r\n'
text = replace_exact( ' </ItemGroup>\r\n',
text, '',
' <ItemGroup>\r\n' label=src_path,
' <Library Include="..\\..\\build\\prefab\\lib\\windows' )
'\\$(Configuration)_$(Platform)\\' if src_path == 'Makefile':
'$(MSBuildProjectName)Plus.lib" />\r\n' # Remove downloads of prebuilt plus lib for win builds.
' </ItemGroup>\r\n', text = replace_exact(
'', text,
label=src_path, ' build/prefab/lib/windows/Debug_Win32/'
) 'BallisticaKitGenericPlus.lib \\\n'
' build/prefab/lib/windows/Debug_Win32/'
'BallisticaKitGenericPlus.pdb\n',
'',
count=2,
label=src_path,
)
text = replace_exact(
text,
' build/prefab/lib/windows/Release_Win32/'
'BallisticaKitGenericPlus.lib \\\n'
' build/prefab/lib/windows/Release_Win32/'
'BallisticaKitGenericPlus.pdb\n',
'',
count=2,
label=src_path,
)
# Remove prebuilt lib download for cmake targets.
text = replace_exact(
text,
'\t@tools/pcommand update_cmake_prefab_lib standard'
' $(CM_BT_LC) build/cmake/$(CM_BT_LC)\n',
'',
label=src_path,
)
text = replace_exact(
text,
'\t@tools/pcommand update_cmake_prefab_lib server'
' $(CM_BT_LC) build/cmake/server-$(CM_BT_LC)/dist\n',
'',
label=src_path,
)
return self.default_filter_text(text) return self.default_filter_text(text)