CocoaPods icon indicating copy to clipboard operation
CocoaPods copied to clipboard

Fix `SWIFT_INCLUDE_PATHS` for swift library xcframework

Open xuzhongping opened this issue 2 years ago • 3 comments

Issue

  • https://github.com/CocoaPods/CocoaPods/issues/10058
  • https://github.com/CocoaPods/CocoaPods/pull/11093

Description

Existing issues

  1. If a swift library of type library exists in vendored xcframework, SWIFT_INCLUDE_PATHS is not set correctly.
  2. The PR does not fully fix the issue.

About the part I fixed SWIFT_INCLUDE_PATHS

  1. when vendored_xcframework exists in the podspec and contains the swift library,
  2. 1 and when test_spec or app_spec exists in podspec,
  3. 1 and 2 and when source files exist in the podspec

xuzhongping avatar Apr 01 '22 13:04 xuzhongping

Cc @igor-makarov

dnkoutso avatar Apr 01 '22 14:04 dnkoutso

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

xuzhongping avatar Apr 02 '22 02:04 xuzhongping

I don't quite understand why 'config_spec.rb -> exclude_from_backup ' fails, but it shouldn't be related to my modification.

xuzhongping avatar Sep 10 '22 02:09 xuzhongping