fastlane/lib/fastlane/actions/get_version_number.rb in fastlane-2.197.0 vs fastlane/lib/fastlane/actions/get_version_number.rb in fastlane-2.198.0
- old
+ new
@@ -107,12 +107,14 @@
plist_file = plist_files[configuration]
elsif plist_files_count > 1
options = plist_files.keys
selected = UI.select("What build configuration would you like to use?", options)
plist_file = plist_files[selected]
- else
+ elsif plist_files_count > 0
plist_file = plist_files.values.first
+ else
+ return nil
end
# $(SRCROOT) is the path of where the XcodeProject is
# We can just set this as empty string since we join with `folder` below
if plist_file.include?("$(SRCROOT)/")
@@ -129,10 +131,12 @@
plist_file
end
def self.get_version_number_from_plist!(plist_file)
+ return '$(MARKETING_VERSION)' if plist_file.nil?
+
plist = Xcodeproj::Plist.read_from_path(plist_file)
UI.user_error!("Unable to read plist: #{plist_file}") unless plist
plist["CFBundleShortVersionString"]
end
@@ -144,10 +148,10 @@
def self.description
"Get the version number of your project"
end
def self.details
- "This action will return the current version number set on your project."
+ "This action will return the current version number set on your project. It first looks in the plist and then for '$(MARKETING_VERSION)' in the build settings."
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :xcodeproj,