-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPodfile
More file actions
46 lines (31 loc) · 1.13 KB
/
Podfile
File metadata and controls
46 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'OnForte' do
pod 'Soundcloud'
pod 'Alamofire', '~> 3.0'
end
target 'OnForteTests' do
end
target 'OnForteUITests' do
end
post_install do |installer|
plist_buddy = "/usr/libexec/PlistBuddy"
installer.pods_project.targets.each do |target|
plist = "Pods/Target Support Files/#{target}/Info.plist"
version = `#{plist_buddy} -c "Print CFBundleShortVersionString" "#{plist}"`.strip
stripped_version = /([\d\.]+)/.match(version).captures[0]
version_parts = stripped_version.split('.').map { |s| s.to_i }
# ignore properly formatted versions
unless version_parts.slice(0..2).join('.') == version
major, minor, patch = version_parts
major ||= 0
minor ||= 0
patch ||= 999
fixed_version = "#{major}.#{minor}.#{patch}"
puts "Changing version of #{target} from #{version} to #{fixed_version} to make it pass iTC verification."
`#{plist_buddy} -c "Set CFBundleShortVersionString #{fixed_version}" "#{plist}"`
end
end
end