CocoaPods / Rome

Makes it easy to build a list of frameworks.
MIT License
694 stars 64 forks source link

XCFramework Support #90

Open npamidisf opened 3 years ago

npamidisf commented 3 years ago

Adding changes to add support for building XCFrameworks. Also allowing users to pass custom flags via user options to be able support use cases like building swift frameworks with ABI Module stability and more needs

npamidisf commented 3 years ago

@amorde is this repo still accepting prs?

npamidisf commented 3 years ago

Amazing work! Thank you @npamidisf! Would be also cool to have a parameter where I can put a list of frameworks that I want to build as XCFrameworks. In some cases, I can still want to use the old-school format for some old Objc libraries for example :)

Good idea!!

orta commented 3 years ago

Hi folks, we've not had anyone actively maintaining Rome for a while, do you want to take over and help out? I can help get you access etc

temoki commented 3 years ago

I just tried to build XCFramework using this branch and encountered the same problem as this URL.

xcframework does not contain internal frameworks https://stackoverflow.com/questions/58805812/xcframework-does-not-contain-internal-frameworks

I was able to successfully build XCFramework by enabling the BUILD_LIBRARY_FOR_DISTRIBUTION flag in my podfile with the following statement.

plugin 'cocoapods-rome', { :pre_compile => Proc.new { |installer|
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
    end
end

It would be nice if it could be built without the above description in the Podfile.

temoki commented 3 years ago

When I built the app by incorporating the XCFramework built with https://github.com/CocoaPods/Rome/pull/90#issuecomment-782580619 into an Xcode project, I encountered the same problem as the following URL.

Xcode 11 XCFramework "... is not a member type of ..." error https://developer.apple.com/forums/thread/123253

temoki commented 3 years ago

Finally, not adding the BUILD_LIBRARY_FOR_DISTRIBUTION flag and also adding the -allow-internal-distribution option when running -create-xcframework worked.

cocoapods-rome/post_install.rb#L70

#args = %W(-create-xcframework -output #{output})
args = %W(-create-xcframework -allow-internal-distribution -output #{output})
xwal commented 3 years ago

Hi @npamidisf @AlexShubin @Ricowere ,will this PR be merged?