-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add arbitrary configuration settings to liftoffrc #174
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,24 @@ def add_script_phases(scripts) | |
end | ||
end | ||
|
||
def perform_extra_config(extra_config) | ||
if extra_config | ||
extra_config.each do |name, settings| | ||
if name.downcase == "all" | ||
object = target | ||
else | ||
object = target.build_settings(name) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thoughts on extracting this conditional to a private method? object = find_or_build_target(name) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not actually what this is doing. This is all fetching. It either gets the |
||
|
||
if object | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
settings.each do |key, value| | ||
object[key] = value | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
def save | ||
xcode_project.save | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Xcodeproj | ||
class Project | ||
module Object | ||
class PBXNativeTarget | ||
def []=(key, value) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I'm not sure why you're doing this I'm guessing you probably can't extract this one so... I guess leave this one :/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of this is basically to serve this line Since setting the build settings on all configurations in the target is a different API than setting a build setting on a single configuration, I'm just trying to make my life a little easier. |
||
self.build_configurations.each do |configuration| | ||
configuration.build_settings[key] = value | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
extra_config
a hash? Can it sometimes benil
? You may want to use theHash()
method: http://www.ruby-doc.org/core-2.1.3/Kernel.html#method-i-HashThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually set inside the config file. I was thinking about doing a refactor to make sure that a lot of these variables don't end up
nil
, but I'm not sure it's worth it since I'm considering porting the entire project to Swift.