title: xcode4: reliably detect the DerivedData directory of a project/workspace
body: <p>Xcode 4 builds everything into <code>$HOME/Library/Developer/Xcode/DerivedData/$PROJECT-$UUID</code>, where <code>$UUID</code> is a seemingly random string (it's not really random, it just looks random).</p>
  
  <p>How can I reliably detect the <code>$PROJECT-$UUID</code> part of the above? I've seen a script (<a href="https://gist.github.com/949831" rel="nofollow">https://gist.github.com/949831</a>) that guesses by assuming it is the last modified directory in DerivedData -- but that's not true if my CI machine is building a few projects in parallel.</p>