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,15 +779,12 @@ 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
and src_path == 'ballisticakit-cmake/CMakeLists.txt'
):
# Strip precompiled plus library out of the cmake file. # Strip precompiled plus library out of the cmake file.
text = replace_exact( text = replace_exact(
text, text,
@ -795,12 +793,9 @@ class SpinoffContext:
'ode ', 'ode ',
label=src_path, label=src_path,
) )
if ( if src_path.startswith(
self._public 'ballisticakit-windows/'
and 'plus' in self._src_omit_feature_sets ) and src_path.endswith('.vcxproj'):
and src_path.startswith('ballisticakit-windows/')
and src_path.endswith('.vcxproj')
):
# Strip precompiled plus library out of visual studio projects. # Strip precompiled plus library out of visual studio projects.
text = replace_exact( text = replace_exact(
text, text,
@ -812,6 +807,43 @@ class SpinoffContext:
'', '',
label=src_path, label=src_path,
) )
if src_path == 'Makefile':
# Remove downloads of prebuilt plus lib for win builds.
text = replace_exact(
text,
' 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)