cocoapods-generate icon indicating copy to clipboard operation
cocoapods-generate copied to clipboard

Generated project behaves differently from embedding the Pod in an App.

Open gereons opened this issue 5 years ago • 2 comments

As mentioned in https://github.com/CocoaPods/CocoaPods/issues/9686 I'm seeing different behaviour from embedding a pod into my app and using the sample project generated by pod gen.

  • running xcodebuild on the generated project builds for maccatalyst instead of ios
  • Swift-Version specification for included pods does not seem to be passed along correctly.

To reproduce, clone https://github.com/gereons/CocoapodsGenTest and run the included gen-build.sh script.

This will produce an error

Compiling UIViewController+UIEmptyState.swift /.../TestLib/gen/TestLib/UIEmptyState/src/UIEmptyState/UIViewController+UIEmptyState.swift:228:18: 'bringSubviewToFront' has been renamed to 'bringSubview(toFront:)'

        view.bringSubviewToFront(newView)
             ^~~~~~~~~~~~~~~~~~~

while the same call in TestLib/Classes/ReplaceMe.swift compiles without problems.

This build finishes with the output

The following build commands failed: CompileSwift normal x86_64 /.../TestLib/gen/TestLib/UIEmptyState/src/UIEmptyState/UIViewController+UIEmptyState.swift CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler Ld /Users/gereon/Library/Developer/Xcode/DerivedData/TestLib-abhbyfdhfvwgoxeuoxkqludfutcv/Build/Products/Debug-maccatalyst/TestLib/TestLib.framework/Versions/A/TestLib normal x86_64

(emphasis mine)

Including this test pod into an app shows none of these errors.

gereons avatar Apr 06 '20 14:04 gereons

Is it the difference between swift 4.2 and swift 4?

segiddins avatar Jun 04 '20 17:06 segiddins

I don't think so - changing swift_versions in the .podspec to 4.0 also complains about the renaming issue (although maccatalyst isn't mentioned anymore).

gereons avatar Jun 04 '20 18:06 gereons