Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add BUILD_LIBRARY_FOR_DISTRIBUTION flag to podspec #2372

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gquattromani
Copy link

BUILD_LIBRARY_FOR_DISTRIBUTION = YES is essential for both source and binary distribution, but its primary benefits and the reasons it's crucial relate to how the Swift compiler handles modules and binary compatibility.

When enabled, the Swift compiler generates a .swiftinterface file alongside your compiled .swiftmodule. This .swiftinterface acts as a stable, textual representation of your library's public API. It's an Application Binary Interface (ABI) contract.
This should prevent from setting the flag manually in a host app that integrates the SDK.

  • CocoaPods: The line s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' } in your podspec explicitly tells CocoaPods to enable this build setting when it builds your library, whether it's building it from source or creating an XCFramework. Without this line, CocoaPods might use a default setting that doesn't include module stability.

  • Swift Package Manager (SPM): SPM implicitly enables BUILD_LIBRARY_FOR_DISTRIBUTION (or its equivalent) when you define a .library product in your Package.swift. This is why you don't need to add any extra configuration to your Package.swift. SPM handles module stability by default.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gquattromani, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds the BUILD_LIBRARY_FOR_DISTRIBUTION = YES flag to the Kingfisher podspec. This flag is essential for both source and binary distribution, as it ensures that the Swift compiler generates a .swiftinterface file alongside the compiled .swiftmodule, providing a stable, textual representation of the library's public API. This prevents the need to manually set the flag in host apps that integrate the SDK.

Highlights

  • Feature: The BUILD_LIBRARY_FOR_DISTRIBUTION flag is added to the podspec to ensure module stability and binary compatibility.
  • Configuration: The s.pod_target_xcconfig setting in the podspec is updated to explicitly enable the BUILD_LIBRARY_FOR_DISTRIBUTION build setting.

Changelog

  • Kingfisher.podspec
    • Added s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' } to enable the BUILD_LIBRARY_FOR_DISTRIBUTION build setting.
    • This ensures that a .swiftinterface file is generated for module stability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Did you know?

The Swift programming language was first released by Apple in 2014.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request adds the BUILD_LIBRARY_FOR_DISTRIBUTION flag to the podspec, which is essential for both source and binary distribution. The changes look good and the reasoning behind the change is well-explained in the pull request description.

Merge Readiness

The code change is straightforward and necessary for ensuring module stability. I recommend merging this pull request. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant