XCode Build Question
I am building my game with XCode.
When I build my target, the Copy Bundle Resources correctly copies my resources, like lua scripts or textures, into the bundle.
The problem is that if I only change my resources, I have to do a clean, then a build to get the new resources deployed. The project consists of 50 or so source code files, and a build takes more than 30 seconds.
Is there a way I can make XCode just execute the Copy Bundle Resources but not rebuild all the files. (e.g. avoid the clean?)
Thanks for any tips
When I build my target, the Copy Bundle Resources correctly copies my resources, like lua scripts or textures, into the bundle.
The problem is that if I only change my resources, I have to do a clean, then a build to get the new resources deployed. The project consists of 50 or so source code files, and a build takes more than 30 seconds.
Is there a way I can make XCode just execute the Copy Bundle Resources but not rebuild all the files. (e.g. avoid the clean?)
Thanks for any tips
Yes, Xcode is broken. There are other alternatives (my personal favorite being SCons for building and TextMate for editing), but if you want to stick with Xcode, your best bet is to make a custom shell script build phase to copy your resources.
Here's one from an [old] project of mine. Don't expect just to drop this in and have it work, but it should give you an idea of the kind of things you might have to do, anyway
Here's one from an [old] project of mine. Don't expect just to drop this in and have it work, but it should give you an idea of the kind of things you might have to do, anyway

Code:
#!/usr/bin/env ruby
def execute(command)
puts(command)
system(command)
end
$resources_dir =
"#{ENV['TARGET_BUILD_DIR']}/#{ENV['UNLOCALIZED_RESOURCES_FOLDER_PATH']}"
$source_dir = ENV['SOURCE_ROOT']
execute("mkdir -p '#{$resources_dir}'")
if ENV['BUILD_STYLE'] == 'Development' then
if FileTest.exists?("#{$resources_dir}/Assets") then
execute("rm -f '#{$resources_dir}/Assets'")
end
execute("ln -sf '#{$source_dir}/Resources/Assets' '#{$resources_dir}/Assets'")
else
execute("cd Resources && tar -c --exclude-from ../FileExclusions.txt '.svn' Assets | tar -x --directory '#{$resources_dir}'")
end
Thanks for the quick reply.
And for the script.
And the fact it is in ruby is very appropriate, since I have been "exploring" both Ruby and Rails in my day job.
;-)
And for the script.
And the fact it is in ruby is very appropriate, since I have been "exploring" both Ruby and Rails in my day job.
;-)
BTW - Can you give your impression of sCons? Is it worth learning? What about Rant?
I personally love SCons. It's got its issues, but it's generally a very nice place to work.
I'd personally stay away from all build systems that don't have the full power of a scripting language in them. It's just something that makes life really easy if you have it, and really difficult if you don't.
That basically leave Cons, SCons and Rake... and rake can't do parallel builds, and Cons is superseded in every way by SCons
I'd personally stay away from all build systems that don't have the full power of a scripting language in them. It's just something that makes life really easy if you have it, and really difficult if you don't.
That basically leave Cons, SCons and Rake... and rake can't do parallel builds, and Cons is superseded in every way by SCons
Thanks for the feedback!
I wish there was an sCons which used Ruby instead of Python, but I guess I could bite the bullet and check out Python.
Have you looked at Rant at all?
http://rant.rubyforge.org/
It looks like it might be more of like sCons with Ruby, but it doesn't look like it has nearly as active of a community around it.
BTW - Is there any magic to building an app bundle from the command-line? I have been spoiled by xcode, and never really read much about it.
Also - Do you know if Apple has plans to improve XCode at all?
Thanks again for any feedback...
I wish there was an sCons which used Ruby instead of Python, but I guess I could bite the bullet and check out Python.
Have you looked at Rant at all?
http://rant.rubyforge.org/
It looks like it might be more of like sCons with Ruby, but it doesn't look like it has nearly as active of a community around it.
BTW - Is there any magic to building an app bundle from the command-line? I have been spoiled by xcode, and never really read much about it.
Also - Do you know if Apple has plans to improve XCode at all?
Thanks again for any feedback...
It looks like it's still a bit immature, to me -- in particular, no parallel builds mentioned in the documentation. Still, worth keeping an eye on.
There's no magic to building an app bundle, just put the right files in the right places. There's an SConstruct here you can steal if you like: http://onesadcookie.com/trac/browser/Astro/SConstruct
Of course Apple plans to "improve" Xcode -- take a look at their Leopard teaser site at some point to get an idea of what they're doing. Whether or not you think those improvements are important or not is up to you...
There's no magic to building an app bundle, just put the right files in the right places. There's an SConstruct here you can steal if you like: http://onesadcookie.com/trac/browser/Astro/SConstruct
Of course Apple plans to "improve" Xcode -- take a look at their Leopard teaser site at some point to get an idea of what they're doing. Whether or not you think those improvements are important or not is up to you...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Question : Deploy xcode 3.1.3 to ios 5+ ? | papaonn | 6 | 4,511 |
Apr 12, 2012 08:37 PM Last Post: MattDiamond |
|
| xcode build optimizations | NelsonMandella | 5 | 5,445 |
Jul 24, 2009 06:39 AM Last Post: Oddity007 |
|
| XCode doesn't realize a library has changed unless you force your project to build. | XSTNX | 6 | 4,951 |
Jun 8, 2009 10:25 AM Last Post: XSTNX |
|
| xcode build problem | NelsonMandella | 7 | 4,909 |
Apr 13, 2009 12:21 PM Last Post: szymczyk |
|
| Stupid xcode question: How do I turn off precompiled headers? | SourceIT | 2 | 6,011 |
Aug 30, 2008 12:53 PM Last Post: SourceIT |
|

