XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

How to dependent a cocoapods target

Open smalllixin opened this issue 7 years ago • 2 comments

My app depends on some cocoapods project. And the framework target generated by xcodegen need import module from cocoapods.

SomeApp:

  • MyLibA

Podfile: LibB

// in MyLibA source code import LibB //No such module 'LibB'

I just do not find any elegant solution for this. Any practice solve this plz?

smalllixin avatar May 14 '19 13:05 smalllixin

I believe you should add the LibB library to the MyLibA target dependencies on your Podfile. Xcodegen has nothing to do with it since cocoa pods will create a workspace from your .xcodeproject.

FilipeJrd avatar May 15 '19 17:05 FilipeJrd

I believe you should add the LibB library to the MyLibA target dependencies on your Podfile. Xcodegen has nothing to do with it since cocoa pods will create a workspace from your .xcodeproject.

I cannot use this way because there's may many xcodegen targets depend on many cocoapods target. It is hard to maintain.

My final solution is create a target template. Which specify the xcconfig file cocoapods generated.

configFiles: Debug: "Pods/Target Support Files/Pods-XXXXX/Pods-XXXXX.debug.xcconfig" Release: "Pods/Target Support Files/Pods-XXXXX/Pods-XXXXX.release.xcconfig"

smalllixin avatar May 16 '19 06:05 smalllixin