Skip to content

Commit 45cb927

Browse files
committed
Infer icon file entries from resources/Icon*.png
1 parent cd5053e commit 45cb927

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/motion/project/template/ios/config.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,17 @@ def launch_image_metadata(path)
388388
}
389389
end
390390

391+
def icon_file_names
392+
images = resources_dirs.map do |dir|
393+
Dir.glob(File.join(dir, 'Icon*.png')).map do |file|
394+
f = File.basename(file, File.extname(file))
395+
i = f.rindex('@')
396+
i ? f[0...i] : f
397+
end
398+
end.flatten.compact
399+
images.uniq unless images.empty?
400+
end
401+
391402
# From iOS 7 and up we try to infer the launch images by looking for png
392403
# files that start with 'Default'.
393404
#
@@ -403,6 +414,7 @@ def launch_images
403414
end
404415

405416
def merged_info_plist(platform)
417+
self.icons = icon_file_names if icons.empty?
406418
ios = {
407419
'MinimumOSVersion' => deployment_target,
408420
'CFBundleResourceSpecification' => 'ResourceRules.plist',

0 commit comments

Comments
 (0)