Skip to content

Commit

Permalink
Infer icon file entries from resources/Icon*.png
Browse files Browse the repository at this point in the history
  • Loading branch information
hboon committed Oct 17, 2014
1 parent cd5053e commit 45cb927
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/motion/project/template/ios/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ def launch_image_metadata(path)
}
end

def icon_file_names
images = resources_dirs.map do |dir|
Dir.glob(File.join(dir, 'Icon*.png')).map do |file|
f = File.basename(file, File.extname(file))
i = f.rindex('@')
i ? f[0...i] : f
end
end.flatten.compact
images.uniq unless images.empty?
end

# From iOS 7 and up we try to infer the launch images by looking for png
# files that start with 'Default'.
#
Expand All @@ -403,6 +414,7 @@ def launch_images
end

def merged_info_plist(platform)
self.icons = icon_file_names if icons.empty?
ios = {
'MinimumOSVersion' => deployment_target,
'CFBundleResourceSpecification' => 'ResourceRules.plist',
Expand Down

0 comments on commit 45cb927

Please sign in to comment.