Skip to content

📦 A plugin for CocoaPods that creates XCFramework(for internal distribution) for speeding up build time.

License

Notifications You must be signed in to change notification settings

muukii/cocoapods-frost

Repository files navigation

cocoapods-frost

A plugin for CocoaPods that creates XCFramework(for internal distribution) for speeding up build time.

🚜 Still working on development, but partially works

Alternatives

Support this project

If you are interested in this project or you need

  • Hit the ⭐️ button to make this project popular.
  • Becoming sponsorship in subscription or one-time.
yellow-button

Features

  • Supports static or dynamic by use_frameworks! :linkage => :static
  • Supports coexisting in source code and frameworks

known Issues

Managed in issues

  • Supports only iOS currently
  • some pods fails build
    • especially, already provided as framework
    • if you found such pod, please report it from issues
  • Does not create xcframework for implicit dependencies from a pod
    • Make it explicit using frost_pod.
    • For instance, frost_pod 'Alamofire' for frost_pod 'Moya'
  • Multiple specifying pods with pod and frost_pod
    • Do not use pod and frost_pod in different target. Please use either one.
  • Not inherited current install version in pod
    • Specify install version (e.g. pod 'some', "1.2.0")
  • Not supported yet building pod that has resource

Attention

  • Should build all of targets when pod updated - partially building might causes linking error (compile-time or dynamic-linking-time)
    • Future updates, completely isolated pods can be build partially.

How it works

  • Defines pod by frost_pod that creates XCFramework.
  • Builds and creates XCFramework with -allow-internal-distribution from build settings CocoaPods generated.
  • Generates a podspec.json that installs XCFramework as vendored_frameworks
  • frost_pod uses that generated podspec as a local pod. which installs XCFramework instead of sources.

Making XCFrameworks

Make bundler installs cocoapods-frost

Gemfile

gem 'cocoapods-frost', git: "https://github.com/muukii/cocoapods-frost.git", branch: "main"

Annotate Podfile that uses cocoapods-frost as plugin

Podfile

plugin "cocoapods-frost"

Specifies pods with pod_frost that needs to create XCFramework.
Still, using pod can be left to build from source code.

Podfile

frost_pod "Moya"
frost_pod "MondrianLayout"

pod "JAYSON"

Build XCFrameworks

$ bundle exec pod frost

Then

$ bundle exec pod install

Updating pods

Use --update-pods to update pods

$ bundle exec pod frost --update-pods=RxSwift

Directory structure

  • Repository
    • Podfile
    • Podfile.lock
    • FrostPodfile.lock cocoapods-frost creates, should be managed in git
    • Pods
    • FrostPods <- cocoapods-frost creates
      • GeneratedPods (should be managed in git, git-lfs, something else)

About subspecs

CocoaPods integrates multiple subspecs into one module.
Generated XCFramework contains all of subspecs specified in Podfile.

For instance,

https://github.com/Moya/Moya/blob/master/Moya.podspec

frost_pod "Moya/Core"
frost_pod "Moya/Combine"

that creates Moya.xcframework includes core implementation and combine supports.

So frost_pod specifies as whole pod with dropping subspec specifiers.

Development

It supports debugging in VSCode.

License

MIT

Author

About

📦 A plugin for CocoaPods that creates XCFramework(for internal distribution) for speeding up build time.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages