Skip to content

Latest commit

History

History
140 lines (96 loc) 路 3.75 KB

README.md

File metadata and controls

140 lines (96 loc) 路 3.75 KB

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