Closed jayzes closed 11 years ago
Rayh and I have talked about this issue before when I wanted to add the ability to use Cedar for testing or something like that. I remember trying to attack this problem. Let me think on this with some feedback about creating a robust system to handle all different types of environment variables, flags, and such.
I think we started talking about having some sort of DSL or such like for constructing Xcode command lines. You have several different types of arguments you can pass... perhaps something like:
cmd = Xcode::Command.new 'xcodebuild' do |cmd|
cmd.env['FOO'] = 'BAR'
cmd.args << 'build'
cmd.params['-project'] = 'MyProject.xcodeproj'
end
cmd.invoke do |line|
puts line
end
And then when you are invoking it from builder:
builder.build do |cmd|
cmd.env['ANOTHER_FLAG'] = 'VALUE'
end
Or perhaps some other mechanism to hook into the process. I'm not that happy with the way the builder class is done right now... it mostly to provide common utility functions to a Rakefile for automating builds, so I'm open to suggestions.
@jayzes Could you take a look at the newer approach to Xcode::Shell::Command and see if that helps? The builder has a build_environment method that is expected to return additional environment vars, but could be extended through a property, or pick up from ENV[]
Please reopen if this is still relevant
Cool, sounds good. Looks good to me at first glance - I'll try to dig in more this weekend.
In one of my projects, I ran into a need to pass custom environment variables to a build operation and patched xcoder to handle that. Figured I'd push the change back upstream as well. A spec is included.