CocoaPods
CocoaPods copied to clipboard
Fix `SWIFT_INCLUDE_PATHS` for swift library xcframework
Issue
- https://github.com/CocoaPods/CocoaPods/issues/10058
- https://github.com/CocoaPods/CocoaPods/pull/11093
Description
Existing issues
- If a swift library of type library exists in vendored xcframework,
SWIFT_INCLUDE_PATHS
is not set correctly. - The PR does not fully fix the issue.
About the part I fixed SWIFT_INCLUDE_PATHS
- when vendored_xcframework exists in the podspec and contains the swift library,
- 1 and when test_spec or app_spec exists in podspec,
- 1 and 2 and when source files exist in the podspec
Cc @igor-makarov
The unit test failed in the ubuntu system. I debugged and found that the file path is case-sensitive, while mac is case-insensitive. I found in the xcframework_slice.rb
file that this method lowercases the first letter of the name. This caused my unit test to fail. Why is it downcase here? Does anyone know the reason?🤔
# @return [String] the name of the framework
#
def name
@name ||= begin
case package_type
when :framework
File.basename(path, '.framework')
when :library
result = File.basename(path, '.a').gsub(/^lib/, '')
result[0] = result.downcase[0]
result
else
raise Informative, "Invalid package type `#{package_type}`"
end
end
end
I don't quite understand why 'config_spec.rb -> exclude_from_backup ' fails, but it shouldn't be related to my modification.