put source code inside app


I am just wondering if there is any standard way of getting XCode to dump the source code of a project inside an app. I think it would be nice if your main code (not libraries) got put inside the app into a source folder.

I am just aware of it as my hard drive got damaged and I had a copy of the app but not the code… :smiley: )

Just looking for some tips on backing up source code as I guess other folk are thinking about this too.



Every day, prior to changing source code, I select all the .h and .cpp files and compress them on a dated .zip or .tgz file, as in SRC_2010_12_12a.tgz
Every week or so I back up these files to other machine.

i zip my project and upload to my ftp-account and sometimes i use bazaar as my personal version control system. bazaar has the nice feature to work without a server. you can just use folders as a target. that also saves different versions of code.


good question – on xcode, if you unfold the “target” on the left side, you’ll see a “run script phase” as part of the build – at the moment we use this for copying fmod into the .app – you can likely hack this to add the source code or size the source code up:

at the moment, it looks like:

cp -f ../../../libs/fmodex/lib/libfmodex.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib"  

on other IDEs, this is usually referred to a “post build” step when you can run a script. on windows we copy Dlls, for example.

  • z

Thanks guys… Really useful tips :smiley:
Better start using them before I loose a load more code.



another way to save source code is to set up a revision tracking source code repository, such as SVN. Google Code offers free SVN hosting, which is handy…