Skip to content

Add "pod lib lint --use-libraries" to GitHub actions to validate GoogleSignIn builds as a library #33

Closed

Description

@jmagman

Currently there's a GitHub Action to test GoogleSignIn builds as a framework. Add a test to validate it still builds as a library.

- name: Lint podspec using local source
run: pod lib lint --verbose --allow-warnings

    - name: Lint podspec using local source as library
      run: pod lib lint --verbose --allow-warnings --use-libraries

Activity

  1. paulb777 commented on Jul 20, 2021

    @paulb777
    Member

    Here's an example that also tests --use-static-framework as well as other Apple platforms - https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/core.yml#L68

  2. jmagman commented on Jul 20, 2021

    @jmagman
    Author

    https://github.com/firebase/firebase-ios-sdk/blob/04ab074265633049d5518866515e3bd7fc0de246/.github/workflows/core.yml#L78-L79
    says

              # Tests are skipped since the Swift tests need modules.
              '--skip-tests --use-libraries'

    "Tests are skipped since the Swift tests need modules" is the same bug in that repo as #32. I filed this GitHub Action request to validate the modules are generated for libraries when that issue is fixed, which can be done by adding an @import GoogleSignIn in the unit tests or making any of them Swift files.

  3. paulb777 commented on Jul 20, 2021

    @paulb777
    Member

    That's arguably not a bug since it can be argued that the decision to use modules or not should be left to the pod consumer who can specify use_frameworks! or use_frameworks! :linkage => :static to generate frameworks and modules if desired. I believe CocoaPods has always documented that Swift clients should use use_frameworks! and it was changed awhile ago so that the Podfile created by pod init has use_frameworks! on. I realize that I'm treating modules and frameworks as a synonym, and maybe that's an issue, but we haven't heard about it from Firebase clients.

  4. jmagman commented on Jul 20, 2021

    @jmagman
    Author

    Indeed, Swift clients should use use_frameworks!. I investigated this more in flutter/flutter#25676 (comment) (mostly in the context of Swift plugins being consumed by Objective-C clients). However there's no reason not to support module maps regardless of the client language. DEFINES_MODULE=YES is the default build setting in a new vanilla Xcode Objective-C or Swift framework targets.

    In any case for the sake of this GitHub Action request, --use-libraries is still a good thing to test for Objective-C clients.

  5. paulb777 commented on Jul 20, 2021

    @paulb777
    Member

    Agreed, and also --use-static-framework testing should be added since that is the more modern way to choose static linking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions