Skip to content

Commit

Permalink
Move settings bundle to correct location (even in fallback cases)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcrumb authored and gfontenot committed Feb 4, 2015
1 parent fd04483 commit fda83f4
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions lib/liftoff/settings_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,27 @@ def generate
end

def move_settings_bundle
FileManager.new.generate('Settings.bundle', 'Resources/Settings.bundle', @config)
parent_group = xcode_project['Resources'] || xcode_project.main_group
parent_group = xcode_project[@config.project_name]['Resources']
if (parent_group)
file = parent_group.new_file('Settings.bundle')
target.add_resources([file])
settings_bundle_path = "#{@config.project_name}/Resources/Settings.bundle"
else
parent_group = xcode_project[@config.project_name]

if (parent_group)
settings_bundle_path = "#{@config.project_name}/Settings.bundle"
else
parent_group = xcode_project.main_group

if (parent_group)
settings_bundle_path = 'Settings.bundle'
end
end
end

if (parent_group)
FileManager.new.generate('Settings.bundle', settings_bundle_path, @config)
file_reference = parent_group.new_file('Settings.bundle')
target.add_resources([file_reference])
xcode_project.save
end
end
Expand Down

0 comments on commit fda83f4

Please sign in to comment.