Skip to content

cocoapods.star

Bump CocoaPods pod versions and the platform version in Podfiles.

Edits are line-based, so comments and layout stay as they were. Podfile.lock isn't updated; run pod update <name> in a run step on a macOS runner when it is committed.

load("@fleet//cocoapods.star", "podfiles", "set_pod", "set_platform")
Function What it does
podfiles Lists the repo's Podfiles.
set_pod Sets a pod's version requirement wherever a Podfile lists it with one.
set_platform Raises the deployment target in platform :ios, '13.0', never lowering it.

podfiles

podfiles(repo)

Lists the repo's Podfiles.

Arguments

Name Description
repo The repo passed to change(repo).

Returns: The sorted paths of every Podfile outside Pods directories.

Example

podfiles(repo)
# returns ["ios/Podfile"]

ios/Podfile

platform :ios, '13.0'

ios/Pods/x/Podfile

x

Source

set_pod

set_pod(repo, name, requirement)

Sets a pod's version requirement wherever a Podfile lists it with one.

A newer version already there is kept, so a campaign never lowers one.

Pods without a version, or pinned to a :git source, are left alone. Subspecs match by their full name, such as Firebase/Analytics.

Arguments

Name Description
repo The repo passed to change(repo).
name The pod name.
requirement The requirement, such as ~> 5.9.

Returns: The list of paths that changed.

Example

set_pod(repo, "Alamofire", "~> 5.9")
# returns ["ios/Podfile"]

ios/Podfile

target 'App' do
  pod 'Alamofire', '~> 5.6'
  pod 'SnapKit'
end

ios/Podfile

target 'App' do
  pod 'Alamofire', '~> 5.9'
  pod 'SnapKit'
end

Used in: cocoapods-ios-15

Source

set_platform

set_platform(repo, platform, version)

Raises the deployment target in platform :ios, '13.0', never lowering it.

Arguments

Name Description
repo The repo passed to change(repo).
platform The platform, such as ios, osx or tvos.
version The minimum version, such as 15.0.

Returns: The list of paths that changed.

Example

set_platform(repo, "ios", "15.0")
# returns ["ios/Podfile"]

ios/Podfile

platform :ios, '12.0'
use_frameworks!

ios/Podfile

platform :ios, '15.0'
use_frameworks!

Used in: cocoapods-ios-15

Source