Class: HighFive::Thor::Tasks::Ios
Instance Method Summary
collapse
#replace_image
Methods included from IosHelper
#info_plist_path, #ios_icon_sizes, #ios_path, uuid_from_mobileprovision, #xcodeproj_path
inherited
Instance Method Details
#set_icon(path) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/high_five/thor/tasks/ios.rb', line 37
def set_icon(path)
icon_files = plist['CFBundleIcons']["CFBundlePrimaryIcon"]["CFBundleIconFiles"]
icon_files += [ plist['CFBundleIconFile'] ]
icon_files += plist['CFBundleIcons~ipad']["CFBundlePrimaryIcon"]["CFBundleIconFiles"]
icon_files.each do |icon_entry|
icon_file_name = icon_entry
unless icon_entry.end_with? ".png"
icon_file_name += ".png"
end
old_icon_path = Dir[File.join(ios_path, "#{target}/**/#{icon_file_name}")].first
old_icon_path = Dir[File.join(ios_path, "**/#{icon_file_name}")].first if old_icon_path.nil?
if old_icon_path.nil?
puts "Skipping #{icon_entry} because the file is missing. This will cause problems with app store submission"
next
end
print "Replacing #{old_icon_path}..."
old_image = ChunkyPNG::Image.from_file(old_icon_path)
puts "#{old_image.width}x#{old_image.height}"
replace_image(old_icon_path, path)
end
end
|
#set_version ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/high_five/thor/tasks/ios.rb', line 18
def set_version
if (options[:version])
puts "Changing version from #{plist["CFBundleShortVersionString"]} => #{options[:version]}"
plist["CFBundleShortVersionString"] = options[:version]
end
if (options[:build_number])
puts "Changind build number from #{plist["CFBundleVersion"]} => #{options[:build_number]}"
plist["CFBundleVersion"] = options[:build_number]
end
File.open(plist_path, 'w') do |f|
f.write(Plist::Emit.dump(plist))
end
puts "Wrote #{plist_path} succesfully"
end
|