title: How do I automate building the source distribution for an iPhone app with Xcode?
body: <p>I am looking to distribute an open source iPhone app and I have a few questions about making the source distribution:</p>
  
  <ol>
  <li><p>How can I automate creating the source archive (or diskimage) with XCode? I want something along the lines of a build target which archives the source (cleaning targets first if necessary, but it would be nice if it didn't have to). I also have an external netbeans project with a ruby script that is used to build an SQL database that the program needs (but can make a separate archive of that if necessary).</p></li>
  <li><p>What's the best way to identify the files that constitute the 'source'? Is it simply anything that's left after cleaning all targets? Any caveats with that approach (I don't quite trust IDEs to clean up all the cruft they seem to make - also is this liable to include any codesigning stuff that it shouldn't)?</p></li>
  </ol>