Skip to content

Commit

Permalink
ios: fix podspec for v0.2.0 support (#577)
Browse files Browse the repository at this point in the history
Makes several updates to our podspec in order to fix CocoaPods integration with v0.2.0:

- Link `resolv.9` and `c++` which is being done with Bazel today
- Link `SystemConfiguration` which is being done with Bazel today
- Specify Swift version and platform version
- Specify `source_files` **with an empty `.swift` file** in order to ensure that Swift libraries are linked when building (i.e., `swiftFoundation`)

**Important notes:**
Releasing new versions of the pod requires the following manual changes:
- Unzipping `envoy_ios_framework.zip`
- Renaming the directory to `envoy_ios_cocoapods`
- Creating an empty file at `envoy_ios_cocoapods/Envoy.framework/Swift/Empty.swift`. This forces CocoaPods to link Swift libraries as necessary. We worked around this in Bazel similarly in the past [here](envoyproxy/envoy-mobile@b8216e4#diff-6dc94efb18b54c46a32898ba3a5a0756R15)
- Copying the repo's `LICENSE` file and placing it at `envoy_ios_cocoapods/LICENSE`
- Re-zipping `envoy_ios_cocoapods` and uploading `envoy_ios_cocoapods.zip`

In the future, we should see if this can be simplified or at the very least add a script that uploads this artifact with each commit to master just like we do with other artifacts. This is being tracked in envoyproxy/envoy-mobile#578.

Note: There is a similar problem reported in CocoaPods that requires this empty Swift file workaround: CocoaPods/CocoaPods#8649.

I tested this PR by using this podspec for building an app against Envoy Mobile with CocoaPods. This spec is currently published as v0.2.0.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
rebello95 authored and jpsim committed Nov 29, 2022
1 parent 4cbed60 commit 64fbac5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions mobile/EnvoyMobile.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Pod::Spec.new do |s|
s.name = 'EnvoyMobile'
s.version = '0.2.0'
s.author = 'Lyft, Inc.'
s.summary = 'Client networking libraries based on the Envoy project'
s.homepage = 'https://envoy-mobile.github.io'
s.name = 'EnvoyMobile'
s.version = '0.2.0'
s.author = 'Lyft, Inc.'
s.summary = 'Client networking libraries based on the Envoy project'
s.homepage = 'https://envoy-mobile.github.io'
s.documentation_url = 'https://envoy-mobile.github.io/docs/envoy-mobile/latest/index.html'
s.social_media_url = 'https://twitter.com/EnvoyProxy'
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
s.platform = :ios
s.source = { :http => "https://github.com/lyft/envoy-mobile/releases/download/v#{s.version}/envoy_ios_framework.zip" }
s.ios.vendored_frameworks = 'Envoy.framework'
s.social_media_url = 'https://twitter.com/EnvoyProxy'
s.license = { type: 'Apache-2.0', file: 'envoy_ios_cocoapods/LICENSE' }
s.platform = :ios, '10.0'
s.swift_version = '5.1'
s.libraries = 'resolv.9', 'c++'
s.frameworks = 'SystemConfiguration'
s.source = { http: "https://github.com/lyft/envoy-mobile/releases/download/v#{s.version}/envoy_ios_cocoapods.zip" }
s.vendored_frameworks = 'envoy_ios_cocoapods/Envoy.framework'
s.source_files = 'envoy_ios_cocoapods/Envoy.framework/Headers/*.h', 'envoy_ios_cocoapods/Envoy.framework/Swift/*.swift'
end

0 comments on commit 64fbac5

Please sign in to comment.