How can I set the CFBundleShortVersionString (aka MARKETING_VERSION) of a Swift Package?

Viewed 73

I have an Objective-C framework that I distribute via CocoaPods, Carthage, and Swift Package Manager. For the CocoaPods and Carthage versions, the CFBundleShortVersionString returns the value that I set in the .pbxproj file, but the Swift package one always returns 1.0, which I assume is the default value when there is no CFBundleShortVersionString. Is there a way to set this in Package.swift?

This is how I read the value at runtime:

let bundle = Bundle(for: Radar.self)
let versionString = bundle.infoDictionary!["CFBundleShortVersionString"] as? String
0 Answers
Related