Commit 6448d66b authored by David Cordero's avatar David Cordero Committed by Carola Nitz

Update watchkit and watchkit extension version and build number as part of bumping iOS

(cherry picked from commit d496445b3f3b0dc556479d8af6f1abb449c9eb21)
parent 5090bb72
......@@ -17,24 +17,35 @@ desc '- Build and sign the app'
desc '- Update the changelog from the NEWS file'
desc '- Push the version bump'
lane :release do |options|
platform = get_platform options
ensure_git_status_clean
clear_derived_data
bump_version_and_commit if platform == 'iOS'
git_apply_private_constants
cocoapods(repo_update: true)
gym(scheme: "VLC-#{platform}")
pilot(app_platform: platform == 'tvOS' ? 'appletvos' : 'ios')
update_changelog
push_to_git_remote
platform = get_platform options
version = get_version options
ensure_git_status_clean
clear_derived_data
set_version_bump_build_and_commit(platform: platform, version: version)
git_apply_private_constants
cocoapods(repo_update: true)
gym(scheme: "VLC-#{platform}")
pilot(app_platform: platform == 'tvOS' ? 'appletvos' : 'ios')
update_changelog
push_to_git_remote
end
#### Private ####
desc 'Bump and commit app version and build number'
private_lane :set_version_bump_build_and_commit do |options|
increment_build_number_in_a_single_target(options[:platform] == 'tvOS' ? VLC::InfoPlistPath::TVOS : VLC::InfoPlistPath::IOS)
set_version_number_in_a_single_target(options[:platform] == 'tvOS' ? VLC::InfoPlistPath::TVOS : VLC::InfoPlistPath::IOS, options[:version])
if options[:platform] == 'tvOS'
increment_build_number_in_plist(VLC::infoPlistPath[:tvOS])
set_version_number_in_plist(VLC::infoPlistPath[:tvOS], options[:version])
elsif options[:platform] == 'iOS'
increment_build_number_in_plist(VLC::infoPlistPath[:iOS])
increment_build_number_in_plist(VLC::infoPlistPath[:watchKitExtension])
increment_build_number_in_plist(VLC::infoPlistPath[:watchOS])
set_version_number_in_plist(VLC::infoPlistPath[:iOS], options[:version])
set_version_number_in_plist(VLC::infoPlistPath[:watchKitExtension], options[:version])
set_version_number_in_plist(VLC::infoPlistPath[:watchOS], options[:version])
end
commit_version_bump(message: 'Version Bump by fastlane', force: true)
end
......
......@@ -35,7 +35,7 @@ This action does the following:
- Clear derived data
- Increment the version and build number and commit the change (only for iOS releases)
- Set the version, bump the build number and commit the change
- Apply the privateConstants which include the credentials
......
#!/usr/bin/ruby
class VLC
def self.infoPlistPath
return {
iOS: '../Sources/VLC for iOS-Info.plist',
tvOS: '../Apple-TV/Info.plist',
watchKitExtension: '../VLC WatchKit Native Extension/Info.plist',
watchOS: '../VLC WatchKit Native/Info.plist'
}
end
end
def set_version_number_in_plist(plistPath, version)
versionNumber = `xcrun /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "#{plistPath}"`
puts "Next version: #{version}"
puts "Current version: #{versionNumber}"
`/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString #{version}" "#{plistPath}"`
end
def increment_build_number_in_plist(plistPath)
buildNumber = `xcrun /usr/libexec/PlistBuddy -c "Print CFBundleVersion" "#{plistPath}"`
`/usr/libexec/PlistBuddy -c "Set :CFBundleVersion #{buildNumber.next}" "#{plistPath}"`
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment